dialog bug fixed
This commit is contained in:
parent
79f2c4250c
commit
84ee61beea
|
@ -167,7 +167,7 @@
|
|||
mat-flat-button
|
||||
class="bet-mat-small-8"
|
||||
[color]="'primary'"
|
||||
(click)="__onClickRegist($event)"
|
||||
(click)="__onClickRegist($event, partner)"
|
||||
>
|
||||
대본등록
|
||||
</button>
|
||||
|
|
|
@ -14,13 +14,16 @@ import { MatPaginator } from '@angular/material/paginator';
|
|||
import { MatSort } from '@angular/material/sort';
|
||||
import {
|
||||
debounceTime,
|
||||
delay,
|
||||
map,
|
||||
merge,
|
||||
Observable,
|
||||
of,
|
||||
startWith,
|
||||
Subject,
|
||||
switchMap,
|
||||
takeUntil,
|
||||
timer,
|
||||
} from 'rxjs';
|
||||
import { fuseAnimations } from '@fuse/animations';
|
||||
import { FuseConfirmationService } from '@fuse/services/confirmation';
|
||||
|
@ -158,7 +161,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
});
|
||||
|
||||
// Mark for check
|
||||
this._changeDetectorRef.markForCheck();
|
||||
this._changeDetectorRef.detectChanges();
|
||||
|
||||
// If the partner changes the sort order...
|
||||
this._sort.sortChange
|
||||
|
@ -234,9 +237,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
return item.id || index;
|
||||
}
|
||||
|
||||
__onClickRegist(event: MouseEvent): void {
|
||||
__onClickRegist(event: MouseEvent, partner: MemberModel): void {
|
||||
const dialogRef = this._matDialog.open(RegistComposeComponent, {
|
||||
data: { title: '대본', parentId: 'kgon2', sites: this.sites },
|
||||
data: { title: '대본 등록하기', parent: partner, sites: this.sites },
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe((result) => {
|
||||
|
|
|
@ -25,25 +25,26 @@
|
|||
|
||||
<!-- <div *ngFor="let f of sites">{{ f.getUrl() }}</div> -->
|
||||
<!-- Cc -->
|
||||
<mat-form-field>
|
||||
<!-- <mat-form-field>
|
||||
<mat-label>사이트명</mat-label>
|
||||
<input matInput [formControlName]="'siteName'" />
|
||||
<mat-error *ngIf="composeForm.get('siteName')?.hasError('required')">
|
||||
사이트명은 필수 입력입니다.
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
|
||||
<!-- <mat-form-field>
|
||||
<mat-form-field>
|
||||
<mat-label>사이트명</mat-label>
|
||||
|
||||
<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() }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="composeForm.get('siteName')?.hasError('required')">
|
||||
사이트명은 필수 입력입니다.
|
||||
</mat-error>
|
||||
</mat-form-field> -->
|
||||
</mat-form-field>
|
||||
|
||||
<!-- Bcc -->
|
||||
<mat-form-field>
|
||||
|
|
|
@ -10,10 +10,11 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|||
import { SiteService } from 'app/modules/polyglot/domain/services/site.service';
|
||||
import { IdentityService } from 'app/modules/polyglot/member/services/identity.service';
|
||||
import { Site } from 'app/modules/protobuf/models/domain/site_pb';
|
||||
import { MemberModel } from 'app/modules/protobuf/models/member/member_pb';
|
||||
|
||||
export interface RegistComposeData {
|
||||
title: string;
|
||||
parentId: string;
|
||||
parent: MemberModel;
|
||||
sites: Site[];
|
||||
}
|
||||
export interface RegistComposeResult {
|
||||
|
@ -56,10 +57,7 @@ export class RegistComposeComponent implements OnInit {
|
|||
private _identityService: IdentityService,
|
||||
private _changeDetectorRef: ChangeDetectorRef
|
||||
) {
|
||||
this.data.sites.map((v) => {
|
||||
const a = v.toObject();
|
||||
this.sites.push(a);
|
||||
});
|
||||
this.data.sites.forEach((v) => console.log(v.getUrl()));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------
|
||||
|
@ -72,7 +70,7 @@ export class RegistComposeComponent implements OnInit {
|
|||
ngOnInit(): void {
|
||||
// Create the form
|
||||
this.composeForm = this._formBuilder.group({
|
||||
partnerId: [{ value: this.data.parentId, disabled: true }],
|
||||
partnerId: [{ value: this.data.parent.getUsername(), disabled: true }],
|
||||
siteName: ['', [Validators.required]],
|
||||
signinId: ['', [Validators.required]],
|
||||
password: ['', [Validators.required]],
|
||||
|
@ -114,7 +112,9 @@ export class RegistComposeComponent implements OnInit {
|
|||
/**
|
||||
* Send the message
|
||||
*/
|
||||
send(): void {}
|
||||
send(): void {
|
||||
console.log(this.composeForm.value);
|
||||
}
|
||||
|
||||
__checkSigninId(event: FocusEvent): void {
|
||||
const signinId = this.composeForm.get('signinId')?.value;
|
||||
|
@ -127,7 +127,7 @@ export class RegistComposeComponent implements OnInit {
|
|||
.get('signinId')
|
||||
?.setErrors({ signinIdDuplicate: true });
|
||||
}
|
||||
this._changeDetectorRef.markForCheck();
|
||||
// this._changeDetectorRef.markForCheck();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -142,23 +142,7 @@ export class RegistComposeComponent implements OnInit {
|
|||
.get('nickname')
|
||||
?.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;
|
||||
// };
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import { COMPONENTS } from './components';
|
|||
import { COMPOSE } from './compose';
|
||||
|
||||
import { partnerRoutes } from './partner.routing';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
|
||||
@NgModule({
|
||||
declarations: [COMPONENTS, COMPOSE],
|
||||
|
@ -35,6 +36,7 @@ import { partnerRoutes } from './partner.routing';
|
|||
ReactiveFormsModule,
|
||||
FormsModule,
|
||||
|
||||
MatDialogModule,
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
|
|
Loading…
Reference in New Issue
Block a user