Skip to content

Commit

Permalink
feat: 希望质量红线能扩大自定义审核时间最大值 #9620
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 15842
  • Loading branch information
vhwweng committed Aug 20, 2024
1 parent 3fa7528 commit a59e8b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/frontend/devops-quality/src/views/create_rules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@
<bk-form-item :label="$t('quality.审核超时时间')">
<bk-input type="number"
:placeholder="$t('quality.超时以分钟为单位')"
:min="1"
:max="600"
v-model="createRuleForm.auditTimeoutMinutes">
</bk-input>
<span class="time-unit">{{$t('quality.分钟')}}</span>
Expand Down Expand Up @@ -1290,7 +1292,7 @@
let errMsg = ''
const IntReg = /^([0-9]|[1-9][0-9]+)$/ // 自然数
const floatReg = /^\d+(\.\d+)?$/ // 正浮点数
const timeout = /^([1-9]|[1-5]\d|60)$/ // 0-60整数
const timeout = /^(1|[1-9]|[1-9][0-9]|[1-5][0-9]{2}|600)$/ // 0-600整数
const validThreshold = this.createRuleForm.indicators.some(item => {
return (!item.operation || !item.threshold)
|| (item.thresholdType === 'INT' && !IntReg.test(item.threshold))
Expand All @@ -1310,7 +1312,7 @@
} else if (this.createRuleForm.operation === 'AUDIT' && !this.createRuleForm.auditUserList.length) {
errMsg = this.$t('quality.请填写审核人')
} else if (this.createRuleForm.auditTimeoutMinutes && !timeout.test(this.createRuleForm.auditTimeoutMinutes)) {
errMsg = this.$t('quality.请填写60分钟以内的大于0的整数')
errMsg = this.$t('quality.请填写600分钟以内的大于0的整数')
}
return errMsg
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/locale/quality/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"启用": "Enable",
"缺少指标所需的{0}插件": "Missing {0} plugins for indicators",
"创建第一条质量红线规则": "Create the first quality Redine rule",
"请填写60分钟以内的大于0的整数": "Please enter an integer greater than 0 within 60 minutes",
"请填写600分钟以内的大于0的整数": "Please enter an integer greater than 0 within 600 minutes",
"请选择生效的流水线": "Please select an effective pipeline",
"控制点名称": "Control Point Name",
"您可以新增一个通知组": "You can new a notification group",
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/locale/quality/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"启用": "启用",
"缺少指标所需的{0}插件": "缺少指标所需的{0}插件",
"创建第一条质量红线规则": "创建第一条质量红线规则",
"请填写60分钟以内的大于0的整数": "请填写小于60的正整数(单位为分钟)",
"请填写600分钟以内的大于0的整数": "请填写小于600的正整数(单位为分钟)",
"请选择生效的流水线": "请选择生效的流水线",
"控制点名称": "控制点名称",
"您可以新增一个通知组": "您可以新增一个通知组",
Expand Down

0 comments on commit a59e8b3

Please sign in to comment.