From 8ec00c479e46196eff140f01a572f0d7ce38490c Mon Sep 17 00:00:00 2001 From: pengpengshui Date: Fri, 14 Jul 2017 09:28:20 -0700 Subject: [PATCH] fix2552 connect button grayed out --- .../create-edit-rule.component.html.ts | 4 ++-- .../create-edit-rule/create-edit-rule.component.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) 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