fix(测试跟踪): 缺陷列表平台状态下拉框缺少Jira平台

--bug=1019953 --user=陈建星 【测试跟踪】上传jira插件-缺陷管理-平台状态-下拉框没有jira https://www.tapd.cn/55049933/s/1299346
This commit is contained in:
chenjianxing 2022-11-21 14:41:30 +08:00 committed by jianxing
parent 4890bb732d
commit f4f4758c47
5 changed files with 41 additions and 4 deletions

View File

@ -20,7 +20,6 @@ export function validateProjectConfig(pluginId, config) {
export function getPlatformProjectOption(pluginId, request) {
return post(BASE_URL + 'project/option', request);
}
export function getPlatformOption() {
return get(BASE_URL + 'platform/option');
}

View File

@ -15,6 +15,7 @@ import io.metersphere.dto.IssuesStatusCountDao;
import io.metersphere.excel.domain.ExcelResponse;
import io.metersphere.log.annotation.MsAuditLog;
import io.metersphere.notice.annotation.SendNotice;
import io.metersphere.platform.domain.SelectOption;
import io.metersphere.request.issues.IssueExportRequest;
import io.metersphere.request.issues.IssueImportRequest;
import io.metersphere.request.issues.PlatformIssueTypeRequest;
@ -22,6 +23,7 @@ import io.metersphere.request.testcase.AuthUserIssueRequest;
import io.metersphere.request.testcase.IssuesCountRequest;
import io.metersphere.service.BaseCheckPermissionService;
import io.metersphere.service.IssuesService;
import io.metersphere.service.PlatformPluginService;
import io.metersphere.service.issue.domain.zentao.ZentaoBuild;
import io.metersphere.xpack.track.dto.*;
import io.metersphere.xpack.track.dto.request.IssuesRequest;
@ -42,6 +44,8 @@ public class IssuesController {
private IssuesService issuesService;
@Resource
private BaseCheckPermissionService baseCheckPermissionService;
@Resource
private PlatformPluginService platformPluginService;
@PostMapping("/list/{goPage}/{pageSize}")
@RequiresPermissions(PermissionConstants.PROJECT_TRACK_ISSUE_READ)
@ -199,6 +203,11 @@ public class IssuesController {
return issuesService.getPlatformTransitions(request);
}
@GetMapping("/platform/option")
public List<SelectOption> getPlatformOptions() {
return platformPluginService.getPlatformOptions();
}
@PostMapping("/check/third/project")
public void checkThirdProjectExist(@RequestBody Project project) {
issuesService.checkThirdProjectExist(project);

View File

@ -10,6 +10,7 @@ import io.metersphere.base.domain.ServiceIntegration;
import io.metersphere.commons.constants.PluginScenario;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.platform.domain.PlatformRequest;
import io.metersphere.platform.domain.SelectOption;
import io.metersphere.platform.loader.PlatformPluginManager;
import io.metersphere.request.IntegrationRequest;
import io.metersphere.utils.PluginManagerUtil;
@ -21,6 +22,7 @@ import javax.annotation.Resource;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@Transactional(rollbackFor = Exception.class)
@ -101,4 +103,19 @@ public class PlatformPluginService {
}
return true;
}
public List<SelectOption> getPlatformOptions() {
List<SelectOption> options = pluginManager.getPluginMetaInfoList()
.stream()
.map(pluginMetaInfo -> new SelectOption(pluginMetaInfo.getLabel(), pluginMetaInfo.getKey()))
.collect(Collectors.toList());
List<ServiceIntegration> integrations = baseIntegrationService.getAll(SessionUtils.getCurrentWorkspaceId());
// 过滤掉服务集成中没有的选项
return options.stream()
.filter(option ->
integrations.stream()
.filter(integration -> StringUtils.equals(integration.getPlatform(), option.getValue()))
.collect(Collectors.toList()).size() > 0
).collect(Collectors.toList());
}
}

View File

@ -248,3 +248,7 @@ export function getIssuePartTemplateWithProject(callback) {
});
});
}
export function getPlatformOption() {
return get(BASE_URL + 'platform/option');
}

View File

@ -195,7 +195,7 @@ import {
getIssues,
syncIssues,
deleteIssue,
getIssuesById, batchDeleteIssue
getIssuesById, batchDeleteIssue, getPlatformOption
} from "@/api/issue";
import {
getCustomFieldValue,
@ -268,7 +268,8 @@ export default {
isThirdPart: false,
creatorFilters: [],
loading: false,
dataSelectRange: ""
dataSelectRange: "",
platformOptions: []
};
},
watch: {
@ -297,10 +298,17 @@ export default {
});
this.getIssues();
});
getPlatformOption()
.then((r) => {
this.platformOptions = r.data;
});
},
computed: {
platformFilters() {
return ISSUE_PLATFORM_OPTION;
let options = [...ISSUE_PLATFORM_OPTION];
options.push(...this.platformOptions);
return options;
},
issueStatusMap() {
return ISSUE_STATUS_MAP;