mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-27 01:51:25 +01:00
remove whitespaces when add tag-retention rule
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
2c1c816941
commit
16163f08c6
@ -138,8 +138,8 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
trimText(event) {
|
trimText(event) {
|
||||||
if (event.srcElement.value) {
|
if (event.target.value) {
|
||||||
event.srcElement.value = event.srcElement.value.trim();
|
event.target.value = event.target.value.trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
equals(c1: any, c2: any): boolean {
|
equals(c1: any, c2: any): boolean {
|
||||||
|
@ -179,6 +179,9 @@ export class AddRuleComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add() {
|
add() {
|
||||||
|
// remove whitespaces
|
||||||
|
this.rule.scope_selectors.repository[0].pattern = this.rule.scope_selectors.repository[0].pattern.replace(/\s+/g, "");
|
||||||
|
this.rule.tag_selectors[0].pattern = this.rule.tag_selectors[0].pattern.replace(/\s+/g, "");
|
||||||
if (this.rule.scope_selectors.repository[0].decoration !== "repoMatches"
|
if (this.rule.scope_selectors.repository[0].decoration !== "repoMatches"
|
||||||
&& this.rule.scope_selectors.repository[0].pattern.indexOf("**") !== -1) {
|
&& this.rule.scope_selectors.repository[0].pattern.indexOf("**") !== -1) {
|
||||||
this.inlineAlert.showInlineError(INVALID_RULE);
|
this.inlineAlert.showInlineError(INVALID_RULE);
|
||||||
|
Loading…
Reference in New Issue
Block a user