From aa2b2f6d6f7c6a366179d1613634e13eaa388313 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Sat, 20 Aug 2022 09:28:52 +0000 Subject: [PATCH] =?UTF-8?q?=ED=98=84=EC=9E=AC=EC=A0=91=EC=86=8D=EC=9E=90?= =?UTF-8?q?=20-=20=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=EB=B2=84=ED=8A=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/list.component.html | 1 + .../current-user/components/list.component.ts | 10 ++ .../member/current-user/compose/index.ts | 3 +- .../compose/signout-compose.component.html | 34 +++++++ .../compose/signout-compose.component.ts | 94 +++++++++++++++++++ 5 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 src/app/modules/admin/member/current-user/compose/signout-compose.component.html create mode 100644 src/app/modules/admin/member/current-user/compose/signout-compose.component.ts diff --git a/src/app/modules/admin/member/current-user/components/list.component.html b/src/app/modules/admin/member/current-user/components/list.component.html index e6001ea..29e007d 100644 --- a/src/app/modules/admin/member/current-user/components/list.component.html +++ b/src/app/modules/admin/member/current-user/components/list.component.html @@ -150,6 +150,7 @@ mat-flat-button class="bet-mat-small-8" [color]="'primary'" + (click)="__onClickSignout($event)" > 로그아웃 diff --git a/src/app/modules/admin/member/current-user/components/list.component.ts b/src/app/modules/admin/member/current-user/components/list.component.ts index f9b60f7..6700e37 100644 --- a/src/app/modules/admin/member/current-user/components/list.component.ts +++ b/src/app/modules/admin/member/current-user/components/list.component.ts @@ -35,6 +35,7 @@ import { CurrentUserService } from '../services/current-user.service'; import { Router } from '@angular/router'; import { MatDialog } from '@angular/material/dialog'; import { MessageComposeComponent } from '../compose/message-compose.component'; +import { SignoutComposeComponent } from '../compose/signout-compose.component'; @Component({ selector: 'current-user-list', @@ -242,6 +243,15 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { data: { price: '', memo: '' }, }); + dialogRef.afterClosed().subscribe((result) => { + console.log('Compose dialog was closed!'); + }); + } + __onClickSignout(event: MouseEvent): void { + const dialogRef = this._matDialog.open(SignoutComposeComponent, { + data: { price: '', memo: '' }, + }); + dialogRef.afterClosed().subscribe((result) => { console.log('Compose dialog was closed!'); }); diff --git a/src/app/modules/admin/member/current-user/compose/index.ts b/src/app/modules/admin/member/current-user/compose/index.ts index 409003d..944df2a 100644 --- a/src/app/modules/admin/member/current-user/compose/index.ts +++ b/src/app/modules/admin/member/current-user/compose/index.ts @@ -1,3 +1,4 @@ import { MessageComposeComponent } from './message-compose.component'; +import { SignoutComposeComponent } from './signout-compose.component'; -export const COMPOSE = [MessageComposeComponent]; +export const COMPOSE = [MessageComposeComponent, SignoutComposeComponent]; diff --git a/src/app/modules/admin/member/current-user/compose/signout-compose.component.html b/src/app/modules/admin/member/current-user/compose/signout-compose.component.html new file mode 100644 index 0000000..0b93ad4 --- /dev/null +++ b/src/app/modules/admin/member/current-user/compose/signout-compose.component.html @@ -0,0 +1,34 @@ +
+ +
+
알림
+ +
+ + +
+
+ 로그아웃되었습니다. +
+
+
+ + +
+
+
+
diff --git a/src/app/modules/admin/member/current-user/compose/signout-compose.component.ts b/src/app/modules/admin/member/current-user/compose/signout-compose.component.ts new file mode 100644 index 0000000..84d5533 --- /dev/null +++ b/src/app/modules/admin/member/current-user/compose/signout-compose.component.ts @@ -0,0 +1,94 @@ +import { + ChangeDetectorRef, + Component, + Inject, + OnInit, + ViewEncapsulation, +} from '@angular/core'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { SiteService } from 'app/modules/polyglot/site/services/site.service'; +import { IdentityService } from 'app/modules/polyglot/identity/services/identity.service'; +import { Site } from 'app/modules/proto/models/site_pb'; + +export interface SignoutComposeData { + price: string; + memo: string; +} +export interface SignoutComposeResult { + price: string; + memo: string; +} + +@Component({ + selector: 'app-signout-compose', + templateUrl: './signout-compose.component.html', + encapsulation: ViewEncapsulation.None, +}) +export class SignoutComposeComponent implements OnInit { + composeForm!: FormGroup; + sites: any[] = []; + // quillModules: any = { + // toolbar: [ + // ['bold', 'italic', 'underline'], + // [{ align: [] }, { list: 'ordered' }, { list: 'bullet' }], + // ['clean'], + // ], + // }; + + /** + * Constructor + */ + constructor( + public matDialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: SignoutComposeData, + private _formBuilder: FormBuilder, + private _identityService: IdentityService, + private _changeDetectorRef: ChangeDetectorRef + ) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Lifecycle hooks + // ----------------------------------------------------------------------------------------------------- + + /** + * On init + */ + ngOnInit(): void { + // Create the form + this.composeForm = this._formBuilder.group({ + price: ['', [Validators.required]], + memo: ['', [Validators.required]], + }); + } + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Save and close + */ + saveAndClose(): void { + // Save the message as a draft + this.saveAsDraft(); + + // Close the dialog + this.matDialogRef.close(); + } + + /** + * Discard the message + */ + discard(): void {} + + /** + * Save the message as a draft + */ + saveAsDraft(): void {} + + /** + * Send the message + */ + send(): void {} +}