Merge branch 'v1.8' of github.com:metersphere/metersphere into v1.8

This commit is contained in:
chenjianxing 2021-03-30 12:06:18 +08:00
commit fc9d040579
8 changed files with 22 additions and 20 deletions

3
Jenkinsfile vendored
View File

@ -13,6 +13,9 @@ pipeline {
stage('Build/Test') {
steps {
configFileProvider([configFile(fileId: 'metersphere-maven', targetLocation: 'settings.xml')]) {
sh "cd frontend"
sh "yarn install"
sh "cd .."
sh "mvn clean package --settings ./settings.xml"
}
}

View File

@ -242,8 +242,8 @@ public class ApiAutomationService {
} else {
scenario.setUserId(request.getUserId());
}
if (StringUtils.isEmpty(request.getApiScenarioModuleId())) {
scenario.setApiScenarioModuleId("root");
if (StringUtils.isEmpty(request.getApiScenarioModuleId()) || StringUtils.isEmpty(request.getModulePath())) {
scenario.setApiScenarioModuleId("default-module");
scenario.setModulePath("/默认模块");
}
return scenario;

View File

@ -262,9 +262,9 @@ public class ApiDefinitionService {
test.setEnvironmentId(request.getEnvironmentId());
test.setUserId(request.getUserId());
test.setTags(request.getTags());
if (StringUtils.isEmpty(request.getModuleId())) {
if (StringUtils.isEmpty(request.getModulePath()) || StringUtils.isEmpty(request.getModuleId())) {
test.setModulePath("/默认模块");
test.setModuleId("root");
test.setModuleId("default-module");
}
apiDefinitionMapper.updateByPrimaryKeySelective(test);
return test;
@ -290,9 +290,9 @@ public class ApiDefinitionService {
test.setStatus(APITestStatus.Underway.name());
test.setModulePath(request.getModulePath());
test.setModuleId(request.getModuleId());
if (StringUtils.isEmpty(request.getModuleId())) {
if (StringUtils.isEmpty(request.getModulePath()) || StringUtils.isEmpty(request.getModuleId())) {
test.setModulePath("/默认模块");
test.setModuleId("root");
test.setModuleId("default-module");
}
test.setResponse(JSONObject.toJSONString(request.getResponse()));
test.setEnvironmentId(request.getEnvironmentId());
@ -604,8 +604,8 @@ public class ApiDefinitionService {
}
for (int i = 0; i < data.size(); i++) {
ApiDefinitionWithBLOBs item = data.get(i);
if (StringUtils.isEmpty(item.getModuleId())) {
item.setModuleId("root");
if (StringUtils.isEmpty(item.getModuleId()) || StringUtils.isEmpty(item.getModulePath())) {
item.setModuleId("default-module");
item.setModulePath("/默认模块");
}
if (item.getName().length() > 255) {

View File

@ -296,7 +296,7 @@
}
let api = {
status: "Underway", method: "GET", userId: getCurrentUser().id,
url: "", protocol: this.currentProtocol, environmentId: "", moduleId: 'root', modulePath: "/" + this.$t("commons.module_title")
url: "", protocol: this.currentProtocol, environmentId: "", moduleId: 'default-module', modulePath: "/" + this.$t("commons.module_title")
};
if (this.nodeTree && this.nodeTree.length > 0) {
api.moduleId = this.nodeTree[0].id;

View File

@ -275,7 +275,7 @@
}
},
addModule(row) {
this.saveApi(row, "root");
this.saveApi(row, "default-module");
},
saveApi(row, module) {
let data = this.api;

View File

@ -20,7 +20,7 @@
:condition="condition"
:current-module="currentModule"
:is-read-only="isReadOnly"
:moduleOptions="extendTreeNodes"
:moduleOptions="data"
@exportAPI="exportAPI"
@saveAsEdit="saveAsEdit"
@refreshTable="$emit('refreshTable')"
@ -62,7 +62,6 @@
},
data: [],
currentModule: {},
extendTreeNodes: [],
}
},
props: {
@ -131,17 +130,17 @@
this.result = this.$get(url, response => {
if (response.data != undefined && response.data != null) {
this.data = response.data;
this.extendTreeNodes = [];
this.extendTreeNodes.unshift({
"id": "root",
this.data.unshift({
"id": "default-module",
"name": this.$t('commons.module_title'),
"level": 0,
"children": this.data,
"path": "/" + this.$t('commons.module_title'),
"children": [],
});
this.extendTreeNodes.forEach(node => {
this.data.forEach(node => {
buildTree(node, {path: ''});
});
this.$emit('setModuleOptions', this.extendTreeNodes);
this.$emit('setModuleOptions', this.data);
this.$emit('setNodeTree', this.data);
if (this.$refs.nodeTree) {
this.$refs.nodeTree.filter(this.condition.filterText);

View File

@ -92,7 +92,7 @@ export default {
allLabel: {
type: String,
default() {
return this.$t('commons.module_title');
return this.$t("commons.all_label.case");
}
},
nameLimit: {

@ -1 +1 @@
Subproject commit 2115bd28a90854d2b6276a90878934715498c584
Subproject commit 07951ba17aef6f29e50cfd68e40de3266f9a60cd