Clear inlineAlert when reopen create project;change add robot error handle

clear inlineAlert when reopen create project;change add robot error handle

Signed-off-by: Yogi_Wang <yawang@vmware.com>
This commit is contained in:
Yogi_Wang 2019-05-15 11:59:31 +08:00
parent 47f24cab4b
commit dfbc7b4f8c
3 changed files with 4 additions and 1 deletions

View File

@ -135,6 +135,7 @@ export class CreateProjectComponent implements OnInit, OnDestroy {
this.isNameValid = true; this.isNameValid = true;
this.createProjectOpened = true; this.createProjectOpened = true;
this.inlineAlert.close();
} }
public get isValid(): boolean { public get isValid(): boolean {

View File

@ -1,6 +1,7 @@
<clr-modal [(clrModalOpen)]="addRobotOpened" <clr-modal [(clrModalOpen)]="addRobotOpened"
[clrModalStaticBackdrop]="staticBackdrop" [clrModalClosable]="closable"> [clrModalStaticBackdrop]="staticBackdrop" [clrModalClosable]="closable">
<h3 class="modal-title">{{'ROBOT_ACCOUNT.CREAT_ROBOT_ACCOUNT' | translate}}</h3> <h3 class="modal-title">{{'ROBOT_ACCOUNT.CREAT_ROBOT_ACCOUNT' | translate}}</h3>
<inline-alert #copyAlert class="modal-title"></inline-alert>
<div class="modal-body"> <div class="modal-body">
<form #robotForm="ngForm"> <form #robotForm="ngForm">
<section class="form-block"> <section class="form-block">

View File

@ -103,6 +103,7 @@ export class AddRobotComponent implements OnInit, OnDestroy {
this.isRobotNameValid = true; this.isRobotNameValid = true;
this.robot = new Robot(); this.robot = new Robot();
this.nameTooltipText = "ROBOT_ACCOUNT.ROBOT_NAME"; this.nameTooltipText = "ROBOT_ACCOUNT.ROBOT_NAME";
this.copyAlert.close();
} }
onCancel(): void { onCancel(): void {
@ -143,7 +144,7 @@ export class AddRobotComponent implements OnInit, OnDestroy {
}, },
error => { error => {
this.isSubmitOnGoing = false; this.isSubmitOnGoing = false;
this.errorHandler.error(error); this.copyAlert.showInlineError(error);
} }
); );
} }