Skip to content

Commit

Permalink
fix(项目设置): 模板管理新增权限不足提示
Browse files Browse the repository at this point in the history
--bug=1027187 --user=王旭 【项目设置】项目成员有缺陷模版权限,创建缺陷模版报403 https://www.tapd.cn/55049933/s/1386290
  • Loading branch information
WangXu10 committed Jun 26, 2023
1 parent 22acb31 commit 3befb54
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Expand Up @@ -35,11 +35,12 @@
<slot></slot>

<el-form-item :label="$t('table.selected_fields')" class="filed-list" :label-width="labelWidth">
<el-button type="primary" @click="relateField">{{ $t('custom_field.add_field') }}</el-button>
<el-button plain type="primary" @click="addField">{{
<el-button :disabled="!hasPermissions" type="primary" @click="relateField">{{ $t('custom_field.add_field') }}</el-button>
<el-button :disabled="!hasPermissions" plain type="primary" @click="addField">{{
$t('custom_field.custom_field_setting')
}}
</el-button>
<span v-if="!hasPermissions" style="font-size: 12px; color: red; margin-left: 10px">{{$t("custom_field.no_custom_fields_permission")}}</span>
</el-form-item>

<el-form-item :label-width="labelWidth">
Expand Down Expand Up @@ -82,6 +83,7 @@ import CustomFieldRelateList from "@/business/components/project/template/Custom
import {getCurrentProjectID} from "@/common/js/utils";
import CustomFieldEdit from "@/business/components/project/template/CustomFieldEdit";
import {generateTableHeaderKey, getCustomFieldsKeys} from "@/common/js/tableUtils";
import {hasPermissions} from "@/common/js/utils";
export default {
name: "FieldTemplateEdit",
Expand Down Expand Up @@ -121,6 +123,9 @@ export default {
computed: {
isSystem() {
return this.form.system;
},
hasPermissions() {
return hasPermissions('PROJECT_TEMPLATE:READ+CUSTOM');
}
},
methods: {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/en-US.js
Expand Up @@ -559,6 +559,7 @@ export default {
field_text: 'Field Text',
field_value: 'Field ID',
add_field: 'Add Field',
no_custom_fields_permission: '(Missing custom field permissions, Please contact the administrator for configuration!)',
api_field_name: 'API Field Name',
template_setting: 'Template Setting',
custom_field_setting: 'Custom Field Setting',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/zh-CN.js
Expand Up @@ -561,6 +561,7 @@ export default {
field_text: '选项内容',
field_value: '选项ID',
add_field: '添加字段',
no_custom_fields_permission: '(缺少自定义字段权限,请联系管理员进行配置!)',
api_field_name: 'API字段名',
template_setting: '模板设置',
custom_field_setting: '设置自定义字段',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/zh-TW.js
Expand Up @@ -561,6 +561,7 @@ export default {
field_text: '選項內容',
field_value: '選項ID',
add_field: '添加字段',
no_custom_fields_permission: '(缺少自定義字段權限,請聯係管理員進行配置!)',
api_field_name: 'API字段名',
template_setting: '模板設置',
custom_field_setting: '設置自定義字段',
Expand Down

0 comments on commit 3befb54

Please sign in to comment.