From b5760cd2b4869db77b8febbc05e076b135f2ee3a Mon Sep 17 00:00:00 2001
From: wenyann <64353056+wenyann@users.noreply.github.com>
Date: Fri, 8 May 2020 19:09:09 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../test/components/PerformanceAdvancedConfig.vue | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue b/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue
index 9bd3a408d4..ea2db72046 100644
--- a/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue
+++ b/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue
@@ -3,7 +3,7 @@
{{$t('load_test.domain_bind')}}
- {{$t('commons.add')}}
+ {{$t('commons.add')}}
@@ -85,7 +85,7 @@
{{$t('load_test.params')}}
- {{$t('commons.add')}}
+ {{$t('commons.add')}}
@@ -258,8 +258,8 @@
this.domains = data.domains || [];
this.params = data.params || [];
this.add('domains');
- this.domains.forEach(d => d.edit = false);
- this.params.forEach(d => d.edit = false);
+ /*this.domains.forEach(d => d.edit = false);
+ this.params.forEach(d => d.edit = false);*/
}
});
},
From 366ae5e95c1095bf1f27adcf090be0c36f4f0ef6 Mon Sep 17 00:00:00 2001
From: chenjianxing
Date: Sat, 9 May 2020 10:44:15 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9C=80=E8=BF=91?=
=?UTF-8?q?=E8=AE=A1=E5=88=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../business/components/track/case/TestCase.vue | 3 ++-
.../view/comonents/TestPlanTestCaseList.vue | 17 +++++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue
index 13e194f2f5..4fc8131eb7 100644
--- a/frontend/src/business/components/track/case/TestCase.vue
+++ b/frontend/src/business/components/track/case/TestCase.vue
@@ -117,7 +117,7 @@
}
}
if (!hasCurrentProject) {
- this.currentProject = null;
+ this.setCurrentProject(this.projects[0]);
}
} else {
if(this.projects.length > 0){
@@ -189,6 +189,7 @@
this.$get('/project/get/' + id, response => {
let project = response.data;
this.setCurrentProject(project);
+ this.$router.push('/track/case/all');
});
}
if (id === 'all') {
diff --git a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue
index c4602698ee..433e9e3643 100644
--- a/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue
+++ b/frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue
@@ -195,16 +195,14 @@
},
watch: {
planId() {
- this.getTestPlanById();
- this.initTableData();
+ this.refreshTableAndPlan();
},
selectNodeIds() {
this.search();
}
},
mounted() {
- this.getTestPlanById();
- this.initTableData();
+ this.refreshTableAndPlan();
},
methods: {
initTableData() {
@@ -224,6 +222,16 @@
this.selectIds.clear();
this.$emit('refresh');
},
+ refreshTableAndPlan() {
+ this.getTestPlanById();
+ this.initTableData();
+ },
+ refreshTestPlanRecent() {
+ let param = {};
+ param.id = this.planId;
+ param.updateTime = Date.now();
+ this.$post('/test/plan/edit', param);
+ },
search() {
this.initTableData();
},
@@ -298,6 +306,7 @@
if (this.planId) {
this.$post('/test/plan/get/' + this.planId, {}, response => {
this.testPlan = response.data;
+ this.refreshTestPlanRecent();
});
}
},
From 0752a0c54b987d38c17dc750a881bacc86b3268f Mon Sep 17 00:00:00 2001
From: shiziyuan9527
Date: Sat, 9 May 2020 11:05:03 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA?=
=?UTF-8?q?=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/java/io/metersphere/controller/UserController.java | 4 +---
backend/src/main/java/io/metersphere/service/UserService.java | 3 +++
.../business/components/settings/personal/PersonSetting.vue | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java
index 5338a0ef39..8c38b04282 100644
--- a/backend/src/main/java/io/metersphere/controller/UserController.java
+++ b/backend/src/main/java/io/metersphere/controller/UserController.java
@@ -118,10 +118,8 @@ public class UserController {
return userService.getUserList();
}
- @PostMapping("/update/currentuser")
+ @PostMapping("/update/current")
public UserDTO updateCurrentUser(@RequestBody User user) {
- SessionUser sessionUser = SessionUtils.getUser();
- BeanUtils.copyProperties(user, sessionUser);
userService.updateUser(user);
return SessionUtils.getUser();
}
diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java
index acb0dcc975..448de856fc 100644
--- a/backend/src/main/java/io/metersphere/service/UserService.java
+++ b/backend/src/main/java/io/metersphere/service/UserService.java
@@ -124,6 +124,9 @@ public class UserService {
}
public void updateUser(User user) {
+ UserDTO userDTO = getUserDTO(user.getId());
+ BeanUtils.copyProperties(user, userDTO);
+ SessionUtils.putUser(SessionUser.fromUser(userDTO));
user.setUpdateTime(System.currentTimeMillis());
userMapper.updateByPrimaryKeySelective(user);
}
diff --git a/frontend/src/business/components/settings/personal/PersonSetting.vue b/frontend/src/business/components/settings/personal/PersonSetting.vue
index 62df4fb731..10e7187e74 100644
--- a/frontend/src/business/components/settings/personal/PersonSetting.vue
+++ b/frontend/src/business/components/settings/personal/PersonSetting.vue
@@ -65,7 +65,7 @@
result: {},
updateVisible: false,
tableData: [],
- updatePath: '/user/update/currentuser',
+ updatePath: '/user/update/current',
form: {},
rule: {
name: [
From de3faf3ca5cdd242a91a02953355fc669949521a Mon Sep 17 00:00:00 2001
From: chenjianxing
Date: Sat, 9 May 2020 11:36:01 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=A8=A1=E5=9D=97?=
=?UTF-8?q?=E7=AD=89=E5=85=81=E8=AE=B8=E5=B8=A6=E7=A9=BA=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../excel/listener/TestCaseDataListener.java | 15 ++++++++++++---
.../track/case/components/TestCaseEdit.vue | 7 ++++++-
.../track/case/components/TestCaseMove.vue | 9 ++-------
.../business/components/track/common/NodeEdit.vue | 9 ++++++---
.../track/plan/components/TestPlanEdit.vue | 7 ++++++-
5 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java b/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java
index 6f37017e3d..b400c1fe07 100644
--- a/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java
+++ b/backend/src/main/java/io/metersphere/excel/listener/TestCaseDataListener.java
@@ -7,7 +7,9 @@ import io.metersphere.base.domain.TestCaseWithBLOBs;
import io.metersphere.commons.constants.TestCaseConstants;
import io.metersphere.commons.utils.BeanUtils;
import io.metersphere.service.TestCaseService;
+import org.apache.commons.lang3.StringUtils;
+import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@@ -38,12 +40,19 @@ public class TestCaseDataListener extends EasyExcelListener {
public String validate(TestCaseExcelData data, String errMsg) {
String nodePath = data.getNodePath();
StringBuilder stringBuilder = new StringBuilder(errMsg);
- if ( nodePath.split("/").length > TestCaseConstants.MAX_NODE_DEPTH + 1) {
+ String[] nodes = nodePath.split("/");
+
+ if ( nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) {
stringBuilder.append("节点最多为" + TestCaseConstants.MAX_NODE_DEPTH + "层;");
}
- if ( nodePath.trim().contains(" ")) {
- stringBuilder.append("所属模块不能包含空格");
+
+ for (int i = 0; i < nodes.length; i++) {
+ if (i != 0 && StringUtils.equals(nodes[i].trim(), "")) {
+ stringBuilder.append("所属模块不能为空格");
+ break;
+ }
}
+
if (!userIds.contains(data.getMaintainer())) {
stringBuilder.append("该工作空间下无该用户:" + data.getMaintainer() + ";");
}
diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue
index 4f969158f9..acdc85bebc 100644
--- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue
+++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue
@@ -13,7 +13,7 @@
:label="$t('test_track.case.name')"
:label-width="formLabelWidth"
prop="name">
-
+
@@ -313,6 +313,11 @@
if(localStorage.getItem(CURRENT_PROJECT)) {
param.projectId = JSON.parse(localStorage.getItem(CURRENT_PROJECT)).id;
}
+ param.name = param.name.trim();
+ if (param.name == '') {
+ this.$warning(this.$t('test_track.case.input_name'));
+ return;
+ }
this.$post('/test/case/' + this.operationType, param, () => {
this.$success(this.$t('commons.save_success'));
this.dialogFormVisible = false;
diff --git a/frontend/src/business/components/track/case/components/TestCaseMove.vue b/frontend/src/business/components/track/case/components/TestCaseMove.vue
index 0240d2f6b3..8f1e6ef5bb 100644
--- a/frontend/src/business/components/track/case/components/TestCaseMove.vue
+++ b/frontend/src/business/components/track/case/components/TestCaseMove.vue
@@ -5,7 +5,7 @@
:before-close="close"
width="20%">
-
{
this.$success(this.$t('commons.save_success'));
diff --git a/frontend/src/business/components/track/common/NodeEdit.vue b/frontend/src/business/components/track/common/NodeEdit.vue
index 46e4bd8f24..988282824d 100644
--- a/frontend/src/business/components/track/common/NodeEdit.vue
+++ b/frontend/src/business/components/track/common/NodeEdit.vue
@@ -12,7 +12,7 @@
:label="$t('test_track.module.name')"
:label-width="formLabelWidth"
prop="name">
-
+
@@ -69,7 +69,10 @@
if (valid) {
let param = {};
let url = this.buildParam(param);
-
+ if (param.name.trim() == '') {
+ this.$warning(this.$t('test_track.case.input_name'));
+ return;
+ }
this.$post(url, param, () => {
this.$success(this.$t('commons.save_success'));
this.$emit('refresh');
@@ -95,7 +98,7 @@
param.id = this.node.id;
param.level = this.node.level;
}
- param.name = this.form.name;
+ param.name = this.form.name.trim();
param.label = this.form.name;
if (localStorage.getItem(CURRENT_PROJECT)) {
param.projectId = JSON.parse(localStorage.getItem(CURRENT_PROJECT)).id;
diff --git a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue
index c2322c567c..dfeb4cd842 100644
--- a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue
+++ b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue
@@ -15,7 +15,7 @@
:label="$t('test_track.plan.plan_name')"
:label-width="formLabelWidth"
prop="name">
-
+
@@ -149,6 +149,11 @@
if (valid) {
let param = {};
Object.assign(param, this.form);
+ param.name = param.name.trim();
+ if (param.name == '') {
+ this.$warning(this.$t('test_track.plan.input_plan_name'));
+ return;
+ }
param.workspaceId = localStorage.getItem(WORKSPACE_ID);
this.$post('/test/plan/' + this.operationType, param, () => {
this.$success(this.$t('commons.save_success'));
From 998134b1f13987e30ea2919f6395ee64ca6d3d65 Mon Sep 17 00:00:00 2001
From: wenyann <64353056+wenyann@users.noreply.github.com>
Date: Sat, 9 May 2020 12:06:09 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E5=AF=86=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../settings/personal/PersonSetting.vue | 12 ++++++++++++
.../components/settings/system/User.vue | 17 +++++++++++++++++
frontend/src/i18n/en-US.js | 2 ++
frontend/src/i18n/zh-CN.js | 2 ++
4 files changed, 33 insertions(+)
diff --git a/frontend/src/business/components/settings/personal/PersonSetting.vue b/frontend/src/business/components/settings/personal/PersonSetting.vue
index 62df4fb731..dc2c78823c 100644
--- a/frontend/src/business/components/settings/personal/PersonSetting.vue
+++ b/frontend/src/business/components/settings/personal/PersonSetting.vue
@@ -43,6 +43,9 @@
+
+
+
+
+
+
+
+
+
+