From 2d6d4adb352d2c8335027107da081c7ba68803da Mon Sep 17 00:00:00 2001 From: Richard Park Date: Wed, 16 Oct 2019 15:36:18 +0900 Subject: [PATCH] Dialogs are added --- .../left-sidenav/group.component.html | 2 +- .../left-sidenav/group.component.ts | 74 ++++++++++++++++++- .../create-group.dialog.component.html | 2 +- .../delete-group.dialog.component.html | 18 +++++ .../delete-group.dialog.component.scss | 0 .../delete-group.dialog.component.spec.ts | 24 ++++++ .../dialogs/delete-group.dialog.component.ts | 34 +++++++++ .../edit-group-member.dialog.component.html | 18 +++++ .../edit-group-member.dialog.component.scss | 0 ...edit-group-member.dialog.component.spec.ts | 24 ++++++ .../edit-group-member.dialog.component.ts | 34 +++++++++ .../dialogs/edit-group.dialog.component.html | 18 +++++ .../dialogs/edit-group.dialog.component.scss | 0 .../edit-group.dialog.component.spec.ts | 24 ++++++ .../dialogs/edit-group.dialog.component.ts | 31 ++++++++ .../app/layouts/messenger/dialogs/index.ts | 10 ++- 16 files changed, 308 insertions(+), 5 deletions(-) create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.html create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.scss create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.spec.ts create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.ts create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.html create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.scss create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.spec.ts create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.ts create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.html create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.scss create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.spec.ts create mode 100644 projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.ts diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html index 1804ecb4..1f727051 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.html @@ -142,7 +142,7 @@ > 그룹 멤버 변경 - diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts index 3434ba34..7b0478ae 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/group.component.ts @@ -31,6 +31,22 @@ import { import { MatMenuTrigger } from '@angular/material'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { KEY_VER_INFO } from '@app/types/ver-info.type'; +import { + DeleteGroupDialogComponent, + DeleteGroupDialogData, + DeleteGroupDialogResult +} from '@app/layouts/messenger/dialogs/delete-group.dialog.component'; + +import { + EditGroupDialogComponent, + EditGroupDialogData, + EditGroupDialogResult +} from '@app/layouts/messenger/dialogs/edit-group.dialog.component'; +import { + EditGroupMemberDialogComponent, + EditGroupMemberDialogData, + EditGroupMemberDialogResult +} from '@app/layouts/messenger/dialogs/edit-group-member.dialog.component'; @Component({ selector: 'app-layout-chat-left-sidenav-group', @@ -229,7 +245,7 @@ export class GroupComponent implements OnInit, OnDestroy { this.profileContextMenuTrigger.openMenu(); } - onClickGroupContextMenu(menuType: string, group: GroupDetailData) { + async onClickGroupContextMenu(menuType: string, group: GroupDetailData) { this.logger.debug( 'onClickGroupContextMenu', 'menuType', @@ -246,10 +262,64 @@ export class GroupComponent implements OnInit, OnDestroy { case 'SEND_NOTE': break; case 'RENAME': + { + const result = await this.dialogService.open< + EditGroupDialogComponent, + EditGroupDialogData, + EditGroupDialogResult + >(EditGroupDialogComponent, { + width: '220px', + data: { + title: 'Logout', + message: 'Logout ?' + } + }); + } break; case 'EDIT_MEMBER': + { + const result = await this.dialogService.open< + EditGroupMemberDialogComponent, + EditGroupMemberDialogData, + EditGroupMemberDialogResult + >(EditGroupMemberDialogComponent, { + width: '220px', + data: { + title: 'Logout', + message: 'Logout ?' + } + }); + } break; - case 'REMOVE': + case 'DELETE': + { + const result = await this.dialogService.open< + DeleteGroupDialogComponent, + DeleteGroupDialogData, + DeleteGroupDialogResult + >(DeleteGroupDialogComponent, { + width: '220px', + data: { + title: 'Logout', + message: 'Logout ?' + } + }); + } + break; + case 'EDIT_MEMBER': + { + const result = await this.dialogService.open< + EditGroupMemberDialogComponent, + EditGroupMemberDialogData, + EditGroupMemberDialogResult + >(EditGroupMemberDialogComponent, { + width: '220px', + data: { + title: 'Logout', + message: 'Logout ?' + } + }); + } break; default: break; diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.html index 09d25dfe..2229c733 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.html +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/create-group.dialog.component.html @@ -1,5 +1,5 @@ - + 새 그룹 추가 diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.html new file mode 100644 index 00000000..a6ad0056 --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.html @@ -0,0 +1,18 @@ + + + 그룹 삭제 + + + + + + + diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.spec.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.spec.ts new file mode 100644 index 00000000..e279601d --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditGroupDialogComponent } from './edit-group.dialog.component'; + +describe('app::layouts::messenger::EditGroupDialogComponent', () => { + let component: EditGroupDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [EditGroupDialogComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditGroupDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.ts new file mode 100644 index 00000000..db8d4026 --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/delete-group.dialog.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +export interface DeleteGroupDialogData { + title: string; + message?: string; +} + +export interface DeleteGroupDialogResult { + choice: boolean; +} + +@Component({ + selector: 'app-layout-messenger-delete-group', + templateUrl: './delete-group.dialog.component.html', + styleUrls: ['./delete-group.dialog.component.scss'] +}) +export class DeleteGroupDialogComponent implements OnInit { + constructor( + public dialogRef: MatDialogRef< + DeleteGroupDialogData, + DeleteGroupDialogResult + >, + @Inject(MAT_DIALOG_DATA) public data: DeleteGroupDialogData + ) {} + + ngOnInit(): void {} + + onClickChoice(choice: boolean): void { + this.dialogRef.close({ + choice + }); + } +} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.html new file mode 100644 index 00000000..f0f997bf --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.html @@ -0,0 +1,18 @@ + + + 그룹 맴버 수정 + + + + + + + diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.spec.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.spec.ts new file mode 100644 index 00000000..24f3444d --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditGroupMemberDialogComponent } from './edit-group-member.dialog.component'; + +describe('app::layouts::messenger::EditGroupMemberDialogComponent', () => { + let component: EditGroupMemberDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [EditGroupMemberDialogComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditGroupMemberDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.ts new file mode 100644 index 00000000..2656c44f --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group-member.dialog.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +export interface EditGroupMemberDialogData { + title: string; + message?: string; +} + +export interface EditGroupMemberDialogResult { + choice: boolean; +} + +@Component({ + selector: 'app-layout-messenger-edit-group-member', + templateUrl: './edit-group-member.dialog.component.html', + styleUrls: ['./edit-group-member.dialog.component.scss'] +}) +export class EditGroupMemberDialogComponent implements OnInit { + constructor( + public dialogRef: MatDialogRef< + EditGroupMemberDialogData, + EditGroupMemberDialogResult + >, + @Inject(MAT_DIALOG_DATA) public data: EditGroupMemberDialogData + ) {} + + ngOnInit(): void {} + + onClickChoice(choice: boolean): void { + this.dialogRef.close({ + choice + }); + } +} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.html new file mode 100644 index 00000000..7e2dcc5e --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.html @@ -0,0 +1,18 @@ + + + 그룹 이름 수정 + + + + + + + diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.scss b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.spec.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.spec.ts new file mode 100644 index 00000000..e279601d --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EditGroupDialogComponent } from './edit-group.dialog.component'; + +describe('app::layouts::messenger::EditGroupDialogComponent', () => { + let component: EditGroupDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [EditGroupDialogComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EditGroupDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.ts new file mode 100644 index 00000000..cc70a84b --- /dev/null +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/edit-group.dialog.component.ts @@ -0,0 +1,31 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +export interface EditGroupDialogData { + title: string; + message?: string; +} + +export interface EditGroupDialogResult { + choice: boolean; +} + +@Component({ + selector: 'app-layout-messenger-edit-group', + templateUrl: './edit-group.dialog.component.html', + styleUrls: ['./edit-group.dialog.component.scss'] +}) +export class EditGroupDialogComponent implements OnInit { + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: EditGroupDialogData + ) {} + + ngOnInit(): void {} + + onClickChoice(choice: boolean): void { + this.dialogRef.close({ + choice + }); + } +} diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/index.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/index.ts index dc006a67..dc3d41a7 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/index.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/dialogs/index.ts @@ -1,3 +1,11 @@ import { CreateGroupDialogComponent } from './create-group.dialog.component'; +import { DeleteGroupDialogComponent } from './delete-group.dialog.component'; +import { EditGroupDialogComponent } from './edit-group.dialog.component'; +import { EditGroupMemberDialogComponent } from './edit-group-member.dialog.component'; -export const DIALOGS = [CreateGroupDialogComponent]; +export const DIALOGS = [ + CreateGroupDialogComponent, + DeleteGroupDialogComponent, + EditGroupDialogComponent, + EditGroupMemberDialogComponent +];