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 29e007d..86be927 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,7 +150,7 @@ mat-flat-button class="bet-mat-small-8" [color]="'primary'" - (click)="__onClickSignout($event)" + (click)="__onClickSignoutBlock($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 6700e37..05398e0 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,7 +35,6 @@ 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', @@ -95,6 +94,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { 'etcBtn', ]; + signoutBlockConfigForm!: FormGroup; + private _unsubscribeAll: Subject = new Subject(); /** @@ -147,6 +148,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { }); this.currentUsers$ = this._currentUserService.currentUsers$; + + // Set signout block config + this.__signoutBlockConfirmConfig(); } /** @@ -247,13 +251,33 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { 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!'); + __signoutBlockConfirmConfig(): void { + this.signoutBlockConfigForm = this._formBuilder.group({ + title: '알림', + message: '로그아웃되었습니다.', + icon: this._formBuilder.group({ + show: true, + name: 'heroicons_outline:exclamation', + color: 'warn', + }), + actions: this._formBuilder.group({ + confirm: this._formBuilder.group({ + show: true, + label: '확인', + color: 'warn', + }), + cancel: this._formBuilder.group({ + show: false, + label: '취소', + }), + }), + dismissible: true, }); } + __onClickSignoutBlock(event: MouseEvent): void { + // Open the dialog and save the reference of it + const dialogRef = this._fuseConfirmationService.open( + this.signoutBlockConfigForm.value + ); + } } 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 944df2a..409003d 100644 --- a/src/app/modules/admin/member/current-user/compose/index.ts +++ b/src/app/modules/admin/member/current-user/compose/index.ts @@ -1,4 +1,3 @@ import { MessageComposeComponent } from './message-compose.component'; -import { SignoutComposeComponent } from './signout-compose.component'; -export const COMPOSE = [MessageComposeComponent, SignoutComposeComponent]; +export const COMPOSE = [MessageComposeComponent]; 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 deleted file mode 100644 index 0b93ad4..0000000 --- a/src/app/modules/admin/member/current-user/compose/signout-compose.component.html +++ /dev/null @@ -1,34 +0,0 @@ -
- -
-
알림
- -
- - -
-
- 로그아웃되었습니다. -
-
-
- - -
-
-
-
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 deleted file mode 100644 index 84d5533..0000000 --- a/src/app/modules/admin/member/current-user/compose/signout-compose.component.ts +++ /dev/null @@ -1,94 +0,0 @@ -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 {} -} diff --git a/src/app/modules/admin/member/partner/components/list.component.html b/src/app/modules/admin/member/partner/components/list.component.html index f2298aa..de8c040 100644 --- a/src/app/modules/admin/member/partner/components/list.component.html +++ b/src/app/modules/admin/member/partner/components/list.component.html @@ -119,7 +119,7 @@ diff --git a/src/app/modules/admin/member/partner/components/list.component.ts b/src/app/modules/admin/member/partner/components/list.component.ts index 350e642..b2d0ce5 100644 --- a/src/app/modules/admin/member/partner/components/list.component.ts +++ b/src/app/modules/admin/member/partner/components/list.component.ts @@ -8,7 +8,7 @@ import { ViewChild, ViewEncapsulation, } from '@angular/core'; -import { FormBuilder, FormControl } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; @@ -42,7 +42,6 @@ import { CommissionComposeComponent } from '../compose/commission-compose.compon import { CompComposeComponent } from '../compose/comp-compose.component'; import { CouponComposeComponent } from '../compose/coupon-compose.component'; import { MessageComposeComponent } from '../compose/message-compose.component'; -import { SignoutComposeComponent } from '../compose/signout-compose.component'; import { MatDialog } from '@angular/material/dialog'; import { SiteService } from 'app/modules/polyglot/site/services/site.service'; @@ -108,6 +107,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { btnTitle: string = ''; memberClassId = ''; + signoutBlockConfigForm!: FormGroup; + private _unsubscribeAll: Subject = new Subject(); /** @@ -201,6 +202,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { .catch((e) => { console.log('error', e); }); + + // Set signout block config + this.__signoutBlockConfirmConfig(); } /** @@ -361,15 +365,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { 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!'); - }); - } __getRateTooltop(): string { const tempRate = 0; @@ -384,4 +379,33 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { return '정상'; } + __signoutBlockConfirmConfig(): void { + this.signoutBlockConfigForm = this._formBuilder.group({ + title: '알림', + message: '로그아웃되었습니다.', + icon: this._formBuilder.group({ + show: true, + name: 'heroicons_outline:exclamation', + color: 'warn', + }), + actions: this._formBuilder.group({ + confirm: this._formBuilder.group({ + show: true, + label: '확인', + color: 'warn', + }), + cancel: this._formBuilder.group({ + show: false, + label: '취소', + }), + }), + dismissible: true, + }); + } + __onClickSignoutBlock(event: MouseEvent): void { + // Open the dialog and save the reference of it + const dialogRef = this._fuseConfirmationService.open( + this.signoutBlockConfigForm.value + ); + } } diff --git a/src/app/modules/admin/member/partner/compose/index.ts b/src/app/modules/admin/member/partner/compose/index.ts index 393c761..141703e 100644 --- a/src/app/modules/admin/member/partner/compose/index.ts +++ b/src/app/modules/admin/member/partner/compose/index.ts @@ -4,7 +4,6 @@ import { CommissionComposeComponent } from './commission-compose.component'; import { CompComposeComponent } from './comp-compose.component'; import { CouponComposeComponent } from './coupon-compose.component'; import { MessageComposeComponent } from './message-compose.component'; -import { SignoutComposeComponent } from './signout-compose.component'; export const COMPOSE = [ RegistComposeComponent, @@ -13,5 +12,4 @@ export const COMPOSE = [ CompComposeComponent, CouponComposeComponent, MessageComposeComponent, - SignoutComposeComponent, ]; diff --git a/src/app/modules/admin/member/partner/compose/signout-compose.component.html b/src/app/modules/admin/member/partner/compose/signout-compose.component.html deleted file mode 100644 index 0b93ad4..0000000 --- a/src/app/modules/admin/member/partner/compose/signout-compose.component.html +++ /dev/null @@ -1,34 +0,0 @@ -
- -
-
알림
- -
- - -
-
- 로그아웃되었습니다. -
-
-
- - -
-
-
-
diff --git a/src/app/modules/admin/member/partner/compose/signout-compose.component.ts b/src/app/modules/admin/member/partner/compose/signout-compose.component.ts deleted file mode 100644 index 84d5533..0000000 --- a/src/app/modules/admin/member/partner/compose/signout-compose.component.ts +++ /dev/null @@ -1,94 +0,0 @@ -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 {} -} diff --git a/src/app/modules/admin/member/user/components/list.component.html b/src/app/modules/admin/member/user/components/list.component.html index a1e319b..10590cd 100644 --- a/src/app/modules/admin/member/user/components/list.component.html +++ b/src/app/modules/admin/member/user/components/list.component.html @@ -239,7 +239,10 @@ - diff --git a/src/app/modules/admin/member/user/components/list.component.ts b/src/app/modules/admin/member/user/components/list.component.ts index 6f88ecb..e1af5df 100644 --- a/src/app/modules/admin/member/user/components/list.component.ts +++ b/src/app/modules/admin/member/user/components/list.component.ts @@ -8,7 +8,7 @@ import { ViewChild, ViewEncapsulation, } from '@angular/core'; -import { FormBuilder, FormControl } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { map, merge, Observable, Subject, switchMap, takeUntil } from 'rxjs'; @@ -26,7 +26,6 @@ import { CommissionComposeComponent } from '../compose/commission-compose.compon import { CompComposeComponent } from '../compose/comp-compose.component'; import { CouponComposeComponent } from '../compose/coupon-compose.component'; import { MessageComposeComponent } from '../compose/message-compose.component'; -import { SignoutComposeComponent } from '../compose/signout-compose.component'; @Component({ selector: 'user-list', @@ -75,6 +74,8 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { selectedUser?: User; pagination?: UserPagination; + signoutBlockConfigForm!: FormGroup; + private _unsubscribeAll: Subject = new Subject(); /** @@ -111,6 +112,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { // Get the products this.users$ = this._userService.users$; + + // Set signout block config + this.__signoutBlockConfirmConfig(); } /** @@ -257,15 +261,6 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { 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!'); - }); - } __getRateTooltop(): string { const tempRate = 0; const resultTooltip = ` @@ -273,4 +268,33 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { `; return resultTooltip; } + __signoutBlockConfirmConfig(): void { + this.signoutBlockConfigForm = this._formBuilder.group({ + title: '알림', + message: '로그아웃되었습니다.', + icon: this._formBuilder.group({ + show: true, + name: 'heroicons_outline:exclamation', + color: 'warn', + }), + actions: this._formBuilder.group({ + confirm: this._formBuilder.group({ + show: true, + label: '확인', + color: 'warn', + }), + cancel: this._formBuilder.group({ + show: false, + label: '취소', + }), + }), + dismissible: true, + }); + } + __onClickSignoutBlock(event: MouseEvent): void { + // Open the dialog and save the reference of it + const dialogRef = this._fuseConfirmationService.open( + this.signoutBlockConfigForm.value + ); + } } diff --git a/src/app/modules/admin/member/user/compose/index.ts b/src/app/modules/admin/member/user/compose/index.ts index c742e24..a8e3fd2 100644 --- a/src/app/modules/admin/member/user/compose/index.ts +++ b/src/app/modules/admin/member/user/compose/index.ts @@ -3,7 +3,6 @@ import { CommissionComposeComponent } from './commission-compose.component'; import { CompComposeComponent } from './comp-compose.component'; import { CouponComposeComponent } from './coupon-compose.component'; import { MessageComposeComponent } from './message-compose.component'; -import { SignoutComposeComponent } from './signout-compose.component'; export const COMPOSE = [ CashComposeComponent, @@ -11,5 +10,4 @@ export const COMPOSE = [ CompComposeComponent, CouponComposeComponent, MessageComposeComponent, - SignoutComposeComponent, ]; diff --git a/src/app/modules/admin/member/user/compose/signout-compose.component.html b/src/app/modules/admin/member/user/compose/signout-compose.component.html deleted file mode 100644 index 0b93ad4..0000000 --- a/src/app/modules/admin/member/user/compose/signout-compose.component.html +++ /dev/null @@ -1,34 +0,0 @@ -
- -
-
알림
- -
- - -
-
- 로그아웃되었습니다. -
-
-
- - -
-
-
-
diff --git a/src/app/modules/admin/member/user/compose/signout-compose.component.ts b/src/app/modules/admin/member/user/compose/signout-compose.component.ts deleted file mode 100644 index 84d5533..0000000 --- a/src/app/modules/admin/member/user/compose/signout-compose.component.ts +++ /dev/null @@ -1,94 +0,0 @@ -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 {} -}