Merge remote-tracking branch 'origin/master'

This commit is contained in:
wenyann 2020-08-25 16:06:47 +08:00
commit 7f0f245609
14 changed files with 91 additions and 55 deletions

View File

@ -219,7 +219,7 @@
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>jmeter-plugins-dubbo</artifactId>
<version>2.7.9</version>
<version>2.7.10</version>
</dependency>
<!-- LDAP Module -->

View File

@ -135,16 +135,21 @@ public class Swagger2Parser extends ApiImportAbstractParser {
simpleRef = refModel.getSimpleRef();
}
Model model = definitions.get(simpleRef);
JSONObject bodyParameters = getBodyJSONObjectParameters(model.getProperties(), definitions);
HashSet<String> refSet = new HashSet<>();
refSet.add(simpleRef);
JSONObject bodyParameters = getBodyJSONObjectParameters(model.getProperties(), definitions, refSet);
body.setRaw(bodyParameters.toJSONString());
} else if (schema instanceof ArrayModel) {
ArrayModel arrayModel = (ArrayModel) bodyParameter.getSchema();
Property items = arrayModel.getItems();
if (items instanceof RefProperty) {
RefProperty refProperty = (RefProperty) items;
Model model = definitions.get(refProperty.getSimpleRef());
String simpleRef = refProperty.getSimpleRef();
HashSet<String> refSet = new HashSet<>();
refSet.add(simpleRef);
Model model = definitions.get(simpleRef);
JSONArray propertyList = new JSONArray();
propertyList.add(getBodyJSONObjectParameters(model.getProperties(), definitions));
propertyList.add(getBodyJSONObjectParameters(model.getProperties(), definitions, refSet));
body.setRaw(propertyList.toString());
}
}
@ -152,20 +157,26 @@ public class Swagger2Parser extends ApiImportAbstractParser {
body.setFormat("json");
}
private JSONObject getBodyJSONObjectParameters(Map<String, Property> properties, Map<String, Model> definitions) {
private JSONObject getBodyJSONObjectParameters(Map<String, Property> properties, Map<String, Model> definitions, HashSet<String> refSet) {
JSONObject jsonObject = new JSONObject();
properties.forEach((key, value) -> {
if (value instanceof ObjectProperty) {
ObjectProperty objectProperty = (ObjectProperty) value;
jsonObject.put(key, getBodyJSONObjectParameters(objectProperty.getProperties(), definitions));
jsonObject.put(key, getBodyJSONObjectParameters(objectProperty.getProperties(), definitions, refSet));
} else if (value instanceof ArrayProperty) {
ArrayProperty arrayProperty = (ArrayProperty) value;
Property items = arrayProperty.getItems();
if (items instanceof RefProperty) {
RefProperty refProperty = (RefProperty) items;
Model model = definitions.get(refProperty.getSimpleRef());
String simpleRef = refProperty.getSimpleRef();
if (refSet.contains(simpleRef)) {
jsonObject.put(key, new JSONArray());
return;
}
refSet.add(simpleRef);
Model model = definitions.get(simpleRef);
JSONArray propertyList = new JSONArray();
propertyList.add(getBodyJSONObjectParameters(model.getProperties(), definitions));
propertyList.add(getBodyJSONObjectParameters(model.getProperties(), definitions, refSet));
jsonObject.put(key, propertyList);
} else {
jsonObject.put(key, new ArrayList<>());

View File

@ -137,7 +137,7 @@
</select>
<select id="selectDashboardTests" resultType="io.metersphere.dto.DashboardTestDTO">
SELECT create_time AS date, count(api_test_report.id) AS count,
SELECT min(create_time) AS date, count(api_test_report.id) AS count,
date_format(from_unixtime(create_time / 1000), '%Y-%m-%d') AS x
FROM api_test_report
WHERE test_id IN (SELECT api_test.id

View File

@ -126,7 +126,7 @@
</select>
<select id="selectDashboardTests" resultType="io.metersphere.dto.DashboardTestDTO">
SELECT create_time AS date, count(load_test_report.id) AS count,
SELECT min(create_time) AS date, count(load_test_report.id) AS count,
date_format(from_unixtime(create_time / 1000), '%Y-%m-%d') AS x
FROM load_test_report
WHERE test_id IN (SELECT load_test.id

View File

@ -74,6 +74,7 @@
methods: {
add() {
this.common.type = this.extractType;
this.list.push(new ExtractCommon(this.extractType, this.common));
this.clear();
this.callback();

View File

@ -749,13 +749,15 @@ class JMXHttpRequest {
getPostQueryParameters(request, path) {
if (this.method.toUpperCase() !== "GET") {
path += '?';
let parameters = [];
request.parameters.forEach(parameter => {
if (parameter.name && parameter.value) {
parameters.push(parameter);
}
});
if (parameters.length > 0) {
path += '?';
}
for (let i = 0; i < parameters.length; i++) {
let parameter = parameters[i];
path += (parameter.name + '=' + parameter.value);
@ -942,7 +944,7 @@ class JMXGenerator {
addBodyFormat(request) {
let bodyFormat = request.body.format;
if (bodyFormat) {
if (!request.body.isKV() && bodyFormat) {
switch (bodyFormat) {
case BODY_FORMAT.JSON:
this.addContentType(request, 'application/json');

View File

@ -72,7 +72,8 @@
format() {
if (this.mode === 'json') {
try {
this.formatData = JSON.stringify(JSON.parse(this.data), null, '\t');
var JSONbigString = require('json-bigint')({"storeAsString": true});
this.formatData = JSON.stringify(JSONbigString.parse(this.data), null, '\t');
} catch (e) {
if (this.data) {
this.formatData = this.data;

View File

@ -286,4 +286,8 @@ export default {
cursor: pointer;
}
pre {
margin: 0 0;
}
</style>

View File

@ -31,7 +31,7 @@
<ms-table-header :condition.sync="dialogCondition" @create="addMember" @search="dialogSearch"
:create-tip="$t('member.create')" :title="$t('commons.member')"/>
<!-- organization member table -->
<el-table :border="true" :data="memberLineData" style="width: 100%;margin-top:5px;">
<el-table :border="true" class="adjust-table" :data="memberLineData" style="width: 100%;margin-top:5px;">
<el-table-column prop="id" label="ID"/>
<el-table-column prop="name" :label="$t('commons.username')"/>
<el-table-column prop="email" :label="$t('commons.email')"/>

View File

@ -75,13 +75,13 @@
</el-col>
<el-col :span="6">
<el-form-item prop="port" label="Port" style="padding-left: 20px">
<el-input-number v-model="item.port" :min="1" :max="9999"></el-input-number>
<el-input-number v-model="item.port" :min="1" :max="65535"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="maxConcurrency" :label="$t('test_resource_pool.max_threads')"
style="padding-left: 20px">
<el-input-number v-model="item.maxConcurrency" :min="1" :max="9999"></el-input-number>
<el-input-number v-model="item.maxConcurrency" :min="1" :max="1000000000"></el-input-number>
</el-form-item>
</el-col>
<el-col :offset="2" :span="2">
@ -137,13 +137,13 @@
</el-col>
<el-col :span="6">
<el-form-item prop="port" label="Port" style="padding-left: 20px">
<el-input-number v-model="item.port" :min="1" :max="9999"></el-input-number>
<el-input-number v-model="item.port" :min="1" :max="65535"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item prop="maxConcurrency" :label="$t('test_resource_pool.max_threads')"
style="padding-left: 20px">
<el-input-number v-model="item.maxConcurrency" :min="1" :max="9999"></el-input-number>
<el-input-number v-model="item.maxConcurrency" :min="1" :max="1000000000"></el-input-number>
</el-form-item>
</el-col>
<el-col :offset="2" :span="2">

View File

@ -141,29 +141,29 @@
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="35%">
<template v-slot:default="scope">
<el-input
class="table-edit-input"
size="mini"
v-if="!readOnly"
:disabled="readOnly"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
:rows="2"
v-model="scope.row.desc"
:placeholder="$t('commons.input_content')"
clearable></el-input>
<pre>{{scope.row.desc}}</pre>
clearable/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="35%">
<template v-slot:default="scope">
<el-input
class="table-edit-input"
size="mini"
v-if="!readOnly"
:disabled="readOnly"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
:rows="2"
v-model="scope.row.result"
:placeholder="$t('commons.input_content')"
clearable></el-input>
<pre>{{scope.row.result}}</pre>
clearable/>
</template>
</el-table-column>
<el-table-column :label="$t('commons.input_content')" min-width="15%">
@ -512,18 +512,6 @@
<style scoped>
.tb-edit .el-textarea {
display: none;
}
.tb-edit .current-row .el-textarea {
display: block;
}
.tb-edit .current-row .el-textarea + pre {
display: none;
}
.el-switch {
margin-bottom: 10px;
}

View File

@ -128,17 +128,30 @@
<el-table-column :label="$t('test_track.case.step_desc')" prop="desc" min-width="21%">
<template v-slot:default="scope">
<pre>{{scope.row.desc}}</pre>
<el-input
size="mini"
class="border-hidden"
type="textarea"
:autosize="{ minRows: 1, maxRows: 4}"
:disabled="true"
v-model="scope.row.desc"/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.case.expected_results')" prop="result" min-width="21%">
<template v-slot:default="scope">
<pre>{{scope.row.result}}</pre>
<el-input
size="mini"
class="border-hidden"
type="textarea"
:autosize="{ minRows: 1, maxRows: 4}"
:disabled="true"
v-model="scope.row.result"/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.plan_view.actual_result')" min-width="21%">
<template v-slot:default="scope">
<el-input
class="table-edit-input"
size="mini"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
@ -146,8 +159,7 @@
:disabled="isReadOnly"
v-model="scope.row.actualResult"
:placeholder="$t('commons.input_content')"
clearable></el-input>
<pre>{{scope.row.actualResult}}</pre>
clearable/>
</template>
</el-table-column>
<el-table-column :label="$t('test_track.plan_view.step_result')" min-width="12%">
@ -216,7 +228,7 @@
width="400"
trigger="hover"
>
<ckeditor :editor="editor" disabled
<ckeditor :editor="editor" disabled :config="readConfig"
v-model="scope.row.description"/>
<el-button slot="reference" type="text">{{$t('test_track.issue.preview')}}</el-button>
</el-popover>
@ -300,9 +312,10 @@
// 'increaseIndent','decreaseIndent'
toolbar: ['heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'insertTable', '|', 'undo', 'redo'],
},
readConfig: {toolbar: []},
test: {},
activeTab: 'detail',
isFailure: false,
isFailure: true,
};
},
props: {
@ -480,7 +493,7 @@
stepResultChange() {
if (this.testCase.method == 'manual') {
this.isFailure = this.testCase.steptResults.filter(s => {
return !s.executeResult || s.executeResult === 'Failure' || s.executeResult === 'Blocking';
return s.executeResult === 'Failure' || s.executeResult === 'Blocking';
}).length > 0;
}
@ -520,17 +533,10 @@
<style scoped>
.tb-edit .el-textarea {
display: none;
}
.tb-edit .current-row .el-textarea {
display: block;
}
.tb-edit .current-row .el-textarea + pre {
display: none;
.border-hidden >>> .el-textarea__inner {
border-style: hidden;
background-color: white;
color: #606266;
}
.cast_label {

View File

@ -121,7 +121,7 @@
width="400"
trigger="hover"
>
<ckeditor :editor="editor" disabled
<ckeditor :editor="editor" disabled :config="editorConfig"
v-model="scope.row.description"/>
<el-button slot="reference" type="text">{{$t('test_track.issue.preview')}}</el-button>
</el-popover>
@ -313,6 +313,10 @@
]
},
editor: ClassicEditor,
editorConfig: {
// 'increaseIndent','decreaseIndent'
toolbar: [],
},
}
},
props: {

View File

@ -75,3 +75,22 @@ body {
background-color: #EBEEF5;
}
/* 表格拖拽表头调整宽度 --> */
/* <-- 表格 input 编辑效果*/
.table-edit-input .el-textarea__inner {
border-style: hidden;
}
.table-edit-input.is-disabled .el-textarea__inner {
background-color: white;
color: #606266;
}
.el-table .current-row .table-edit-input {
border: 1px solid #DCDFE6;
border-radius: 5px;
}
.table-edit-input .el-textarea__inner:focus {
border: 1px solid #409EFF;
}
/* 表格 input 编辑效果 --> */