fix(项目设置): 模板管理配置字段长度校验问题

--bug=1027703 --user=宋昌昌 【项目设置】github#25497,【项目设置】-模板管理-缺陷模板:创建缺陷模板添加字段选择字段名称“1”点击保存成功,在模板字段可以将字段名称“1”删除掉,没有对已经添加的字段名称做校验。 https://www.tapd.cn/55049933/s/1392328
This commit is contained in:
song-cc-rock 2023-07-12 17:34:32 +08:00 committed by fit2-zhao
parent 7953cb1b54
commit 3a0dfca3e7
11 changed files with 15 additions and 4 deletions

View File

@ -383,6 +383,7 @@ repository_module_already_exists=The repository name already exists at the same
can_not_move_to_repository_node=Can not move to repository node
# issue template copy
target_issue_template_not_checked=Cannot copy, target project not checked
copy_template_name_too_long=Copy error, template name too long
source_issue_template_is_empty=Copy error, source project is empty
select_resource_error_and_check=Select the resource error, check it please
load_test_file_not_have_jmx=Load test not have jmx file

View File

@ -380,6 +380,7 @@ no_tcp_mock_port=无可用的TCP端口号请联系管理员
name_already_exists_in_module=同层级下已经存在
# issue template copy
target_issue_template_not_checked=无法复制,未选中目标项目
copy_template_name_too_long=复制错误,模版名称过长
source_issue_template_is_empty=复制错误,源项目为空
select_resource_error_and_check=查找资源出错,请检查资源是否存在
load_test_file_not_have_jmx=性能测试里的JMX文件不存在

View File

@ -379,6 +379,7 @@ no_tcp_mock_port=無可用的TCP端口號請聯繫管理員
name_already_exists_in_module=同層級下已存在
# issue template copy
target_issue_template_not_checked=無法複製,未選中目標項目
copy_template_name_too_long=複製錯誤,模版名稱過長
source_issue_template_is_empty=複製錯誤,源項目為空
select_resource_error_and_check=查找資源出錯,請檢查資源是否存在
load_test_file_not_have_jmx=性能測試文件中不包含JMX文件

View File

@ -353,6 +353,9 @@ public class IssueTemplateService extends TemplateBaseService {
} else {
recordName = sourceIssueTemplate.getName();
}
if (recordName.length() > 64) {
MSException.throwException(Translator.get("copy_template_name_too_long"));
}
BeanUtils.copyBean(issueTemplateRecord, sourceIssueTemplate);
issueTemplateRecord.setId(UUID.randomUUID().toString());
issueTemplateRecord.setName(recordName);

View File

@ -116,7 +116,9 @@
ref="customFieldEdit">
</custom-field-edit>
<ms-delete-confirm :title="$t('pj_custom_field.delete')" @delete="_handleDelete" ref="deleteConfirm"/>
<ms-delete-confirm :title="$t('pj_custom_field.delete')" @delete="_handleDelete" ref="deleteConfirm" :with-tip="true">
<i style="font-size: 13px">{{ $t('pj_custom_field.delete_tips') }}</i>
</ms-delete-confirm>
</el-card>
</template>

View File

@ -5,7 +5,7 @@
class="custom-with"
prop="customData">
<template v-slot="scope">
<el-input :placeholder="$t('commons.input_content')" v-model="scope.row.customData">
<el-input :placeholder="$t('commons.input_content')" v-model="scope.row.customData" maxlength="255" show-word-limit>
</el-input>
</template>
</ms-table-column>

View File

@ -25,7 +25,7 @@
<slot name="base"></slot>
<el-form-item :label="$t('commons.description')" prop="description" :label-width="labelWidth">
<el-input :autosize="{ minRows: 2, maxRows: 4}" type="textarea" v-model="form.description"></el-input>
<el-input :autosize="{ minRows: 3, maxRows: 4}" type="textarea" v-model="form.description" maxlength="255" show-word-limit></el-input>
</el-form-item>
<ms-form-divider :title="$t('custom_field.template_setting')"/>

View File

@ -12,7 +12,7 @@
<template v-slot:default>
<el-form-item :label="$t('test_track.case.name')" prop="caseName" :label-width="labelWidth">
<el-input v-model="form.caseName" autocomplete="off"></el-input>
<el-input v-model="form.caseName" autocomplete="off" maxlength="64" show-word-limit></el-input>
</el-form-item>
<form-rich-text-item

View File

@ -28,6 +28,7 @@ const message = {
pj_custom_field: {
copy: "Copy",
delete: "Delete",
delete_tips: "Delete it will cause the template with this field to be displayed abnormally. Be Careful!"
},
pj_app_manage: {
timing_clean_ui_report: "Regularly clean up report",

View File

@ -26,6 +26,7 @@ const message = {
pj_custom_field: {
copy: "复制字段",
delete: "删除字段",
delete_tips: "删除字段会导致使用该字段的模板显示异常, 请谨慎操作."
},
pj_app_manage: {
timing_clean_ui_report: "定时清理UI测试报告",

View File

@ -26,6 +26,7 @@ const message = {
pj_custom_field: {
copy: "複製字段",
delete: "刪除字段",
delete_tips: "刪除字段會導致使用該字段的模板显示異常, 請謹慎操作."
},
pj_app_manage: {
timing_clean_ui_report: "定時清理UI測試報告",