diff --git a/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.html.ts b/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.html.ts index 8cc94307d..43eb0daa9 100644 --- a/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.html.ts +++ b/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.html.ts @@ -81,8 +81,8 @@ export const CREATE_EDIT_RULE_TEMPLATE: string = ` `; diff --git a/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.ts b/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.ts index 0fe03bd23..515bcadb1 100644 --- a/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.ts +++ b/src/ui_ng/lib/src/create-edit-rule/create-edit-rule.component.ts @@ -75,6 +75,9 @@ export class CreateEditRuleComponent implements AfterViewChecked { testOngoing: boolean; pingStatus: boolean; + btnAbled:boolean; + + ruleForm: NgForm; staticBackdrop: boolean = true; @@ -135,9 +138,14 @@ export class CreateEditRuleComponent implements AfterViewChecked { return this.actionType === ActionType.EDIT && (this.initVal.enable || false); } + get showNewDestination(): boolean { return this.actionType === ActionType.ADD_NEW || (!this.createEditRule.enable || false); } + get connectAbled():boolean{ + return !this.createEditRule.endpointId && !this.isCreateEndpoint; + + } constructor( private replicationService: ReplicationService, @@ -393,6 +401,7 @@ export class CreateEditRuleComponent implements AfterViewChecked { testConnection() { this.pingStatus = true; + this.btnAbled=true; this.translateService.get('REPLICATION.TESTING_CONNECTION').subscribe(res=>this.pingTestMessage=res); this.testOngoing = !this.testOngoing; let pingTarget: Endpoint = this.initEndpoint; @@ -409,11 +418,13 @@ export class CreateEditRuleComponent implements AfterViewChecked { this.testOngoing = !this.testOngoing; this.translateService.get('REPLICATION.TEST_CONNECTION_SUCCESS').subscribe(res=>this.pingTestMessage=res); this.pingStatus = true; + this.btnAbled=false; }) .catch(error=>{ this.testOngoing = !this.testOngoing; this.translateService.get('REPLICATION.TEST_CONNECTION_FAILURE').subscribe(res=>this.pingTestMessage=res); this.pingStatus = false; + this.btnAbled=false; }); } } \ No newline at end of file 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 89635a905..26155780c 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,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( @@ -182,8 +185,9 @@ export class CreateProjectComponent implements AfterViewChecked, OnInit, OnDestr } public get isValid(): boolean { - return this.currentForm && - this.currentForm.valid && + return this.currentForm && + this.currentForm.valid && + this.btnIsOk&& this.isNameValid && !this.checkOnGoing; } diff --git a/src/ui_ng/src/app/project/project.component.ts b/src/ui_ng/src/app/project/project.component.ts index 97ef3cc0e..921ba8179 100644 --- a/src/ui_ng/src/app/project/project.component.ts +++ b/src/ui_ng/src/app/project/project.component.ts @@ -124,7 +124,6 @@ export class ProjectComponent implements OnInit, OnDestroy { getProjects(name?: string, isPublic?: number, page?: number, pageSize?: number): void { this.loading = true; - this.projectService .listProjects(name, isPublic, page, pageSize) .subscribe( @@ -184,7 +183,11 @@ export class ProjectComponent implements OnInit, OnDestroy { response => { this.messageHandlerService.showSuccess('PROJECT.TOGGLED_SUCCESS'); this.statisticHandler.refresh(); - this.getProjects("", this.currentFilteredType - 1); + if (this.currentFilteredType === 0) { + this.getProjects(); + } else { + this.getProjects("", this.currentFilteredType - 1); + } }, error => this.messageHandlerService.handleError(error) );