Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wenyann 2020-05-09 12:08:06 +08:00
commit 6012004200
8 changed files with 37 additions and 19 deletions

View File

@ -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();
}

View File

@ -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<TestCaseExcelData> {
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() + ";");
}

View File

@ -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);
}

View File

@ -68,7 +68,7 @@
result: {},
updateVisible: false,
tableData: [],
updatePath: '/user/update/currentuser',
updatePath: '/user/update/current',
form: {},
rule: {
name: [

View File

@ -13,7 +13,7 @@
:label="$t('test_track.case.name')"
:label-width="formLabelWidth"
prop="name">
<el-input :disabled="readOnly" v-model.trim="form.name"></el-input>
<el-input :disabled="readOnly" v-model="form.name"></el-input>
</el-form-item>
</el-col>
@ -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;

View File

@ -5,7 +5,7 @@
:before-close="close"
width="20%">
<el-select v-model.trim="module"
<el-select v-model="module"
:placeholder="$t('test_track.case.move')"
filterable>
<el-option v-for="item in moduleOptions" :key="item.id"
@ -40,7 +40,7 @@
methods: {
save() {
if (this.module === '') {
this.$warning(this.$t('test_track.plan_view.select_execute_result'));
this.$warning(this.$t('test_track.case.input_module'));
return;
}
let param = {};
@ -50,11 +50,6 @@
param.nodePath = item.path;
}
});
if (this.module === '') {
this.$warning(this.$t('test_track.plan_view.select_executor'));
return;
}
param.ids = [...this.selectIds];
this.$post('/test/case/batch/edit' , param, () => {
this.$success(this.$t('commons.save_success'));

View File

@ -12,7 +12,7 @@
:label="$t('test_track.module.name')"
:label-width="formLabelWidth"
prop="name">
<el-input v-model.trim="form.name" autocomplete="off"></el-input>
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
</el-form>
</el-col>
@ -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;

View File

@ -15,7 +15,7 @@
:label="$t('test_track.plan.plan_name')"
:label-width="formLabelWidth"
prop="name">
<el-input v-model.trim="form.name"></el-input>
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
@ -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'));