From 67084bf5da9aa63292f5b8f23ea75fa7d156b375 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 12 Mar 2021 14:00:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?style(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E6=AD=A5=E9=AA=A4=E7=BB=84=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scenario/component/ApiComponent.vue | 28 ++++++++++++++----- .../component/ApiScenarioComponent.vue | 13 +++++---- .../scenario/component/IfController.vue | 14 ++++++++-- .../scenario/component/LoopController.vue | 21 -------------- 4 files changed, 41 insertions(+), 35 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue index 9fdaf70c4a..368ef166ae 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue @@ -12,10 +12,10 @@ :title="displayTitle"> @@ -26,6 +26,7 @@ diff --git a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue index b52464f9ce..99cf8699fd 100644 --- a/frontend/src/business/components/api/automation/scenario/component/LoopController.vue +++ b/frontend/src/business/components/api/automation/scenario/component/LoopController.vue @@ -69,7 +69,6 @@
- @@ -79,18 +78,6 @@ ms
- - - - - - - - - - - - @@ -344,14 +331,6 @@ export default { font-weight: normal; } - .tip { - padding: 3px 5px; - font-size: 16px; - border-radius: 4px; - border-left: 4px solid #783887; - margin: 20px 0; - } - .icon.is-active { transform: rotate(90deg); } From 759da73dd55f9000b4e6ab755cce2ca2c581588f Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 12 Mar 2021 17:14:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E8=A7=84=E8=8C=83=20=E6=8F=90=E5=8F=96=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=92=8C=20=E6=96=AD=E8=A8=80=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../definition/request/assertions/MsAssertions.java | 12 ++++++------ .../dto/definition/request/extract/MsExtract.java | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/MsAssertions.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/MsAssertions.java index 1a4de305d3..8197028c78 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/MsAssertions.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/assertions/MsAssertions.java @@ -63,7 +63,7 @@ public class MsAssertions extends MsTestElement { private ResponseAssertion responseAssertion(MsAssertionRegex assertionRegex) { ResponseAssertion assertion = new ResponseAssertion(); assertion.setEnabled(this.isEnable()); - assertion.setName(assertionRegex.getDescription()); + assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : assertionRegex.getDescription()); assertion.setProperty(TestElement.TEST_CLASS, ResponseAssertion.class.getName()); assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("AssertionGui")); assertion.setAssumeSuccess(assertionRegex.isAssumeSuccess()); @@ -88,7 +88,7 @@ public class MsAssertions extends MsTestElement { private JSONPathAssertion jsonPathAssertion(MsAssertionJsonPath assertionJsonPath) { JSONPathAssertion assertion = new JSONPathAssertion(); assertion.setEnabled(this.isEnable()); - assertion.setName(StringUtils.isEmpty(assertionJsonPath.getDescription()) ? "JSONPathAssertion" : assertionJsonPath.getDescription()); + assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "JSONPathAssertion"); assertion.setProperty(TestElement.TEST_CLASS, JSONPathAssertion.class.getName()); assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("JSONPathAssertionGui")); assertion.setJsonPath(assertionJsonPath.getExpression()); @@ -96,7 +96,7 @@ public class MsAssertions extends MsTestElement { assertion.setJsonValidationBool(true); assertion.setExpectNull(false); assertion.setInvert(false); - assertion.setProperty("ASS_OPTION",assertionJsonPath.getOption()); + assertion.setProperty("ASS_OPTION", assertionJsonPath.getOption()); if (StringUtils.isEmpty(assertionJsonPath.getOption()) || "REGEX".equals(assertionJsonPath.getOption())) { assertion.setIsRegex(true); } else { @@ -108,7 +108,7 @@ public class MsAssertions extends MsTestElement { private XPath2Assertion xPath2Assertion(MsAssertionXPath2 assertionXPath2) { XPath2Assertion assertion = new XPath2Assertion(); assertion.setEnabled(this.isEnable()); - assertion.setName(StringUtils.isEmpty(assertionXPath2.getExpression()) ? "XPath2Assertion" : assertionXPath2.getExpression()); + assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "XPath2Assertion"); assertion.setProperty(TestElement.TEST_CLASS, XPath2Assertion.class.getName()); assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("XPath2AssertionGui")); assertion.setXPathString(assertionXPath2.getExpression()); @@ -119,7 +119,7 @@ public class MsAssertions extends MsTestElement { private DurationAssertion durationAssertion(MsAssertionDuration assertionDuration) { DurationAssertion assertion = new DurationAssertion(); assertion.setEnabled(this.isEnable()); - assertion.setName("Response In Time: " + assertionDuration.getValue()); + assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "Response In Time: " + assertionDuration.getValue()); assertion.setProperty(TestElement.TEST_CLASS, DurationAssertion.class.getName()); assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("DurationAssertionGui")); assertion.setAllowedDuration(assertionDuration.getValue()); @@ -129,7 +129,7 @@ public class MsAssertions extends MsTestElement { private JSR223Assertion jsr223Assertion(MsAssertionJSR223 assertionJSR223) { JSR223Assertion assertion = new JSR223Assertion(); assertion.setEnabled(this.isEnable()); - assertion.setName(StringUtils.isEmpty(assertionJSR223.getDesc()) ? "JSR223Assertion" : assertionJSR223.getDesc()); + assertion.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : "JSR223Assertion"); assertion.setProperty(TestElement.TEST_CLASS, JSR223Assertion.class.getName()); assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI")); assertion.setProperty("cacheKey", "true"); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java index ab0336aa2a..45b6051347 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java @@ -66,7 +66,7 @@ public class MsExtract extends MsTestElement { RegexExtractor extractor = new RegexExtractor(); extractor.setEnabled(this.isEnable()); - extractor.setName(extractRegex.getVariable() + " RegexExtractor"); + extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " RegexExtractor"); extractor.setProperty(TestElement.TEST_CLASS, RegexExtractor.class.getName()); extractor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("RegexExtractorGui")); extractor.setRefName(extractRegex.getVariable()); @@ -84,7 +84,7 @@ public class MsExtract extends MsTestElement { private XPath2Extractor xPath2Extractor(MsExtractXPath extractXPath, StringJoiner extract) { XPath2Extractor extractor = new XPath2Extractor(); extractor.setEnabled(this.isEnable()); - extractor.setName(extractXPath.getVariable() + " XPath2Extractor"); + extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " XPath2Extractor"); extractor.setProperty(TestElement.TEST_CLASS, XPath2Extractor.class.getName()); extractor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("XPath2ExtractorGui")); extractor.setRefName(extractXPath.getVariable()); @@ -99,7 +99,7 @@ public class MsExtract extends MsTestElement { private JSONPostProcessor jsonPostProcessor(MsExtractJSONPath extractJSONPath, StringJoiner extract) { JSONPostProcessor extractor = new JSONPostProcessor(); extractor.setEnabled(this.isEnable()); - extractor.setName(extractJSONPath.getVariable() + " JSONExtractor"); + extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " JSONExtractor"); extractor.setProperty(TestElement.TEST_CLASS, JSONPostProcessor.class.getName()); extractor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("JSONPostProcessorGui")); extractor.setRefNames(extractJSONPath.getVariable()); From 170d811c14ddaea6a575e0841a355c623115a1e5 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 12 Mar 2021 18:12:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):?= =?UTF-8?q?=20=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/service/ApiDefinitionService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index d00a76323a..a73d6f1c6c 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -198,7 +198,7 @@ public class ApiDefinitionService { .andProtocolEqualTo(request.getProtocol()).andPathEqualTo(request.getPath()) .andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId()); Project project = projectMapper.selectByPrimaryKey(request.getProjectId()); - if (apiDefinitionMapper.countByExample(example) > 0 && (project.getRepeatable() == null || !project.getRepeatable())) { + if (apiDefinitionMapper.countByExample(example) > 0 && (project == null || project.getRepeatable() == null || !project.getRepeatable())) { MSException.throwException(Translator.get("api_definition_url_not_repeating")); } } else {