diff --git a/docs/modules/onecx-theme-svc/pages/onecx-theme-svc-extensions.adoc b/docs/modules/onecx-theme-svc/pages/onecx-theme-svc-extensions.adoc index 8d698e0..e008857 100644 --- a/docs/modules/onecx-theme-svc/pages/onecx-theme-svc-extensions.adoc +++ b/docs/modules/onecx-theme-svc/pages/onecx-theme-svc-extensions.adoc @@ -12,158 +12,158 @@ h| Version | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-core.html[Link] | -| 0.26.0 +| 0.34.0 | onecx-tenant | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-tenant.html[Link] -| https://github.com/onecx/onecx-quarkus/blob/0.26.0/docs/modules/onecx-quarkus/pages/includes/onecx-tenant.adoc[Link] -| 0.26.0 +| https://github.com/onecx/onecx-quarkus/blob/0.34.0/docs/modules/onecx-quarkus/pages/includes/onecx-tenant.adoc[Link] +| 0.34.0 | tkit-quarkus-rest-context | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest-context.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link] -| 2.31.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link] +| 2.36.0 | tkit-quarkus-jpa-tenant | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-jpa-tenant.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa-tenant.adoc[Link] -| 2.31.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa-tenant.adoc[Link] +| 2.36.0 | tkit-quarkus-data-import | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-data-import.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-data-import.adoc[Link] -| 2.31.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-data-import.adoc[Link] +| 2.36.0 | tkit-quarkus-jpa | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-jpa.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link] -| 2.31.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link] +| 2.36.0 | tkit-quarkus-log-cdi | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-cdi.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link] -| 2.31.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link] +| 2.36.0 | tkit-quarkus-log-rs | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-rs.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link] -| 2.31.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link] +| 2.36.0 | tkit-quarkus-log-json | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-json.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link] -| 2.31.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link] +| 2.36.0 | tkit-quarkus-rest | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link] -| 2.31.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link] +| 2.36.0 | quarkus-oidc | https://quarkus.io/guides/security-oidc-bearer-token-authentication-tutorial[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-oidc.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-arc | https://quarkus.io/guides/cdi-reference[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-arc.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-liquibase | https://quarkus.io/guides/liquibase[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-liquibase.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-smallrye-health | https://quarkus.io/guides/smallrye-health[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-health.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-micrometer-registry-prometheus | https://quarkus.io/guides/telemetry-micrometer[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-micrometer-registry-prometheus.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-hibernate-orm | https://quarkus.io/guides/hibernate-orm[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-hibernate-orm.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-rest | https://quarkus.io/guides/rest[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-rest.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-rest-jackson | https://quarkus.io/guides/rest-json[Link] | -| 3.13.2 +| 3.15.1 | quarkus-jdbc-postgresql | https://quarkus.io/guides/datasource[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-jdbc-postgresql.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-smallrye-openapi | https://quarkus.io/guides/openapi-swaggerui[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-smallrye-openapi.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-hibernate-validator | https://quarkus.io/guides/validation[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-hibernate-validator.adoc[Link] -| 3.13.2 +| 3.15.1 | quarkus-opentelemetry | https://quarkus.io/guides/opentelemetry[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-opentelemetry.adoc[Link] -| 3.13.2 +| 3.15.1 | tkit-quarkus-security | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-security.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.31.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link] -| 2.31.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.36.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link] +| 2.36.0 | quarkus-container-image-docker | https://quarkus.io/guides/container-image[Link] | https://github.com/quarkusio/quarkusio.github.io/blob/develop/_generated-doc/latest/config/quarkus-container-image-docker.adoc[Link] -| 3.13.2 +| 3.15.1 | onecx-security | | -| 0.26.0 +| 0.34.0 | quarkus-smallrye-context-propagation | | -| 3.13.2 +| 3.15.1 |=== \ No newline at end of file diff --git a/src/main/java/org/tkit/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java b/src/main/java/org/tkit/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java index eee4655..2e7e59b 100644 --- a/src/main/java/org/tkit/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java +++ b/src/main/java/org/tkit/onecx/theme/rs/exim/v1/mappers/ExportImportMapperV1.java @@ -128,6 +128,7 @@ Map> createImages(List images) { @Mapping(target = "tenantId", ignore = true) @Mapping(target = "operator", ignore = true) @Mapping(target = "properties", qualifiedByName = "properties") + @Mapping(target = "displayName", source = "dto.displayName", defaultExpression = "java(name)") public abstract Theme create(String name, EximThemeDTOV1 dto); @Named("properties") diff --git a/src/main/resources/import/template.json b/src/main/resources/import/template.json index 8af2609..edc4e73 100644 --- a/src/main/resources/import/template.json +++ b/src/main/resources/import/template.json @@ -1,6 +1,7 @@ { "themes": { "OneCX": { + "displayName": "OneCX Theme", "cssFile": null, "description": "OneCX Theme", "assetsUrl": null, diff --git a/src/test/java/org/tkit/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1Test.java b/src/test/java/org/tkit/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1Test.java index 1b92bc9..49955a4 100644 --- a/src/test/java/org/tkit/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1Test.java +++ b/src/test/java/org/tkit/onecx/theme/rs/exim/v1/controllers/ExportImportRestControllerV1Test.java @@ -158,6 +158,58 @@ void importThemesTest() { from(ImportThemeResponseStatusDTOV1::toString)); } + @Test + void importThemeWithoutDisplayNameTest() { + + var request = new ThemeSnapshotDTOV1(); + + var data = given() + .auth().oauth2(getKeycloakClientToken("testClient")) + .when() + .contentType(APPLICATION_JSON) + .body(request) + .post("export") + .then() + .statusCode(OK.getStatusCode()) + .extract().as(ThemeSnapshotDTOV1.class); + assertThat(data).isNotNull(); + assertThat(data.getThemes()).hasSize(3); + + var importTheme = new EximThemeDTOV1(); + importTheme.setDescription("new theme description"); + importTheme.putImagesItem("logo", new ImageDTOV1().imageData(new byte[] { 1, 2, 3 }).mimeType("image/*")); + importTheme.putImagesItem("logo2", new ImageDTOV1().imageData(new byte[] { 1, 2, 3 }).mimeType("image/*")); + data.getThemes().put("themeWithoutDisplayName", importTheme); + + var dto = given() + .auth().oauth2(getKeycloakClientToken("testClient")) + .when() + .contentType(APPLICATION_JSON) + .body(data) + .post("import") + .then() + .statusCode(OK.getStatusCode()) + .extract().as(ImportThemeResponseDTOV1.class); + + assertThat(dto).isNotNull().returns(data.getId(), from(ImportThemeResponseDTOV1::getId)); + + //check if fallback displayname was used + var exportResponse = given() + .auth().oauth2(getKeycloakClientToken("testClient")) + .when() + .contentType(APPLICATION_JSON) + .body(request) + .post("export") + .then() + .statusCode(OK.getStatusCode()) + .extract().as(ThemeSnapshotDTOV1.class); + + assertThat(exportResponse).isNotNull(); + assertThat(exportResponse.getThemes()).hasSize(4); + assertThat(exportResponse.getThemes().get("themeWithoutDisplayName").getDisplayName()) + .isEqualTo("themeWithoutDisplayName"); + } + @Test void importOperatorThemesTest() { diff --git a/src/test/resources/import/theme-import.json b/src/test/resources/import/theme-import.json index d0676aa..a45f545 100644 --- a/src/test/resources/import/theme-import.json +++ b/src/test/resources/import/theme-import.json @@ -1,6 +1,7 @@ { "themes": { "Theme1": { + "displayName": "Theme 1", "description": "Theme1 basic color scheme", "properties": { "topbar": { @@ -50,6 +51,7 @@ } }, "Theme2": { + "diplayName": "Theme 2", "description": "Theme2 theme", "properties": { "topbar": { @@ -100,6 +102,7 @@ } }, "Theme3": { + "displayName": "Theme 3", "description": "Theme3 basic color scheme", "properties": { "topbar": {