From fc857a892811761a854e1dcac66a2f9887a7aed1 Mon Sep 17 00:00:00 2001 From: pengpengshui Date: Mon, 17 Jul 2017 15:28:31 -0700 Subject: [PATCH] fix create-project modal submit button issue --- .../project/create-project/create-project.component.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ui_ng/src/app/project/create-project/create-project.component.ts b/src/ui_ng/src/app/project/create-project/create-project.component.ts index 26155780c..a9ed7dc84 100644 --- a/src/ui_ng/src/app/project/create-project/create-project.component.ts +++ b/src/ui_ng/src/app/project/create-project/create-project.component.ts @@ -54,7 +54,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr createProjectOpened: boolean; hasChanged: boolean; - btnIsOk:boolean=false; + isSubmitValid:boolean=false; staticBackdrop: boolean = true; closable: boolean = false; @@ -87,11 +87,11 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr if (this.isNameValid) { //Check exiting from backend this.checkOnGoing = true; + this.isSubmitValid=true; this.projectService .checkProjectExists(cont.value).toPromise() .then(() => { //Project existing - this.btnIsOk=true; this.isNameValid = false; this.nameTooltipText = 'PROJECT.NAME_ALREADY_EXISTS'; this.checkOnGoing = false; @@ -111,7 +111,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr } onSubmit() { - this.btnIsOk=false; + this.isSubmitValid=false; this.projectService .createProject(this.project.name, this.project.public ? 1 : 0) .subscribe( @@ -187,7 +187,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr public get isValid(): boolean { return this.currentForm && this.currentForm.valid && - this.btnIsOk&& + this.isSubmitValid&& this.isNameValid && !this.checkOnGoing; } @@ -198,6 +198,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr if (cont) { this.proNameChecker.next(cont.value); } + } }