From 530b78285bc4dd2e566d36ccaa293a845dbb7bd7 Mon Sep 17 00:00:00 2001 From: Shijun Sun <30999793+AllForNothing@users.noreply.github.com> Date: Thu, 3 Aug 2023 21:52:49 +0800 Subject: [PATCH] Convert the string "0" to number 0 (#19080) 1. Fixes #19046 Signed-off-by: AllForNothing --- .../tag-retention/add-rule/add-rule.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/portal/src/app/base/project/tag-feature-integration/tag-retention/add-rule/add-rule.component.ts b/src/portal/src/app/base/project/tag-feature-integration/tag-retention/add-rule/add-rule.component.ts index e4299c191..c3aaeb319 100644 --- a/src/portal/src/app/base/project/tag-feature-integration/tag-retention/add-rule/add-rule.component.ts +++ b/src/portal/src/app/base/project/tag-feature-integration/tag-retention/add-rule/add-rule.component.ts @@ -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, '');