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