Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/710 url to helpsite #1191

Merged
merged 21 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
30f8933
jar is now debuggable
kcinay055679 Oct 15, 2024
2d8420e
rename intelij config and change log level of spring to debug in stag…
kcinay055679 Oct 17, 2024
5448ca4
exclude formatter plugin in build for docker
kcinay055679 Oct 18, 2024
57dfc27
clean up
kcinay055679 Oct 18, 2024
c8bfb9f
add a Observable that triggers a refresh when called (#1041)
nevio18324 Oct 23, 2024
9d37e25
Feature/624 Dialog creation refactoring using a service (#1045)
kcinay055679 Oct 25, 2024
1980029
Fix/fix git history (#1125)
kcinay055679 Nov 4, 2024
777ce0d
refactor styles of dialogs (#1072)
kcinay055679 Nov 6, 2024
cfd3cef
change config and Tenant enitity to have new attribute supportSiteURL
nevio18324 Nov 19, 2024
551d691
implement new config attr in frontend and rename attr
nevio18324 Nov 19, 2024
a5a6b6a
change onclick to click because onclick doesnt work
nevio18324 Nov 19, 2024
bfb1a27
remove window import and use normal window instead
nevio18324 Nov 19, 2024
33ad37a
update customization service spec to test new config
nevio18324 Nov 19, 2024
f27bfd0
update backend config tests to test new attr
nevio18324 Nov 19, 2024
ed4bb75
change e2e properties to work with new config and remove unused testId
nevio18324 Nov 19, 2024
1817b31
revert run.xml changes
nevio18324 Nov 19, 2024
5145e1e
rename supportSiteUrl to helpSiteUrl and change helpSiteUrl of acme
nevio18324 Nov 21, 2024
0e3cc4d
format application-integration-test-properties
nevio18324 Nov 21, 2024
472efc3
delete compiled js files
nevio18324 Nov 21, 2024
51f0b55
fix rebase
nevio18324 Nov 21, 2024
fa3b8dd
reaad testId to help-button
nevio18324 Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,17 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.23.0</version>
<executions>
<execution>
<id>code-format</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
MasterEvarior marked this conversation as resolved.
Show resolved Hide resolved
</plugins>
</build>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> customStyles) {
String triangles, String backgroundLogo, String title, String helpSiteUrl, Map<String, String> customStyles) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import java.util.Map;

public record TenantClientCustomization(String favicon, String logo, String triangles, String backgroundLogo,
String title, Map<String, String> customStyles) {
String title, String helpSiteUrl, Map<String, String> customStyles) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) //
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public ClientConfigDto getConfigBasedOnActiveEnv(String hostName) {
tenantClientCustomization.get().triangles(), //
tenantClientCustomization.get().backgroundLogo(), //
tenantClientCustomization.get().title(), //
tenantClientCustomization.get().helpSiteUrl(), //
tenantClientCustomization.get().customStyles()); //
}

Expand Down
2 changes: 2 additions & 0 deletions backend/src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand All @@ -47,14 +47,15 @@ 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")));
}

private ClientConfigDto createClientConfigDto() {
Map<String, String> 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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private TenantClientCustomization getTenantClientCustomization(String tenantId)
prefix(tenantId) + "triangles", //
prefix(tenantId) + "backgroundLogo", //
prefix(tenantId) + "title", //
prefix(tenantId) + "helpSiteUrl", //
new HashMap<>());
}

Expand Down
1 change: 1 addition & 0 deletions frontend/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { pressUntilContains, doUntilSelector } from './helper/utils';
import Chainable = Cypress.Chainable;

Cypress.Commands.add('loginAsUser', (user: any) => {
cy.viewport(1920, 1080);
MasterEvarior marked this conversation as resolved.
Show resolved Hide resolved
loginWithCredentials(user.username, user.password);
overviewIsLoaded();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
</button>

<button
*ngIf="this.helpSiteUrl | async as helpSiteUrl"
id="hilfeButton"
class="topBarEntry btn"
[attr.data-testId]="'help-button'"
onclick="window.open('https://wiki.puzzle.ch/Puzzle/OKRs', '_blank')"
(click)="window.open(helpSiteUrl, '_blank')"
>
<mat-icon aria-hidden="false" aria-label="Help icon" fontIcon="help_outline"></mat-icon>
<span class="d-none d-md-flex"> Hilfe </span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';
import { OAuthService } from 'angular-oauth2-oidc';
import { BehaviorSubject, filter, Observable, of, Subscription, switchMap } from 'rxjs';
import { BehaviorSubject, Subscription } from 'rxjs';
import { ConfigService } from '../../services/config.service';
import { NavigationEnd, Router } from '@angular/router';
import { UserService } from '../../services/user.service';
Expand All @@ -16,6 +16,7 @@ export class ApplicationTopBarComponent implements OnInit, OnDestroy {
userFullName: string = '';
menuIsOpen = false;
logoSrc$ = new BehaviorSubject<String>('assets/images/empty.svg');
helpSiteUrl = new BehaviorSubject<string>('https://en.wikipedia.org/wiki/Objectives_and_key_results');
private subscription?: Subscription;

constructor(
Expand All @@ -32,6 +33,9 @@ export class ApplicationTopBarComponent implements OnInit, OnDestroy {
if (config.logo) {
this.logoSrc$.next(config.logo);
}
if (config.helpSiteUrl) {
this.helpSiteUrl.next(config.helpSiteUrl);
}
},
});
this.initUserFullName();
Expand All @@ -57,4 +61,6 @@ export class ApplicationTopBarComponent implements OnInit, OnDestroy {
}
});
}

