dialog bug fixed

This commit is contained in:
Park Byung Eun 2022-08-12 07:16:28 +00:00
parent 79f2c4250c
commit 84ee61beea
5 changed files with 24 additions and 34 deletions

View File

@ -167,7 +167,7 @@
mat-flat-button mat-flat-button
class="bet-mat-small-8" class="bet-mat-small-8"
[color]="'primary'" [color]="'primary'"
(click)="__onClickRegist($event)" (click)="__onClickRegist($event, partner)"
> >
대본등록 대본등록
</button> </button>

View File

@ -14,13 +14,16 @@ import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort'; import { MatSort } from '@angular/material/sort';
import { import {
debounceTime, debounceTime,
delay,
map, map,
merge, merge,
Observable, Observable,
of, of,
startWith,
Subject, Subject,
switchMap, switchMap,
takeUntil, takeUntil,
timer,
} from 'rxjs'; } from 'rxjs';
import { fuseAnimations } from '@fuse/animations'; import { fuseAnimations } from '@fuse/animations';
import { FuseConfirmationService } from '@fuse/services/confirmation'; import { FuseConfirmationService } from '@fuse/services/confirmation';
@ -158,7 +161,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
}); });
// Mark for check // Mark for check
this._changeDetectorRef.markForCheck(); this._changeDetectorRef.detectChanges();
// If the partner changes the sort order... // If the partner changes the sort order...
this._sort.sortChange this._sort.sortChange
@ -234,9 +237,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
return item.id || index; return item.id || index;
} }
__onClickRegist(event: MouseEvent): void { __onClickRegist(event: MouseEvent, partner: MemberModel): void {
const dialogRef = this._matDialog.open(RegistComposeComponent, { const dialogRef = this._matDialog.open(RegistComposeComponent, {
data: { title: '대본', parentId: 'kgon2', sites: this.sites }, data: { title: '대본 등록하기', parent: partner, sites: this.sites },
}); });
dialogRef.afterClosed().subscribe((result) => { dialogRef.afterClosed().subscribe((result) => {

View File

@ -25,25 +25,26 @@
<!-- <div *ngFor="let f of sites">{{ f.getUrl() }}</div> --> <!-- <div *ngFor="let f of sites">{{ f.getUrl() }}</div> -->
<!-- Cc --> <!-- Cc -->
<mat-form-field> <!-- <mat-form-field>
<mat-label>사이트명</mat-label> <mat-label>사이트명</mat-label>
<input matInput [formControlName]="'siteName'" /> <input matInput [formControlName]="'siteName'" />
<mat-error *ngIf="composeForm.get('siteName')?.hasError('required')"> <mat-error *ngIf="composeForm.get('siteName')?.hasError('required')">
사이트명은 필수 입력입니다. 사이트명은 필수 입력입니다.
</mat-error> </mat-error>
</mat-form-field> </mat-form-field> -->
<!-- <mat-form-field> <mat-form-field>
<mat-label>사이트명</mat-label> <mat-label>사이트명</mat-label>
<mat-select [formControlName]="'siteName'" placeholder="사이트 선택"> <mat-select [formControlName]="'siteName'" placeholder="사이트 선택">
<mat-option *ngFor="let site of sites" [value]="site.getId()"> <mat-option *ngFor="let site of data.sites" [value]="site.getId()">
{{ site.getUrl() }} {{ site.getUrl() }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="composeForm.get('siteName')?.hasError('required')"> <mat-error *ngIf="composeForm.get('siteName')?.hasError('required')">
사이트명은 필수 입력입니다. 사이트명은 필수 입력입니다.
</mat-error> </mat-error>
</mat-form-field> --> </mat-form-field>
<!-- Bcc --> <!-- Bcc -->
<mat-form-field> <mat-form-field>

View File

@ -10,10 +10,11 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { SiteService } from 'app/modules/polyglot/domain/services/site.service'; import { SiteService } from 'app/modules/polyglot/domain/services/site.service';
import { IdentityService } from 'app/modules/polyglot/member/services/identity.service'; import { IdentityService } from 'app/modules/polyglot/member/services/identity.service';
import { Site } from 'app/modules/protobuf/models/domain/site_pb'; import { Site } from 'app/modules/protobuf/models/domain/site_pb';
import { MemberModel } from 'app/modules/protobuf/models/member/member_pb';
export interface RegistComposeData { export interface RegistComposeData {
title: string; title: string;
parentId: string; parent: MemberModel;
sites: Site[]; sites: Site[];
} }
export interface RegistComposeResult { export interface RegistComposeResult {
@ -56,10 +57,7 @@ export class RegistComposeComponent implements OnInit {
private _identityService: IdentityService, private _identityService: IdentityService,
private _changeDetectorRef: ChangeDetectorRef private _changeDetectorRef: ChangeDetectorRef
) { ) {
this.data.sites.map((v) => { this.data.sites.forEach((v) => console.log(v.getUrl()));
const a = v.toObject();
this.sites.push(a);
});
} }
// ----------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------
@ -72,7 +70,7 @@ export class RegistComposeComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
// Create the form // Create the form
this.composeForm = this._formBuilder.group({ this.composeForm = this._formBuilder.group({
partnerId: [{ value: this.data.parentId, disabled: true }], partnerId: [{ value: this.data.parent.getUsername(), disabled: true }],
siteName: ['', [Validators.required]], siteName: ['', [Validators.required]],
signinId: ['', [Validators.required]], signinId: ['', [Validators.required]],
password: ['', [Validators.required]], password: ['', [Validators.required]],
@ -114,7 +112,9 @@ export class RegistComposeComponent implements OnInit {
/** /**
* Send the message * Send the message
*/ */
send(): void {} send(): void {
console.log(this.composeForm.value);
}
__checkSigninId(event: FocusEvent): void { __checkSigninId(event: FocusEvent): void {
const signinId = this.composeForm.get('signinId')?.value; const signinId = this.composeForm.get('signinId')?.value;
@ -127,7 +127,7 @@ export class RegistComposeComponent implements OnInit {
.get('signinId') .get('signinId')
?.setErrors({ signinIdDuplicate: true }); ?.setErrors({ signinIdDuplicate: true });
} }
this._changeDetectorRef.markForCheck(); // this._changeDetectorRef.markForCheck();
}); });
} }
@ -142,23 +142,7 @@ export class RegistComposeComponent implements OnInit {
.get('nickname') .get('nickname')
?.setErrors({ nicknameDuplicate: true }); ?.setErrors({ nicknameDuplicate: true });
} }
this._changeDetectorRef.markForCheck(); // this._changeDetectorRef.markForCheck();
}); });
} }
// checkSameName(): ValidatorFn {
// return (control: AbstractControl): { [key: string]: any } | null => {
// if (
// !control ||
// !control.value ||
// !this.groupList ||
// 0 === this.groupList.length
// ) {
// return null;
// }
// const v = (control.value as string).trim();
// const ban = -1 < this.groupList.findIndex((g) => g.name === v);
// return ban ? { groupNameSamed: { value: control.value } } : null;
// };
// }
} }

View File

@ -24,6 +24,7 @@ import { COMPONENTS } from './components';
import { COMPOSE } from './compose'; import { COMPOSE } from './compose';
import { partnerRoutes } from './partner.routing'; import { partnerRoutes } from './partner.routing';
import { MatDialogModule } from '@angular/material/dialog';
@NgModule({ @NgModule({
declarations: [COMPONENTS, COMPOSE], declarations: [COMPONENTS, COMPOSE],
@ -35,6 +36,7 @@ import { partnerRoutes } from './partner.routing';
ReactiveFormsModule, ReactiveFormsModule,
FormsModule, FormsModule,
MatDialogModule,
MatButtonModule, MatButtonModule,
MatFormFieldModule, MatFormFieldModule,
MatIconModule, MatIconModule,