From 92cac6fd35f27962b594a57bc1f70bf86075a15a Mon Sep 17 00:00:00 2001 From: Yogi_Wang Date: Fri, 1 Nov 2019 12:37:19 +0800 Subject: [PATCH] Fix a bug that when someone edits a rule with same name ,it displays the name is already in use Signed-off-by: Yogi_Wang --- .../lib/src/create-edit-rule/create-edit-rule.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/portal/lib/src/create-edit-rule/create-edit-rule.component.ts b/src/portal/lib/src/create-edit-rule/create-edit-rule.component.ts index 0a9279a0b..47a05608b 100644 --- a/src/portal/lib/src/create-edit-rule/create-edit-rule.component.ts +++ b/src/portal/lib/src/create-edit-rule/create-edit-rule.component.ts @@ -123,7 +123,7 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy { this.inNameChecking = true; this.repService.getReplicationRules(0, ruleName) .subscribe(response => { - if (response.some(rule => rule.name === ruleName)) { + if (response.some(rule => (rule.name === ruleName && rule.id !== this.policyId))) { this.ruleNameTooltip = "TOOLTIP.RULE_USER_EXISTING"; this.isRuleNameValid = false; }