Skip to content

Commit

Permalink
Merge pull request #8332 from vhwweng/issue_8319
Browse files Browse the repository at this point in the history
feat:流水线插件名称和简介限制优化 #8319
  • Loading branch information
zhanxu33 authored Feb 7, 2023
2 parents 0ea86c8 + 670ee87 commit 4414c17
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</hgroup>

<bk-popover placement="top" v-if="buttonInfo.disable">
<button class="bk-button bk-primary" type="button" disabled> {{ $t('store.安装') }} </button>
<button class="bk-button bk-primary" type="button" disabled> {{ detail.defaultFlag ? $t('store.已安装') : $t('store.安装')}} </button>
<template slot="content">
<p>{{buttonInfo.des}}</p>
</template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<section v-bkloading="{ isLoading }">
<bk-form :label-width="100" :model="formData" class="manage-detail-edit" ref="atomEdit" v-if="!isLoading">
<bk-form-item :label="$t('store.名称')" :rules="[requireRule($t('store.名称')), nameRule, numMax(20)]" :required="true" property="name" error-display-type="normal">
<bk-input v-model="formData.name" :placeholder="$t('store.请输入中英文名称,不超过20个字符')"></bk-input>
<bk-form-item :label="$t('store.名称')" :rules="[requireRule($t('store.名称')), nameRule, numMax(40)]" :required="true" property="name" error-display-type="normal">
<bk-input v-model="formData.name" :placeholder="$t('store.请输入中英文名称,不超过40个字符')"></bk-input>
</bk-form-item>
<bk-form-item :label="$t('store.分类')" :rules="[requireRule($t('store.分类'))]" :required="true" property="classifyCode" error-display-type="normal">
<bk-select v-model="formData.classifyCode" searchable :clearable="false" @toggle="requestAtomClassify" :loading="isLoadingClassify">
Expand All @@ -29,8 +29,8 @@
</bk-option>
</bk-select>
</bk-form-item>
<bk-form-item :label="$t('store.简介')" :rules="[requireRule($t('store.简介')), numMax(70)]" :required="true" property="summary" :desc="$t('store.展示在插件市场以及流水线选择插件页面。')" error-display-type="normal">
<bk-input v-model="formData.summary" :placeholder="$t('store.插件一句话简介,不超过70个字符')"></bk-input>
<bk-form-item :label="$t('store.简介')" :rules="[requireRule($t('store.简介')), numMax(256)]" :required="true" property="summary" :desc="$t('store.展示在插件市场以及流水线选择插件页面。')" error-display-type="normal">
<bk-input v-model="formData.summary" :placeholder="$t('store.插件一句话简介,不超过256个字符')"></bk-input>
</bk-form-item>
<bk-form-item :label="$t('store.描述')"
property="description"
Expand Down Expand Up @@ -85,8 +85,8 @@
isSaving: false,
toolbars,
nameRule: {
validator: (val) => (/^[\u4e00-\u9fa5a-zA-Z0-9-]+$/.test(val)),
message: this.$t('store.由汉字、英文字母、数字、连字符(-)组成,长度小于20个字符'),
validator: (val) => (/^[\u4e00-\u9fa5a-zA-Z0-9-_. ]+$/.test(val)),
message: this.$t('store.由汉字、英文字母、数字、连字符、下划线或点组成,不超过40个字符'),
trigger: 'blur'
},
publishersList: []
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/devops-atomstore/src/views/edit_atom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<div class="bk-form-item introduction-form-item is-required">
<label class="bk-label"> {{ $t('store.简介') }} </label>
<div class="bk-form-content atom-item-content is-tooltips">
<input type="text" class="bk-form-input atom-introduction-input" :placeholder="$t('store.插件一句话简介,不超过70个字符')"
<input type="text" class="bk-form-input atom-introduction-input" :placeholder="$t('store.插件一句话简介,不超过256个字符')"
name="introduction"
maxlength="70"
v-model="atomForm.summary"
Expand All @@ -102,7 +102,7 @@
<bk-popover placement="left">
<i class="devops-icon icon-info-circle"></i>
<template slot="content">
<p> {{ $t('store.插件一句话简介,不超过70个字符。') }} </p>
<p> {{ $t('store.插件一句话简介,不超过256个字符。') }} </p>
<p> {{ $t('store.展示在插件市场以及流水线选择插件页面。') }} </p>
</template>
</bk-popover>
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/devops-atomstore/src/views/workList/atom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,22 @@
<label class="bk-label"> {{ $t('store.名称') }} </label>
<div class="bk-form-content atom-item-content is-tooltips">
<div style="min-width: 100%">
<input type="text" class="bk-form-input atom-name-input" :placeholder="$t('store.请输入中英文名称,不超过20个字符')"
<input type="text" class="bk-form-input atom-name-input" :placeholder="$t('store.请输入中英文名称,不超过40个字符')"
name="atomName"
v-model="createAtomForm.name"
v-validate="{
required: true,
regex: '^[\u4e00-\u9fa5a-zA-Z0-9-_.]{1,20}$'
regex: '^[\u4e00-\u9fa5a-zA-Z0-9-_. ]{1,40}$'
}"
:class="{ 'is-danger': errors.has('atomName') }">
<p :class="errors.has('atomName') ? 'error-tips' : 'normal-tips'">
{{ errors.first("atomName") && errors.first("atomName").indexOf($t('store.正则')) > 0 ? $t('store.由汉字、英文字母、数字、连字符、下划线或点组成,不超过20个字符') : errors.first("atomName") }}
{{ errors.first("atomName") && errors.first("atomName").indexOf($t('store.正则')) > 0 ? $t('store.由汉字、英文字母、数字、连字符、下划线或点组成,不超过40个字符') : errors.first("atomName") }}
</p>
</div>
<bk-popover placement="right">
<i class="devops-icon icon-info-circle"></i>
<template slot="content">
<p> {{ $t('store.由汉字、英文字母、数字、连字符、下划线或点组成,不超过20个字符') }} </p>
<p> {{ $t('store.由汉字、英文字母、数字、连字符、下划线或点组成,不超过40个字符') }} </p>
</template>
</bk-popover>
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/frontend/locale/store/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"删除时将清理数据,包括工蜂代码库。删除后不可恢复!": "Data will be cleaned up when deleted, including the worker bee code base. Unrecoverable after deletion!",
"请输入插件标识": "Please enter the plugin ID",
"由汉字、英文字母、数字、连字符、下划线或点组成,不超过20个字符": "It is composed of Chinese characters, English letters, numbers, hyphens (-), underscores (_) and periods (.), and the length is less than 20 characters",
"由汉字、英文字母、数字、连字符、下划线或点组成,不超过40个字符": "It is composed of Chinese characters, English letters, numbers, space, hyphens (-), underscores (_) and periods (.), and the length is less than 40 characters",
"由英文字母、数字、连字符(-)或下划线(_)组成,以英文字母开头,不超过30个字符": "It is composed of English letters, numbers, hyphens (-) and underscores (_), start with a letter and the length is less than 30 characters",
"请输入关键字": "Please enter key words",
"协作审批": "Collaborative approval",
Expand All @@ -49,6 +50,7 @@
"代码": "Code",
"取消编辑": "Cancel editing",
"由汉字、英文字母、数字、连字符(-)组成,长度小于20个字符": "Composed of Chinese characters, English letters, numbers, hyphens (-), the length is less than 20 characters",
"由汉字、英文字母、数字、连字符(-)组成,长度小于40个字符": "Composed of Chinese characters, English letters, numbers, hyphens (-), the length is less than 40 characters",
"字段不超过20个字符": "Field does not exceed 20 characters",
"字段不超过30个字符": "Field does not exceed 30 characters",
"复制成功": "Copy successful",
Expand Down Expand Up @@ -197,7 +199,7 @@
"否": "No",
"请输入中英文名称": "Please enter the Chinese and English name",
"请选择功能标签": "Please select function tag",
"插件一句话简介,不超过70个字符": "Use one sentence to briefly describe the plugin, no more than 70 characters",
"插件一句话简介,不超过256个字符": "Use one sentence to briefly describe the plugin, no more than 256 characters",
"请输入": "Please enter here",
"插件编辑": "Edit plugin",
"名称": "Name",
Expand All @@ -206,7 +208,7 @@
"分类不能为空": "Category cannot be empty",
"功能标签": "Tag",
"简介": "Introduction",
"插件一句话简介,不超过70个字符。": "Use one sentence to briefly describe the plugin, no more than 70 characters.",
"插件一句话简介,不超过256个字符。": "Use one sentence to briefly describe the plugin, no more than 256 characters.",
"展示在插件市场以及流水线选择插件页面。": "Displayed in the plugin store page and the pipeline selection plugin page.",
"详细描述": "Description",
"atomRemark": "For detailed description of plugin, please describe plugin functions, use cases, usage restrictions and corresponding solutions [optional], common failure causes and solutions, and the contact info of person in charge",
Expand Down Expand Up @@ -313,6 +315,7 @@
"请选择": "Please select",
"已安装至以下项目:": "Installed to the following project:",
"安装": "Install",
"已安装": "Installed",
"请选择项目:": "Please select project:",
"新建项目": "Add project",
"项目不能为空": "Project cannot be empty",
Expand Down Expand Up @@ -443,6 +446,7 @@
"开发语言": "Language",
"修改人": "Editor",
"请输入中英文名称,不超过20个字符": "Please enter the Chinese and English name, no more than 20 characters",
"请输入中英文名称,不超过40个字符": "Please enter the Chinese and English name, no more than 40 characters",
"请输入英文名称,不超过30个字符": "The unique identifier of the plug-in, consisting of English letters, no more than 30 characters",
"请选择调试项目": "Please select debugging projects",
"新增插件": "Add",
Expand Down
8 changes: 6 additions & 2 deletions src/frontend/locale/store/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"删除时将清理数据,包括工蜂代码库。删除后不可恢复!": "删除时将清理数据,包括工蜂代码库。删除后不可恢复!",
"请输入插件标识": "请输入插件标识",
"由汉字、英文字母、数字、连字符、下划线或点组成,不超过20个字符": "由汉字、英文字母、数字、连字符(-)、下划线(_)或点(.)组成,不超过20个字符",
"由汉字、英文字母、数字、连字符、下划线或点组成,不超过40个字符": "由汉字、英文字母、数字、空格、连字符(-)、下划线(_)或点(.)组成,不超过40个字符",
"由英文字母、数字、连字符(-)或下划线(_)组成,以英文字母开头,不超过30个字符": "由英文字母、数字、连字符(-)或下划线(_)组成,以英文字母开头,不超过30个字符",
"请输入关键字": "请输入关键字",
"协作审批": "协作审批",
Expand All @@ -49,6 +50,7 @@
"代码": "代码",
"取消编辑": "取消编辑",
"由汉字、英文字母、数字、连字符(-)组成,长度小于20个字符": "由汉字、英文字母、数字、连字符(-)组成,长度小于20个字符",
"由汉字、英文字母、数字、连字符(-)组成,长度小于40个字符": "由汉字、英文字母、数字、连字符(-)组成,长度小于40个字符",
"字段不超过20个字符": "字段不超过20个字符",
"字段不超过30个字符": "字段不超过30个字符",
"复制成功": "复制成功",
Expand Down Expand Up @@ -197,7 +199,7 @@
"否": "",
"请输入中英文名称": "请输入中英文名称",
"请选择功能标签": "请选择功能标签",
"插件一句话简介,不超过70个字符": "插件一句话简介,不超过70个字符",
"插件一句话简介,不超过256个字符": "插件一句话简介,不超过256个字符",
"请输入": "请输入",
"插件编辑": "插件编辑",
"名称": "名称",
Expand All @@ -206,7 +208,7 @@
"分类不能为空": "分类不能为空",
"功能标签": "功能标签",
"简介": "简介",
"插件一句话简介,不超过70个字符。": "插件一句话简介,不超过70个字符",
"插件一句话简介,不超过256个字符。": "插件一句话简介,不超过256个字符",
"展示在插件市场以及流水线选择插件页面。": "展示在插件市场以及流水线选择插件页面。",
"详细描述": "详细描述",
"atomRemark": "插件详细介绍,请说明插件功能、使用场景、使用限制和受限解决方案[可选]、常见的失败原因和解决方案、以及接口人联系方式。",
Expand Down Expand Up @@ -313,6 +315,7 @@
"请选择": "请选择",
"已安装至以下项目:": "已安装至以下项目:",
"安装": "安装",
"已安装": "已安装",
"请选择项目:": "请选择项目:",
"新建项目": "新建项目",
"项目不能为空": "项目不能为空",
Expand Down Expand Up @@ -443,6 +446,7 @@
"开发语言": "开发语言",
"修改人": "修改人",
"请输入中英文名称,不超过20个字符": "请输入中英文名称,不超过20个字符",
"请输入中英文名称,不超过40个字符": "请输入中英文名称,不超过40个字符",
"请输入英文名称,不超过30个字符": "请输入英文名称,不超过30个字符",
"请选择调试项目": "请选择调试项目",
"新增插件": "新增插件",
Expand Down

0 comments on commit 4414c17

Please sign in to comment.