diff --git a/backend/src/main/java/ch/puzzle/okr/dto/ClientConfigDto.java b/backend/src/main/java/ch/puzzle/okr/dto/ClientConfigDto.java index 702a4de5c4..667b82fd6f 100644 --- a/backend/src/main/java/ch/puzzle/okr/dto/ClientConfigDto.java +++ b/backend/src/main/java/ch/puzzle/okr/dto/ClientConfigDto.java @@ -3,5 +3,5 @@ import java.util.Map; public record ClientConfigDto(String activeProfile, String issuer, String clientId, String favicon, String logo, - String triangles, String backgroundLogo, String title, Map customStyles) { + String triangles, String backgroundLogo, String title, String helpSiteUrl, Map customStyles) { } diff --git a/backend/src/main/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomization.java b/backend/src/main/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomization.java index b7dc7e004f..7a45808c0f 100644 --- a/backend/src/main/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomization.java +++ b/backend/src/main/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomization.java @@ -3,5 +3,5 @@ import java.util.Map; public record TenantClientCustomization(String favicon, String logo, String triangles, String backgroundLogo, - String title, Map customStyles) { + String title, String helpSiteUrl, Map customStyles) { } diff --git a/backend/src/main/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomizationProvider.java b/backend/src/main/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomizationProvider.java index 2c74a9ae07..0085cedd8c 100644 --- a/backend/src/main/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomizationProvider.java +++ b/backend/src/main/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomizationProvider.java @@ -39,6 +39,7 @@ private TenantClientCustomization readClientCustomizationConfig(String tenantId) env.getProperty(MessageFormat.format("okr.tenants.{0}.clientcustomization.triangles", tenantId)), env.getProperty(MessageFormat.format("okr.tenants.{0}.clientcustomization.background-logo", tenantId)), env.getProperty(MessageFormat.format("okr.tenants.{0}.clientcustomization.title", tenantId)), + env.getProperty(MessageFormat.format("okr.tenants.{0}.clientcustomization.helpSiteUrl", tenantId)), getCustomCssStyles(tenantId) // ); } diff --git a/backend/src/main/java/ch/puzzle/okr/service/clientconfig/ClientConfigService.java b/backend/src/main/java/ch/puzzle/okr/service/clientconfig/ClientConfigService.java index 16f4c1c4da..0b83fd2f4a 100644 --- a/backend/src/main/java/ch/puzzle/okr/service/clientconfig/ClientConfigService.java +++ b/backend/src/main/java/ch/puzzle/okr/service/clientconfig/ClientConfigService.java @@ -57,6 +57,7 @@ public ClientConfigDto getConfigBasedOnActiveEnv(String hostName) { tenantClientCustomization.get().triangles(), // tenantClientCustomization.get().backgroundLogo(), // tenantClientCustomization.get().title(), // + tenantClientCustomization.get().helpSiteUrl(), // tenantClientCustomization.get().customStyles()); // } diff --git a/backend/src/main/resources/application-dev.properties b/backend/src/main/resources/application-dev.properties index b995d8a397..cf08aa4a18 100644 --- a/backend/src/main/resources/application-dev.properties +++ b/backend/src/main/resources/application-dev.properties @@ -48,6 +48,7 @@ okr.tenants.pitc.clientcustomization.triangles=assets/images/triangles-okr-heade okr.tenants.pitc.clientcustomization.background-logo=assets/images/puzzle-p.svg okr.tenants.pitc.clientcustomization.favicon=assets/favicon.png okr.tenants.pitc.clientcustomization.title=Puzzle OKR +okr.tenants.pitc.clientcustomization.helpSiteUrl=https://wiki.puzzle.ch/Puzzle/OKRs okr.tenants.pitc.clientcustomization.customstyles.okr-topbar-background-color=#1e5a96 okr.tenants.pitc.clientcustomization.customstyles.okr-banner-background-color=#dcedf9 @@ -57,5 +58,6 @@ okr.tenants.acme.clientcustomization.triangles=assets/images/triangles-okr-acme- okr.tenants.acme.clientcustomization.background-logo=assets/images/acme.svg okr.tenants.acme.clientcustomization.favicon=assets/favicon-acme.png okr.tenants.acme.clientcustomization.title=ACME OKR +okr.tenants.acme.clientcustomization.helpSiteUrl=https://en.wikipedia.org/wiki/Objectives_and_key_results okr.tenants.acme.clientcustomization.customstyles.okr-topbar-background-color=#738290 okr.tenants.acme.clientcustomization.customstyles.okr-banner-background-color=#F2F2F2 diff --git a/backend/src/main/resources/application-integration-test.properties b/backend/src/main/resources/application-integration-test.properties index 44769ffd8a..dc38d2b59d 100644 --- a/backend/src/main/resources/application-integration-test.properties +++ b/backend/src/main/resources/application-integration-test.properties @@ -51,6 +51,7 @@ okr.tenants.pitc.clientcustomization.triangles=assets/images/triangles-okr-heade okr.tenants.pitc.clientcustomization.background-logo=assets/images/puzzle-p.svg okr.tenants.pitc.clientcustomization.favicon=assets/favicon.png okr.tenants.pitc.clientcustomization.title=Puzzle OKR +okr.tenants.pitc.clientcustomization.helpSiteUrl=https://wiki.puzzle.ch/Puzzle/OKRs okr.tenants.pitc.clientcustomization.customstyles.okr-topbar-background-color=#1e5a96 # acme client customization @@ -59,4 +60,5 @@ okr.tenants.acme.clientcustomization.triangles=assets/images/triangles-okr-acme- okr.tenants.acme.clientcustomization.background-logo=assets/images/acme.svg okr.tenants.acme.clientcustomization.favicon=assets/favicon-acme.png okr.tenants.acme.clientcustomization.title=ACME OKR +okr.tenants.acme.clientcustomization.helpSiteUrl=https://en.wikipedia.org/wiki/Objectives_and_key_results okr.tenants.acme.clientcustomization.customstyles.okr-topbar-background-color=#738290 \ No newline at end of file diff --git a/backend/src/test/java/ch/puzzle/okr/controller/ClientConfigControllerIT.java b/backend/src/test/java/ch/puzzle/okr/controller/ClientConfigControllerIT.java index e6b5244a6b..f60eb9ede4 100644 --- a/backend/src/test/java/ch/puzzle/okr/controller/ClientConfigControllerIT.java +++ b/backend/src/test/java/ch/puzzle/okr/controller/ClientConfigControllerIT.java @@ -38,7 +38,7 @@ void shouldGetClientConfig() throws Exception { mvc.perform(get("/config").contentType(MediaType.APPLICATION_JSON)) .andExpect(MockMvcResultMatchers.status().isOk()) - .andExpect(jsonPath(JSON_PATH_ROOT, Matchers.aMapWithSize(9))) + .andExpect(jsonPath(JSON_PATH_ROOT, Matchers.aMapWithSize(10))) .andExpect(jsonPath("$.activeProfile", Matchers.is("Active_Profile"))) .andExpect(jsonPath("$.issuer", Matchers.is("Issuer"))) .andExpect(jsonPath("$.clientId", Matchers.is("Client_Id"))) @@ -47,6 +47,7 @@ void shouldGetClientConfig() throws Exception { .andExpect(jsonPath("$.triangles", Matchers.is("Triangles"))) .andExpect(jsonPath("$.backgroundLogo", Matchers.is("Background_Logo"))) .andExpect(jsonPath("$.title", Matchers.is("Title"))) + .andExpect(jsonPath("$.helpSiteUrl", Matchers.is("helpSiteUrl"))) .andExpect(jsonPath("$.customStyles.font-family", Matchers.is("verdana"))) .andExpect(jsonPath("$.customStyles.font-size", Matchers.is("20px"))); } @@ -54,7 +55,7 @@ void shouldGetClientConfig() throws Exception { private ClientConfigDto createClientConfigDto() { Map customStyles = Map.of("font-family", "verdana", "font-size", "20px"); return new ClientConfigDto("Active_Profile", "Issuer", "Client_Id", "Favicon", "Logo", "Triangles", - "Background_Logo", "Title", customStyles); + "Background_Logo", "Title", "helpSiteUrl", customStyles); } } diff --git a/backend/src/test/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomizationProviderTestIT.java b/backend/src/test/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomizationProviderTestIT.java index fe41e7e636..f1c5806aea 100644 --- a/backend/src/test/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomizationProviderTestIT.java +++ b/backend/src/test/java/ch/puzzle/okr/multitenancy/customization/TenantClientCustomizationProviderTestIT.java @@ -21,6 +21,7 @@ public class TenantClientCustomizationProviderTestIT { private static final String BACKGROUND_LOGO = "background-logo"; private static final String FAVICON = "favicon"; private static final String TITLE = "title"; + private static final String HELP_SITE_URL = "helpSiteUrl"; private static final String CUSTOM_STYLE_NAME = "okr-topbar-background-color"; private static final String CUSTOM_STYLE_VALUE = "css-custom-value"; @@ -43,6 +44,7 @@ private void setupPropertiesForTenantWithId(String id) { mockProperty("okr.tenants.{0}.clientcustomization.background-logo", BACKGROUND_LOGO, id); mockProperty("okr.tenants.{0}.clientcustomization.favicon", FAVICON, id); mockProperty("okr.tenants.{0}.clientcustomization.title", TITLE, id); + mockProperty("okr.tenants.{0}.clientcustomization.helpSiteUrl", HELP_SITE_URL, id); mockProperty("okr.tenants.{0}.clientcustomization.customstyles.okr-topbar-background-color", CUSTOM_STYLE_VALUE, id); } @@ -77,6 +79,7 @@ private void assertTenantClientCustomization(TenantClientCustomization customiza assertEquals(prefix(tenantId) + TRIANGLES, customization.triangles()); assertEquals(prefix(tenantId) + BACKGROUND_LOGO, customization.backgroundLogo()); assertEquals(prefix(tenantId) + TITLE, customization.title()); + assertEquals(prefix(tenantId) + HELP_SITE_URL, customization.helpSiteUrl()); assertCustomStyles(customization, tenantId); } diff --git a/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceTest.java b/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceTest.java index aced05adae..98daa385e4 100644 --- a/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceTest.java +++ b/backend/src/test/java/ch/puzzle/okr/service/clientconfig/ClientConfigServiceTest.java @@ -112,6 +112,7 @@ private TenantClientCustomization getTenantClientCustomization(String tenantId) prefix(tenantId) + "triangles", // prefix(tenantId) + "backgroundLogo", // prefix(tenantId) + "title", // + prefix(tenantId) + "helpSiteUrl", // new HashMap<>()); } diff --git a/frontend/src/app/components/application-top-bar/application-top-bar.component.html b/frontend/src/app/components/application-top-bar/application-top-bar.component.html index 3b66f02ff5..0962f37ebd 100644 --- a/frontend/src/app/components/application-top-bar/application-top-bar.component.html +++ b/frontend/src/app/components/application-top-bar/application-top-bar.component.html @@ -22,9 +22,10 @@