[Cherry-pick]Convert the string "0" to number 0 (#19082)

Convert the string "0" to number 0
1. Fixes #19046

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
Shijun Sun 2023-08-03 14:37:18 +08:00 committed by GitHub
parent b2a75dc5f8
commit c1bb162f14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,6 +215,10 @@ export class AddRuleComponent {
}
add() {
// convert string "0" to number 0
if (this.rule.params[this.template] === '0') {
this.rule.params[this.template] = 0;
}
// remove whitespaces
this.rule.scope_selectors.repository[0].pattern =
this.rule.scope_selectors.repository[0].pattern.replace(/\s+/g, '');