From de8e3ddd1ee7f41b347568c83a64d07c2b14c035 Mon Sep 17 00:00:00 2001 From: Park Byung Eun Date: Fri, 30 Sep 2022 06:22:13 +0000 Subject: [PATCH] =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/beteran/component/home.component.ts | 5 +++-- .../compose/modify-member-compose.component.ts | 15 ++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/app/modules/beteran/component/home.component.ts b/src/app/modules/beteran/component/home.component.ts index 9f70e2d..0f3b887 100644 --- a/src/app/modules/beteran/component/home.component.ts +++ b/src/app/modules/beteran/component/home.component.ts @@ -164,7 +164,7 @@ export class HomeComponent implements OnInit { */ __onClickCompose(composeMenuType: ComposeMenuType): void { let selectType: any; - + let data = {}; if ( !this.loggedIn && composeMenuType !== ComposeMenuType.signIn && @@ -188,6 +188,7 @@ export class HomeComponent implements OnInit { break; case ComposeMenuType.modifyMember: selectType = ModifyMemberComposeComponent; + data = { member: this.member }; break; case ComposeMenuType.deposit: selectType = DepositComposeComponent; @@ -212,7 +213,7 @@ export class HomeComponent implements OnInit { break; } - const dialogRef = this._matDialog.open(selectType); + const dialogRef = this._matDialog.open(selectType, { data }); dialogRef.afterClosed().subscribe((result) => { if (ComposeMenuType.signIn === composeMenuType && !!result.choice) { diff --git a/src/app/modules/beteran/compose/compose/modify-member-compose.component.ts b/src/app/modules/beteran/compose/compose/modify-member-compose.component.ts index 77a7237..5575a37 100644 --- a/src/app/modules/beteran/compose/compose/modify-member-compose.component.ts +++ b/src/app/modules/beteran/compose/compose/modify-member-compose.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core'; import { AbstractControl, FormBuilder, @@ -6,7 +6,7 @@ import { ValidatorFn, Validators, } from '@angular/forms'; -import { MatDialogRef } from '@angular/material/dialog'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { fuseAnimations } from '@fuse/animations'; import { FuseAlertType } from '@fuse/components/alert'; import { BankService } from 'app/modules/polyglot/bank/services/bank.service'; @@ -19,7 +19,11 @@ import { UpdateMemberForPasswordRequest, UpdateMemberForPasswordResponse, } from 'app/modules/proto/c2se/member_pb'; - +import { MemberModel } from 'app/modules/proto/models/member_pb'; +export interface ModifyMemberComposeData { + member: MemberModel; +} +export interface ModifyMemberComposeResult {} @Component({ selector: 'modify-member-compose', templateUrl: './modify-member-compose.component.html', @@ -44,6 +48,7 @@ export class ModifyMemberComposeComponent implements OnInit { */ constructor( public matDialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: ModifyMemberComposeData, private _formBuilder: FormBuilder, private _identityService: IdentityService, private _memberService: MemberService, @@ -60,8 +65,8 @@ export class ModifyMemberComposeComponent implements OnInit { ngOnInit(): void { // Create the form this.modifyMemberComposeForm = this._formBuilder.group({ - username: [{ value: '', disabled: true }], - nickname: [{ value: '', disabled: true }], + username: [{ value: this.data.member.getUsername(), disabled: true }], + nickname: [{ value: this.data.member.getNickname(), disabled: true }], currentPassword: ['1234', [Validators.required]], password: [ '1234',