fix(测试跟踪): 自定义字段数值型,无法设置空的默认值
--bug=1027324 --user=陈建星 [测试跟踪]github #25007 对接禅道配置解决方案和重复ID字段后,MS能正常同步解决方案和重复ID,但是MS无法正常提交bug了 https://www.tapd.cn/55049933/s/1386688
This commit is contained in:
parent
e901a35105
commit
2969f6f15f
|
@ -105,6 +105,10 @@ export function parseCustomField(data, template, rules, oldFields) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.type === 'int' && item.defaultValue === null) {
|
||||||
|
// el-input-number 需要设置成 undefined,默认值才能设置为空
|
||||||
|
item.defaultValue = undefined;
|
||||||
|
}
|
||||||
customFieldForm[item.name] = item.defaultValue;
|
customFieldForm[item.name] = item.defaultValue;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -210,6 +214,10 @@ export function parseCustomFieldForId(data, template, rules, oldFields) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.type === 'int' && item.defaultValue === null) {
|
||||||
|
// el-input-number 需要设置成 undefined,默认值才能设置为空
|
||||||
|
item.defaultValue = undefined;
|
||||||
|
}
|
||||||
customFieldForm[item.id] = item.defaultValue;
|
customFieldForm[item.id] = item.defaultValue;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -535,7 +535,12 @@ export function getCustomFieldValue(row, field, members) {
|
||||||
for (let i = 0; i < row.fields.length; i++) {
|
for (let i = 0; i < row.fields.length; i++) {
|
||||||
let item = row.fields[i];
|
let item = row.fields[i];
|
||||||
if (item.id === field.id) {
|
if (item.id === field.id) {
|
||||||
if (!item.value) return '';
|
if (item.value === 0) {
|
||||||
|
return '0';
|
||||||
|
}
|
||||||
|
if (!item.value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
if (item.textValue && item.textValue.startsWith(OPTION_LABEL_PREFIX) && field.options) {
|
if (item.textValue && item.textValue.startsWith(OPTION_LABEL_PREFIX) && field.options) {
|
||||||
// 处理 jira 远程搜索字段
|
// 处理 jira 远程搜索字段
|
||||||
|
|
|
@ -208,6 +208,10 @@ export default {
|
||||||
} else if (item.type === 'checkbox') {
|
} else if (item.type === 'checkbox') {
|
||||||
item.defaultValue = [];
|
item.defaultValue = [];
|
||||||
}
|
}
|
||||||
|
if (item.type === 'int' && item.defaultValue === null) {
|
||||||
|
// el-input-number 需要设置成 undefined,默认值才能设置为空
|
||||||
|
item.defaultValue = undefined;
|
||||||
|
}
|
||||||
this.templateContainIds.add(item.fieldId);
|
this.templateContainIds.add(item.fieldId);
|
||||||
});
|
});
|
||||||
this.$refs.customFieldFormList.refreshTable();
|
this.$refs.customFieldFormList.refreshTable();
|
||||||
|
|
|
@ -175,6 +175,9 @@ public class IssuesService {
|
||||||
JSON.parseObject(JSON.toJSONString(issuesRequest), PlatformIssuesUpdateRequest.class);
|
JSON.parseObject(JSON.toJSONString(issuesRequest), PlatformIssuesUpdateRequest.class);
|
||||||
List<PlatformCustomFieldItemDTO> customFieldItemDTOS =
|
List<PlatformCustomFieldItemDTO> customFieldItemDTOS =
|
||||||
JSON.parseArray(JSON.toJSONString(issuesRequest.getRequestFields()), PlatformCustomFieldItemDTO.class);
|
JSON.parseArray(JSON.toJSONString(issuesRequest.getRequestFields()), PlatformCustomFieldItemDTO.class);
|
||||||
|
customFieldItemDTOS = customFieldItemDTOS.stream()
|
||||||
|
.filter(item -> item != null && item.getValue() != null)
|
||||||
|
.toList();
|
||||||
platformIssuesUpdateRequest.setCustomFieldList(customFieldItemDTOS); // todo 全部插件化后去掉
|
platformIssuesUpdateRequest.setCustomFieldList(customFieldItemDTOS); // todo 全部插件化后去掉
|
||||||
platformIssuesUpdateRequest.setUserPlatformUserConfig(userService.getCurrentPlatformInfoStr(SessionUtils.getCurrentWorkspaceId()));
|
platformIssuesUpdateRequest.setUserPlatformUserConfig(userService.getCurrentPlatformInfoStr(SessionUtils.getCurrentWorkspaceId()));
|
||||||
platformIssuesUpdateRequest.setProjectConfig(PlatformPluginService.getCompatibleProjectConfig(project));
|
platformIssuesUpdateRequest.setProjectConfig(PlatformPluginService.getCompatibleProjectConfig(project));
|
||||||
|
@ -381,6 +384,9 @@ public class IssuesService {
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PlatformCustomFieldItemDTO> customFieldItemDTOS = JSON.parseArray(JSON.toJSONString(issuesRequest.getRequestFields()), PlatformCustomFieldItemDTO.class);
|
List<PlatformCustomFieldItemDTO> customFieldItemDTOS = JSON.parseArray(JSON.toJSONString(issuesRequest.getRequestFields()), PlatformCustomFieldItemDTO.class);
|
||||||
|
customFieldItemDTOS = customFieldItemDTOS.stream()
|
||||||
|
.filter(item -> item != null && item.getValue() != null)
|
||||||
|
.toList();
|
||||||
platformIssuesUpdateRequest.setCustomFieldList(customFieldItemDTOS); // todo 全部插件化后去掉
|
platformIssuesUpdateRequest.setCustomFieldList(customFieldItemDTOS); // todo 全部插件化后去掉
|
||||||
platformIssuesUpdateRequest.setUserPlatformUserConfig(userService.getCurrentPlatformInfoStr(SessionUtils.getCurrentWorkspaceId()));
|
platformIssuesUpdateRequest.setUserPlatformUserConfig(userService.getCurrentPlatformInfoStr(SessionUtils.getCurrentWorkspaceId()));
|
||||||
platformIssuesUpdateRequest.setProjectConfig(PlatformPluginService.getCompatibleProjectConfig(project));
|
platformIssuesUpdateRequest.setProjectConfig(PlatformPluginService.getCompatibleProjectConfig(project));
|
||||||
|
|
Loading…
Reference in New Issue