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