Merge pull request #9703 from jwangyangls/fix-replication-name-conflict

Fix a bug that when someone edits a rule with same name ,it displays the name is already in use
This commit is contained in:
jwangyangls 2019-11-04 18:22:06 +08:00 committed by GitHub
commit 473b453616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}