fix: 缺陷平台校验报错

This commit is contained in:
chenjianxing 2021-07-01 14:35:31 +08:00 committed by jianxing
parent bb63da7e9a
commit dc04b8f3ca
7 changed files with 36 additions and 32 deletions

View File

@ -54,9 +54,9 @@ public class IssuesController {
return issuesService.getIssues(id); return issuesService.getIssues(id);
} }
@GetMapping("/auth/{platform}") @GetMapping("/auth/{orgId}/{platform}")
public void testAuth(@PathVariable String platform) { public void testAuth(@PathVariable String orgId, @PathVariable String platform) {
issuesService.testAuth(platform); issuesService.testAuth(orgId, platform);
} }
@GetMapping("/close/{id}") @GetMapping("/close/{id}")

View File

@ -72,8 +72,10 @@ public class IssuesService {
@Resource @Resource
private TestCaseMapper testCaseMapper; private TestCaseMapper testCaseMapper;
public void testAuth(String platform) { public void testAuth(String orgId, String platform) {
AbstractIssuePlatform abstractPlatform = IssueFactory.createPlatform(platform, new IssuesRequest()); IssuesRequest issuesRequest = new IssuesRequest();
issuesRequest.setOrganizationId(orgId);
AbstractIssuePlatform abstractPlatform = IssueFactory.createPlatform(platform, issuesRequest);
abstractPlatform.testAuth(); abstractPlatform.testAuth();
} }

View File

@ -58,7 +58,7 @@
<script> <script>
import BugManageBtn from "@/business/components/settings/organization/components/BugManageBtn"; import BugManageBtn from "@/business/components/settings/organization/components/BugManageBtn";
import {getCurrentUser} from "@/common/js/utils"; import {getCurrentOrganizationId, getCurrentUser} from "@/common/js/utils";
import {JIRA} from "@/common/js/constants"; import {JIRA} from "@/common/js/constants";
import MsInstructionsIcon from "@/business/components/common/components/MsInstructionsIcon"; import MsInstructionsIcon from "@/business/components/common/components/MsInstructionsIcon";
@ -167,7 +167,7 @@ export default {
}, },
testConnection() { testConnection() {
if (this.form.account && this.form.password) { if (this.form.account && this.form.password) {
this.$parent.result = this.$get("issues/auth/" + JIRA, () => { this.$parent.result = this.$get("issues/auth/" + getCurrentOrganizationId() + '/' + JIRA, () => {
this.$success(this.$t('organization.integration.verified')); this.$success(this.$t('organization.integration.verified'));
}); });
} else { } else {

View File

@ -39,7 +39,7 @@
<script> <script>
import BugManageBtn from "@/business/components/settings/organization/components/BugManageBtn"; import BugManageBtn from "@/business/components/settings/organization/components/BugManageBtn";
import {getCurrentUser} from "@/common/js/utils"; import {getCurrentOrganizationId, getCurrentUser} from "@/common/js/utils";
import {TAPD} from "@/common/js/constants"; import {TAPD} from "@/common/js/constants";
export default { export default {
@ -123,7 +123,7 @@ export default {
}, },
testConnection() { testConnection() {
if (this.form.account && this.form.password) { if (this.form.account && this.form.password) {
this.$parent.result = this.$get("issues/auth/" + TAPD, () => { this.$parent.result = this.$get("issues/auth/" + getCurrentOrganizationId() + '/' + TAPD, () => {
this.$success(this.$t('organization.integration.verified')); this.$success(this.$t('organization.integration.verified'));
}); });
} else { } else {

View File

@ -42,7 +42,7 @@
<script> <script>
import BugManageBtn from "@/business/components/settings/organization/components/BugManageBtn"; import BugManageBtn from "@/business/components/settings/organization/components/BugManageBtn";
import {getCurrentUser} from "@/common/js/utils"; import {getCurrentOrganizationId, getCurrentUser} from "@/common/js/utils";
import {ZEN_TAO} from "@/common/js/constants"; import {ZEN_TAO} from "@/common/js/constants";
export default { export default {
@ -139,7 +139,7 @@ export default {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.account && this.form.password) { if (this.form.account && this.form.password) {
this.$parent.result = this.$get("issues/auth/" + ZEN_TAO, () => { this.$parent.result = this.$get("issues/auth/" + getCurrentOrganizationId() + '/' + ZEN_TAO, () => {
this.$success(this.$t('organization.integration.verified')); this.$success(this.$t('organization.integration.verified'));
}); });
} else { } else {

View File

@ -84,26 +84,26 @@
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="createVisible" destroy-on-close <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="createVisible" destroy-on-close
@close="handleClose"> @close="handleClose">
<el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="80px" size="small"> <el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="80px" size="small">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label-width="labelWidth" :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input> <el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('用例模板')" prop="caseTemplateId"> <el-form-item :label-width="labelWidth" :label="$t('用例模板')" prop="caseTemplateId">
<template-select :data="form" scene="API_CASE" prop="caseTemplateId" ref="caseTemplate"/> <template-select :data="form" scene="API_CASE" prop="caseTemplateId" ref="caseTemplate"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('缺陷模板')" prop="issueTemplateId"> <el-form-item :label-width="labelWidth" :label="$t('缺陷模板')" prop="issueTemplateId">
<template-select :data="form" scene="ISSUE" prop="issueTemplateId" ref="issueTemplate"/> <template-select :data="form" scene="ISSUE" prop="issueTemplateId" ref="issueTemplate"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.description')" prop="description"> <el-form-item :label-width="labelWidth" :label="$t('commons.description')" prop="description">
<el-input :autosize="{ minRows: 2, maxRows: 4}" type="textarea" v-model="form.description"></el-input> <el-input :autosize="{ minRows: 2, maxRows: 4}" type="textarea" v-model="form.description"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('project.tapd_id')" v-if="tapd"> <el-form-item :label-width="labelWidth" :label="$t('project.tapd_id')" v-if="tapd">
<el-input v-model="form.tapdId" autocomplete="off"></el-input> <el-input v-model="form.tapdId" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('project.jira_key')" v-if="jira"> <el-form-item :label-width="labelWidth" :label="$t('project.jira_key')" v-if="jira">
<el-input v-model="form.jiraKey" autocomplete="off"/> <el-input v-model="form.jiraKey" autocomplete="off"/>
<ms-instructions-icon effect="light"> <ms-instructions-icon effect="light">
<template> <template>
@ -111,16 +111,16 @@
</template> </template>
</ms-instructions-icon> </ms-instructions-icon>
</el-form-item> </el-form-item>
<el-form-item :label="$t('project.zentao_id')" v-if="zentao"> <el-form-item :label-width="labelWidth" :label="$t('project.zentao_id')" v-if="zentao">
<el-input v-model="form.zentaoId" autocomplete="off"></el-input> <el-input v-model="form.zentaoId" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('project.repeatable')" prop="repeatable"> <el-form-item :label-width="labelWidth" :label="$t('project.repeatable')" prop="repeatable">
<el-switch v-model="form.repeatable"></el-switch> <el-switch v-model="form.repeatable"></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="测试用例自定义ID" prop="customNum"> <el-form-item :label-width="labelWidth" label="测试用例自定义ID" prop="customNum">
<el-switch v-model="form.customNum"></el-switch> <el-switch v-model="form.customNum"></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="场景自定义ID" prop="scenarioCustomNum"> <el-form-item :label-width="labelWidth" label="场景自定义ID" prop="scenarioCustomNum">
<el-switch v-model="form.scenarioCustomNum"></el-switch> <el-switch v-model="form.scenarioCustomNum"></el-switch>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -215,6 +215,7 @@ export default {
// issueTemplateId: [{required: true}], // issueTemplateId: [{required: true}],
}, },
screenHeight: 'calc(100vh - 255px)', screenHeight: 'calc(100vh - 255px)',
labelWidth: '150px'
}; };
}, },
props: { props: {

View File

@ -90,26 +90,26 @@
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="createVisible" destroy-on-close <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="createVisible" destroy-on-close
@close="handleClose"> @close="handleClose">
<el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="80px" size="small"> <el-form :model="form" :rules="rules" ref="form" label-position="right" label-width="80px" size="small">
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label-width="labelWidth" :label="$t('commons.name')" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input> <el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('用例模板')" prop="caseTemplateId"> <el-form-item :label-width="labelWidth" :label="$t('用例模板')" prop="caseTemplateId">
<template-select :data="form" scene="API_CASE" prop="caseTemplateId" ref="caseTemplate"/> <template-select :data="form" scene="API_CASE" prop="caseTemplateId" ref="caseTemplate"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('缺陷模板')" prop="issueTemplateId"> <el-form-item :label-width="labelWidth" :label="$t('缺陷模板')" prop="issueTemplateId">
<template-select :data="form" scene="ISSUE" prop="issueTemplateId" ref="issueTemplate"/> <template-select :data="form" scene="ISSUE" prop="issueTemplateId" ref="issueTemplate"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('commons.description')" prop="description"> <el-form-item :label-width="labelWidth" :label="$t('commons.description')" prop="description">
<el-input :autosize="{ minRows: 2, maxRows: 4}" type="textarea" v-model="form.description"></el-input> <el-input :autosize="{ minRows: 2, maxRows: 4}" type="textarea" v-model="form.description"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('project.tapd_id')" v-if="tapd"> <el-form-item :label-width="labelWidth" :label="$t('project.tapd_id')" v-if="tapd">
<el-input v-model="form.tapdId" autocomplete="off"></el-input> <el-input v-model="form.tapdId" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('project.jira_key')" v-if="jira"> <el-form-item :label-width="labelWidth" :label="$t('project.jira_key')" v-if="jira">
<el-input v-model="form.jiraKey" autocomplete="off"/> <el-input v-model="form.jiraKey" autocomplete="off"/>
<ms-instructions-icon effect="light"> <ms-instructions-icon effect="light">
<template> <template>
@ -117,16 +117,16 @@
</template> </template>
</ms-instructions-icon> </ms-instructions-icon>
</el-form-item> </el-form-item>
<el-form-item :label="$t('project.zentao_id')" v-if="zentao"> <el-form-item :label-width="labelWidth" :label="$t('project.zentao_id')" v-if="zentao">
<el-input v-model="form.zentaoId" autocomplete="off"></el-input> <el-input v-model="form.zentaoId" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('project.repeatable')" prop="repeatable"> <el-form-item :label-width="labelWidth" :label="$t('project.repeatable')" prop="repeatable">
<el-switch v-model="form.repeatable"></el-switch> <el-switch v-model="form.repeatable"></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="测试用例自定义ID" prop="customNum"> <el-form-item :label-width="labelWidth" label="测试用例自定义ID" prop="customNum">
<el-switch v-model="form.customNum"></el-switch> <el-switch v-model="form.customNum"></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="场景自定义ID" prop="scenarioCustomNum"> <el-form-item :label-width="labelWidth" label="场景自定义ID" prop="scenarioCustomNum">
<el-switch v-model="form.scenarioCustomNum"></el-switch> <el-switch v-model="form.scenarioCustomNum"></el-switch>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -305,7 +305,8 @@ export default {
dialogPageSize: 10, dialogPageSize: 10,
dialogTotal: 0, dialogTotal: 0,
currentProjectId: "", currentProjectId: "",
userList: [] userList: [],
labelWidth: '150px'
}; };
}, },
props: { props: {