fix2564 issue

This commit is contained in:
pengpengshui 2017-07-13 09:37:15 -07:00
parent 186538010d
commit 66bfc02d5b

View File

@ -54,6 +54,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr
createProjectOpened: boolean; createProjectOpened: boolean;
hasChanged: boolean; hasChanged: boolean;
btnIsOk:boolean=false;
staticBackdrop: boolean = true; staticBackdrop: boolean = true;
closable: boolean = false; closable: boolean = false;
@ -90,6 +91,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr
.checkProjectExists(cont.value).toPromise() .checkProjectExists(cont.value).toPromise()
.then(() => { .then(() => {
//Project existing //Project existing
this.btnIsOk=true;
this.isNameValid = false; this.isNameValid = false;
this.nameTooltipText = 'PROJECT.NAME_ALREADY_EXISTS'; this.nameTooltipText = 'PROJECT.NAME_ALREADY_EXISTS';
this.checkOnGoing = false; this.checkOnGoing = false;
@ -109,6 +111,7 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr
} }
onSubmit() { onSubmit() {
this.btnIsOk=false;
this.projectService this.projectService
.createProject(this.project.name, this.project.public ? 1 : 0) .createProject(this.project.name, this.project.public ? 1 : 0)
.subscribe( .subscribe(
@ -181,9 +184,10 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr
this.projectForm.reset(); this.projectForm.reset();
} }
public get isValid(): boolean { public get isValid(): boolean {git
return this.currentForm && return this.currentForm &&
this.currentForm.valid && this.currentForm.valid &&
this.btnIsOk&&
this.isNameValid && this.isNameValid &&
!this.checkOnGoing; !this.checkOnGoing;
} }