protected readonly window = window;
}
4 changes: 4 additions & 0 deletions frontend/src/app/services/customization.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe('CustomizationService', () => {
logo: 'logo',
triangles: 'triangles',
backgroundLogo: 'backgroundLogo',
helpSiteUrl: 'https://wiki.puzzle.ch/Puzzle/OKRs',
customStyles: { cssVar1: 'foo' },
};

Expand Down Expand Up @@ -86,6 +87,7 @@ describe('CustomizationService', () => {
expect(currentConfig?.favicon).toBe(body.favicon);
expect(currentConfig?.triangles).toBe(body.triangles);
expect(currentConfig?.backgroundLogo).toBe(body.backgroundLogo);
expect(currentConfig?.helpSiteUrl).toBe(body.helpSiteUrl);
expect(currentConfig?.customStyles['cssVar1']).toBe(body.customStyles['cssVar1']);

expect(callRecorder.getCallCount('title.innerHTML')).toBe(1);
Expand All @@ -110,6 +112,7 @@ describe('CustomizationService', () => {
logo: 'logo-second',
triangles: 'triangles-second',
backgroundLogo: 'backgroundLogo-second',
helpSiteUrl: 'https://wiki.puzzle.ch/Puzzle/OKRs',
customStyles: { cssVarNew: 'bar' },
};
configSubject.next(bodySecond);
Expand All @@ -120,6 +123,7 @@ describe('CustomizationService', () => {
expect(currentConfig?.favicon).toBe(bodySecond.favicon);
expect(currentConfig?.triangles).toBe(bodySecond.triangles);
expect(currentConfig?.backgroundLogo).toBe(bodySecond.backgroundLogo);
expect(currentConfig?.helpSiteUrl).toBe(bodySecond.helpSiteUrl);
expect(currentConfig?.customStyles['cssVarNew']).toBe(bodySecond.customStyles['cssVarNew']);
expect(currentConfig?.customStyles['cssVar1']).toBe(undefined);

Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/shared/types/model/ClientConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface CustomizationConfig {
logo: string;
triangles: string;
backgroundLogo: string;
helpSiteUrl: string;
customStyles: CustomStyles;
}
export interface ClientConfig extends AuthConfig, CustomizationConfig {}
36 changes: 36 additions & 0 deletions frontend/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,42 @@
}
}
},
"CONFIRMATION": {
"DRAFT_CREATE": {
"TITLE": "Check-in im Draft-Status",
"TEXT": "Dein Objective befindet sich noch im DRAFT Status. Möchtest du das Check-in trotzdem erfassen?"
},
"RELEASE": {
"TITLE": "Objective veröffentlichen",
"TEXT": "Soll dieses Objective veröffentlicht werden?"
},
"TO_DRAFT": {
"TITLE": "Objective als Draft speichern",
"TEXT": "Soll dieses Objective als Draft gespeichert werden?"
},
"DELETE": {
"ACTION":{
"TITLE": "Löschen bestätigen",
"TEXT": "Möchtest du die Action wirklich löschen?"
},
"TEAM":{
"TITLE": "Team löschen",
"TEXT": "Möchtest du das Team '{{team}}' wirklich löschen? Zugehörige Objectives werden dadurch in allen Quartalen ebenfalls gelöscht!"
},
"OBJECTIVE":{
"TITLE": "Objective löschen",
"TEXT": "Möchtest du dieses Objective wirklich löschen? Zugehörige Key Results werden dadurch ebenfalls gelöscht!"
},
"KEYRESULT":{
"TITLE": "Key Result löschen",
"TEXT": "Möchtest du dieses Key Result wirklich löschen? Zugehörige Check-ins werden dadurch ebenfalls gelöscht!"
},
"USER_FROM_TEAM":{
"TITLE": "Mitglied entfernen",
"TEXT": "Möchtest du {{user}} wirklich aus dem Team '{{team}}' entfernen?"
}
}
},
MasterEvarior marked this conversation as resolved.
Show resolved Hide resolved
"ERROR": {
"UNAUTHORIZED": "Du bist nicht autorisiert, um das Objekt mit der Id {1} zu öffnen.",
"NOT_FOUND": "Das Objekt '{0}' mit der Id {1} konnte nicht gefunden werden.",
Expand Down
Loading