mirror of
https://github.com/goharbor/harbor
synced 2025-04-26 00:20:26 +00:00
Merge pull request #8864 from AllForNothing/master
remove whitespaces when add tag-retention rule
This commit is contained in:
commit
fb66d58334
@ -138,8 +138,8 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
trimText(event) {
|
||||
if (event.srcElement.value) {
|
||||
event.srcElement.value = event.srcElement.value.trim();
|
||||
if (event.target.value) {
|
||||
event.target.value = event.target.value.trim();
|
||||
}
|
||||
}
|
||||
equals(c1: any, c2: any): boolean {
|
||||
|
@ -179,6 +179,9 @@ export class AddRuleComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
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"
|
||||
&& this.rule.scope_selectors.repository[0].pattern.indexOf("**") !== -1) {
|
||||
this.inlineAlert.showInlineError(INVALID_RULE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user