From 09683f754213e18ef28b2d340ddda0ad838ebc89 Mon Sep 17 00:00:00 2001 From: Timon Borter Date: Tue, 15 Oct 2024 22:39:52 +0200 Subject: [PATCH] feat: optionally include all message headers in scenario execution response --- .../ScenarioExecutionRepository.java | 2 +- .../web/rest/ScenarioExecutionResource.java | 27 +- .../simulator/TechnicalStructureTest.java | 2 +- .../web/rest/ScenarioExecutionResourceIT.java | 1 + .../rest/ScenarioExecutionResourceTest.java | 148 +++++++++ .../web/rest/ScenarioResourceTest.java | 7 +- simulator-ui/package-lock.json | 283 ++++++++++++++---- simulator-ui/package.json | 2 +- .../service/scenario-execution.service.ts | 5 +- 9 files changed, 406 insertions(+), 71 deletions(-) create mode 100644 simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResourceTest.java diff --git a/simulator-spring-boot/src/main/java/org/citrusframework/simulator/repository/ScenarioExecutionRepository.java b/simulator-spring-boot/src/main/java/org/citrusframework/simulator/repository/ScenarioExecutionRepository.java index f9e5928b8..4bf41e7a0 100644 --- a/simulator-spring-boot/src/main/java/org/citrusframework/simulator/repository/ScenarioExecutionRepository.java +++ b/simulator-spring-boot/src/main/java/org/citrusframework/simulator/repository/ScenarioExecutionRepository.java @@ -43,6 +43,6 @@ public interface ScenarioExecutionRepository extends JpaRepository findOneByExecutionId(@Param("executionId") Long executionId); @Query("FROM ScenarioExecution WHERE executionId IN :scenarioExecutionIds") - @EntityGraph(attributePaths = {"testResult", "scenarioParameters", "scenarioActions", "scenarioMessages"}) + @EntityGraph(attributePaths = {"testResult", "scenarioParameters", "scenarioActions", "scenarioMessages", "scenarioMessages.headers"}) Page findAllWhereExecutionIdIn(@Param("scenarioExecutionIds") List scenarioExecutionIds, Pageable pageable); } diff --git a/simulator-spring-boot/src/main/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResource.java b/simulator-spring-boot/src/main/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResource.java index 6430e799c..53777a92d 100644 --- a/simulator-spring-boot/src/main/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResource.java +++ b/simulator-spring-boot/src/main/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResource.java @@ -34,12 +34,15 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import java.util.List; import java.util.Optional; +import static java.lang.Boolean.FALSE; + /** * REST controller for managing {@link ScenarioExecution}. */ @@ -56,7 +59,8 @@ public class ScenarioExecutionResource { public ScenarioExecutionResource( ScenarioExecutionService scenarioExecutionService, - ScenarioExecutionQueryService scenarioExecutionQueryService, ScenarioExecutionMapper scenarioExecutionMapper + ScenarioExecutionQueryService scenarioExecutionQueryService, + ScenarioExecutionMapper scenarioExecutionMapper ) { this.scenarioExecutionService = scenarioExecutionService; this.scenarioExecutionQueryService = scenarioExecutionQueryService; @@ -71,10 +75,17 @@ public ScenarioExecutionResource( * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of scenarioExecutions in body. */ @GetMapping("/scenario-executions") - public ResponseEntity> getAllScenarioExecutions(ScenarioExecutionCriteria criteria, @ParameterObject Pageable pageable) { + public ResponseEntity> getAllScenarioExecutions( + ScenarioExecutionCriteria criteria, + @RequestParam(name = "includeActions", required = false, defaultValue = "false") Boolean includeActions, + @RequestParam(name = "includeMessages", required = false, defaultValue = "false") Boolean includeMessages, + @RequestParam(name = "includeParameters", required = false, defaultValue = "false") Boolean includeParameters, + @ParameterObject Pageable pageable + ) { logger.debug("REST request to get ScenarioExecutions by criteria: {}", criteria); Page page = scenarioExecutionQueryService.findByCriteria(criteria, pageable); + stripPageContents(page, includeActions, includeMessages, includeParameters); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page); return ResponseEntity.ok().headers(headers).body(page.getContent().stream().map(scenarioExecutionMapper::toDto).toList()); } @@ -103,4 +114,16 @@ public ResponseEntity getScenarioExecution(@PathVariable(" Optional scenarioExecution = scenarioExecutionService.findOne(id); return ResponseUtil.wrapOrNotFound(scenarioExecution.map(scenarioExecutionMapper::toDto)); } + + private void stripPageContents(Page page, Boolean includeActions, Boolean includeMessages, Boolean includeParameters) { + if (FALSE.equals(includeActions)) { + page.getContent().forEach(scenarioExecution -> scenarioExecution.getScenarioActions().clear()); + } + if (FALSE.equals(includeMessages)) { + page.getContent().forEach(scenarioExecution -> scenarioExecution.getScenarioMessages().clear()); + } + if (FALSE.equals(includeParameters)) { + page.getContent().forEach(scenarioExecution -> scenarioExecution.getScenarioParameters().clear()); + } + } } diff --git a/simulator-spring-boot/src/test/java/org/citrusframework/simulator/TechnicalStructureTest.java b/simulator-spring-boot/src/test/java/org/citrusframework/simulator/TechnicalStructureTest.java index 61f7eea65..256f308eb 100644 --- a/simulator-spring-boot/src/test/java/org/citrusframework/simulator/TechnicalStructureTest.java +++ b/simulator-spring-boot/src/test/java/org/citrusframework/simulator/TechnicalStructureTest.java @@ -40,5 +40,5 @@ public class TechnicalStructureTest { .layer("Scenario").definedBy("..scenario..") .whereLayer("Web").mayOnlyBeAccessedByLayers("Config") - .whereLayer("Domain").mayOnlyBeAccessedByLayers("Config", "DTO", "Service", "Persistence", "Endpoint", "Listener", "Scenario"); + .whereLayer("Domain").mayOnlyBeAccessedByLayers("Config", "DTO", "Service", "Persistence", "Endpoint", "Listener", "Scenario", "Web"); } diff --git a/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResourceIT.java b/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResourceIT.java index 89081b492..ba05af335 100644 --- a/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResourceIT.java +++ b/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResourceIT.java @@ -560,6 +560,7 @@ void getNonExistingScenarioExecution() throws Exception { @Nested class CorrectTimeOnScenarioExecution { + public static final TemporalUnitLessThanOffset LESS_THAN_5_SECONDS = new TemporalUnitLessThanOffset(5, SECONDS); @Autowired diff --git a/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResourceTest.java b/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResourceTest.java new file mode 100644 index 000000000..79e8109b4 --- /dev/null +++ b/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioExecutionResourceTest.java @@ -0,0 +1,148 @@ +/* + * Copyright the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.citrusframework.simulator.web.rest; + +import org.citrusframework.simulator.model.Message; +import org.citrusframework.simulator.model.ScenarioAction; +import org.citrusframework.simulator.model.ScenarioExecution; +import org.citrusframework.simulator.model.ScenarioParameter; +import org.citrusframework.simulator.service.ScenarioExecutionQueryService; +import org.citrusframework.simulator.service.ScenarioExecutionService; +import org.citrusframework.simulator.service.criteria.ScenarioExecutionCriteria; +import org.citrusframework.simulator.web.rest.dto.ScenarioExecutionDTO; +import org.citrusframework.simulator.web.rest.dto.mapper.ScenarioExecutionMapper; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.Pageable; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import static java.lang.Boolean.FALSE; +import static java.lang.Boolean.TRUE; +import static java.util.Collections.singletonList; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.springframework.http.HttpStatus.OK; + +@ExtendWith({MockitoExtension.class}) +class ScenarioExecutionResourceTest { + + @Mock + private ScenarioExecutionService scenarioExecutionServiceMock; + + @Mock + private ScenarioExecutionQueryService scenarioExecutionQueryServiceMock; + + @Mock + private ScenarioExecutionMapper scenarioExecutionMapperMock; + + private ScenarioExecutionResource fixture; + + @BeforeEach + void beforeEachSetup() { + fixture = new ScenarioExecutionResource(scenarioExecutionServiceMock, scenarioExecutionQueryServiceMock, scenarioExecutionMapperMock); + } + + @Nested + class GetAllScenarioExecutions { + + @Mock + private ScenarioExecutionCriteria criteriaMock; + + @Mock + private Pageable pageableMock; + + @Mock + private ScenarioExecutionDTO scenarioExecutionDTOMock; + + private ScenarioExecution scenarioExecution; + + @BeforeEach + void beforeEachSetup() { + var request = new MockHttpServletRequest(); + RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request)); + + scenarioExecution = new ScenarioExecution(); + scenarioExecution.getScenarioActions().add(mock(ScenarioAction.class)); + scenarioExecution.getScenarioMessages().add(mock(Message.class)); + scenarioExecution.getScenarioParameters().add(mock(ScenarioParameter.class)); + + var scenarioExecutions = new PageImpl<>(singletonList(scenarioExecution)); + doReturn(scenarioExecutions).when(scenarioExecutionQueryServiceMock).findByCriteria(criteriaMock, pageableMock); + + doReturn(scenarioExecutionDTOMock).when(scenarioExecutionMapperMock).toDto(scenarioExecution); + } + + @Test + void stripsIncludedActions() { + var response = fixture.getAllScenarioExecutions(criteriaMock, FALSE, TRUE, TRUE, pageableMock); + + assertThat(response) + .satisfies( + r -> assertThat(r.getStatusCode()).isEqualTo(OK), + r -> assertThat(r.getBody()) + .singleElement() + .isEqualTo(scenarioExecutionDTOMock) + ); + + assertThat(scenarioExecution.getScenarioActions()).isEmpty(); + assertThat(scenarioExecution.getScenarioMessages()).isNotEmpty(); + assertThat(scenarioExecution.getScenarioParameters()).isNotEmpty(); + } + + @Test + void stripsIncludedMessages() { + var response = fixture.getAllScenarioExecutions(criteriaMock, TRUE, FALSE, TRUE, pageableMock); + + assertThat(response) + .satisfies( + r -> assertThat(r.getStatusCode()).isEqualTo(OK), + r -> assertThat(r.getBody()) + .singleElement() + .isEqualTo(scenarioExecutionDTOMock) + ); + + assertThat(scenarioExecution.getScenarioActions()).isNotEmpty(); + assertThat(scenarioExecution.getScenarioMessages()).isEmpty(); + assertThat(scenarioExecution.getScenarioParameters()).isNotEmpty(); + } + + @Test + void stripsIncludedParameters() { + var response = fixture.getAllScenarioExecutions(criteriaMock, TRUE, TRUE, FALSE, pageableMock); + + assertThat(response) + .satisfies( + r -> assertThat(r.getStatusCode()).isEqualTo(OK), + r -> assertThat(r.getBody()) + .singleElement() + .isEqualTo(scenarioExecutionDTOMock) + ); + + assertThat(scenarioExecution.getScenarioActions()).isNotEmpty(); + assertThat(scenarioExecution.getScenarioMessages()).isNotEmpty(); + assertThat(scenarioExecution.getScenarioParameters()).isEmpty(); + } + } +} diff --git a/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioResourceTest.java b/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioResourceTest.java index 5493d8324..eee032cf7 100644 --- a/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioResourceTest.java +++ b/simulator-spring-boot/src/test/java/org/citrusframework/simulator/web/rest/ScenarioResourceTest.java @@ -42,6 +42,7 @@ import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.InstanceOfAssertFactories.LIST; import static org.assertj.core.api.InstanceOfAssertFactories.type; import static org.citrusframework.simulator.web.rest.ScenarioResource.Scenario.ScenarioType.STARTER; import static org.junit.jupiter.params.provider.Arguments.arguments; @@ -122,7 +123,7 @@ void doesFilterCacheWithNameContains(String filterLetter, String expectedScenari assertThat(result) .extracting(ResponseEntity::getBody) - .asList() + .asInstanceOf(LIST) .hasSize(1) .first() .asInstanceOf(type(Scenario.class)) @@ -141,7 +142,7 @@ void doesFilterCacheWithNameStartsOrEndsWith() { assertThat(result) .extracting(ResponseEntity::getBody) - .asList() + .asInstanceOf(LIST) .hasSize(2) .noneSatisfy(scenario -> assertThat(scenario) @@ -161,7 +162,7 @@ void doesNotFilterCacheWithoutNameContains() { assertThat(result) .extracting(ResponseEntity::getBody) - .asList() + .asInstanceOf(LIST) .isEqualTo(SCENARIO_CACHE); } diff --git a/simulator-ui/package-lock.json b/simulator-ui/package-lock.json index c5eb152d4..791b2da87 100644 --- a/simulator-ui/package-lock.json +++ b/simulator-ui/package-lock.json @@ -54,7 +54,7 @@ "buffer": "6.0.3", "concurrently": "9.0.1", "copy-webpack-plugin": "12.0.2", - "eslint": "9.12.0", + "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", "eslint-webpack-plugin": "4.2.0", "folder-hash": "4.0.4", @@ -2948,16 +2948,6 @@ "node": "*" } }, - "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, "node_modules/@eslint/eslintrc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", @@ -3044,13 +3034,13 @@ } }, "node_modules/@eslint/js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, "license": "MIT", "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@eslint/object-schema": { @@ -3151,28 +3141,44 @@ "node": ">=6" } }, - "node_modules/@humanfs/core": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz", - "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==", + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", "dev": true, "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, "engines": { - "node": ">=18.18.0" + "node": ">=10.10.0" } }, - "node_modules/@humanfs/node": { - "version": "0.16.5", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz", - "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==", + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "license": "Apache-2.0", + "license": "MIT", "dependencies": { - "@humanfs/core": "^0.19.0", - "@humanwhocodes/retry": "^0.3.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=18.18.0" + "node": "*" } }, "node_modules/@humanwhocodes/module-importer": { @@ -3189,6 +3195,14 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true, + "license": "BSD-3-Clause" + }, "node_modules/@humanwhocodes/retry": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", @@ -6329,6 +6343,13 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true, + "license": "ISC" + }, "node_modules/@vitejs/plugin-basic-ssl": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-basic-ssl/-/plugin-basic-ssl-1.1.0.tgz", @@ -10627,64 +10648,60 @@ } }, "node_modules/eslint": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.11.0", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.12.0", - "@eslint/plugin-kit": "^0.2.0", - "@humanfs/node": "^0.16.5", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.1", - "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", + "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.1.0", - "eslint-visitor-keys": "^4.1.0", - "espree": "^10.2.0", - "esquery": "^1.5.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", + "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-config-prettier": { @@ -10818,6 +10835,30 @@ "webpack": "^5.0.0" } }, + "node_modules/eslint/node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -10912,19 +10953,107 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz", - "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==", + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, - "license": "Apache-2.0", + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/eslint/node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/eslint/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -10955,6 +11084,23 @@ "node": "*" } }, + "node_modules/eslint/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -10968,6 +11114,19 @@ "node": ">=8" } }, + "node_modules/eslint/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/espree": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz", diff --git a/simulator-ui/package.json b/simulator-ui/package.json index 9be854de4..cd8de9c5f 100644 --- a/simulator-ui/package.json +++ b/simulator-ui/package.json @@ -83,7 +83,7 @@ "buffer": "6.0.3", "concurrently": "9.0.1", "copy-webpack-plugin": "12.0.2", - "eslint": "9.12.0", + "eslint": "8.57.1", "eslint-config-prettier": "9.1.0", "eslint-webpack-plugin": "4.2.0", "folder-hash": "4.0.4", diff --git a/simulator-ui/src/main/webapp/app/entities/scenario-execution/service/scenario-execution.service.ts b/simulator-ui/src/main/webapp/app/entities/scenario-execution/service/scenario-execution.service.ts index 206ad3c18..6a6208c7a 100644 --- a/simulator-ui/src/main/webapp/app/entities/scenario-execution/service/scenario-execution.service.ts +++ b/simulator-ui/src/main/webapp/app/entities/scenario-execution/service/scenario-execution.service.ts @@ -36,8 +36,11 @@ export class ScenarioExecutionService { .pipe(map(res => this.convertResponseFromServer(res))); } - query(req?: any): Observable { + query( + req?: any, + ): Observable { const options = createRequestOption(req); + return this.http .get(this.resourceUrl, { params: options, observe: 'response' }) .pipe(map(res => this.convertResponseArrayFromServer(res)));