|
|
@ -1,9 +1,10 @@
|
|
|
|
import { Component, Inject, OnInit } from '@angular/core';
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { GroupInfo } from 'src/app/models/groupinfo';
|
|
|
|
import { GroupInfo } from 'src/app/models/groupinfo';
|
|
|
|
import {MatDialog, MatDialogRef} from '@angular/material/dialog';
|
|
|
|
import {MatDialog, MatDialogRef} from '@angular/material/dialog';
|
|
|
|
import { SocialService } from 'src/app/services/social/social.service';
|
|
|
|
import { SocialService } from 'src/app/services/social/social.service';
|
|
|
|
import { User } from 'src/app/models/user';
|
|
|
|
import { User } from 'src/app/models/user';
|
|
|
|
import { DatasharingService } from 'src/app/services/datasharing.service';
|
|
|
|
import { DatasharingService } from 'src/app/services/datasharing.service';
|
|
|
|
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
|
|
|
|
|
|
|
// DIALOG COMPONENT to create groups
|
|
|
|
// DIALOG COMPONENT to create groups
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
@ -38,13 +39,17 @@ export class DialogCreateGroupComponent {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export class GroupsComponent implements OnInit {
|
|
|
|
export class GroupsComponent implements OnInit {
|
|
|
|
user: User;
|
|
|
|
user: User;
|
|
|
|
constructor(public dialog: MatDialog, private data: DatasharingService) { }
|
|
|
|
constructor(public dialog: MatDialog, private data: DatasharingService, private router: Router) { }
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
ngOnInit() {
|
|
|
|
this.data.currentUserInfo.subscribe(user => {
|
|
|
|
this.data.currentUserInfo.subscribe(user => {
|
|
|
|
this.user = user; });
|
|
|
|
this.user = user; });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public showGroupProfile(group: GroupInfo) {
|
|
|
|
|
|
|
|
this.router.navigate(['group/' + group.id]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
openDialog(): void {
|
|
|
|
openDialog(): void {
|
|
|
|
const dialogRef = this.dialog.open(DialogCreateGroupComponent, {
|
|
|
|
const dialogRef = this.dialog.open(DialogCreateGroupComponent, {
|
|
|
|
width: '250px'
|
|
|
|
width: '250px'
|
|
|
|