Skip to content

Commit

Permalink
implement new config attr in frontend and rename attr
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 committed Nov 19, 2024
1 parent bf840a0 commit e74c6c9
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import java.util.Map;

public record ClientConfigDto(String activeProfile, String issuer, String clientId, String favicon, String logo,
String triangles, String backgroundLogo, String title, String supportSiteURL,
String triangles, String backgroundLogo, String title, String supportSiteUrl,
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, String supportSiteURL, Map<String, String> customStyles) {
String title, String supportSiteUrl, Map<String, String> customStyles) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +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.supportSiteURL", tenantId)),
env.getProperty(MessageFormat.format("okr.tenants.{0}.clientcustomization.supportSiteUrl", tenantId)),
getCustomCssStyles(tenantId) //
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ClientConfigDto getConfigBasedOnActiveEnv(String hostName) {
tenantClientCustomization.get().triangles(), //
tenantClientCustomization.get().backgroundLogo(), //
tenantClientCustomization.get().title(), //
tenantClientCustomization.get().supportSiteURL(), //
tenantClientCustomization.get().supportSiteUrl(), //
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.supportSiteUrl=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.supportSiteUrl=https://google.com
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 @@ -22,9 +22,11 @@
</button>

<button
*ngIf="this.supportSiteUrl$ | async as supportSiteUrl"
id="hilfeButton"
[attr.data-testId]="'help-button'"
class="topBarEntry btn"
onclick="window.open('https://wiki.puzzle.ch/Puzzle/OKRs', '_blank')"
onclick="window.open(supportSiteUrl, '_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');
supportSiteUrl$ = 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.supportSiteUrl) {
this.supportSiteUrl$.next(config.supportSiteUrl);
}
},
});
this.initUserFullName();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/shared/types/model/ClientConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface CustomizationConfig {
logo: string;
triangles: string;
backgroundLogo: string;
supportSiteURL: string;
supportSiteUrl: string;
customStyles: CustomStyles;
}
export interface ClientConfig extends AuthConfig, CustomizationConfig {}

0 comments on commit e74c6c9

Please sign in to comment.