From e8ebc0ebcd69364a9e000929f32380573858f7b3 Mon Sep 17 00:00:00 2001 From: "kim.tran" Date: Tue, 5 Dec 2023 10:35:15 +0100 Subject: [PATCH 1/4] fix: theme logo --- .../components/portal-viewport/portal-viewport.component.ts | 3 +++ .../src/lib/services/theme.service.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.ts b/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.ts index 4c1e7569..e6e1ed7a 100644 --- a/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.ts +++ b/libs/portal-integration-angular/src/lib/core/components/portal-viewport/portal-viewport.component.ts @@ -83,6 +83,9 @@ export class PortalViewportComponent implements OnInit, AfterViewInit, OnDestroy this.themeService.currentTheme$.pipe(untilDestroyed(this)).subscribe((theme: any) => { this.logoUrl = theme.logoUrl || this.portalDefinition.logoUrl + if (this.logoUrl && !this.logoUrl.startsWith('/portal-api')) { + this.logoUrl = '/portal-api' + this.logoUrl + } document.getElementById('favicon')?.setAttribute('href', theme.faviconUrl) }) diff --git a/libs/portal-integration-angular/src/lib/services/theme.service.ts b/libs/portal-integration-angular/src/lib/services/theme.service.ts index cead809d..3dfe52bf 100644 --- a/libs/portal-integration-angular/src/lib/services/theme.service.ts +++ b/libs/portal-integration-angular/src/lib/services/theme.service.ts @@ -25,13 +25,13 @@ export class ThemeService implements OnDestroy { return this.http.get(`${this.baseUrlV1}/internal/themes/${encodeURI(themeName)}`).pipe( tap((theme) => { this.apply(theme) - this.currentTheme$.publish(theme) }) ) } public apply(theme: Theme) { console.log(`🎨 Applying theme: ${theme.name}`) + this.currentTheme$.publish(theme) if (theme.properties) { Object.values(theme.properties).forEach((group) => { for (const [key, value] of Object.entries(group)) { From 833cdb7e212cee89a7da1106d3b0fcf15758c701 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 5 Dec 2023 09:59:12 +0000 Subject: [PATCH 2/4] chore(release): -v3.5.2 [skip ci] ## [3.5.2](https://github.com/onecx/onecx-portal-ui-libs/compare/v3.5.1...v3.5.2) (2023-12-05) ### Bug Fixes * diagram color range fix ([487f671](https://github.com/onecx/onecx-portal-ui-libs/commit/487f67180cfa473b8d554cd7149d7b90967db79d)) * theme logo ([e8ebc0e](https://github.com/onecx/onecx-portal-ui-libs/commit/e8ebc0ebcd69364a9e000929f32380573858f7b3)) --- CHANGELOG.md | 8 ++++++++ libs/accelerator/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- package.json | 2 +- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78d90a60..774f97e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [3.5.2](https://github.com/onecx/onecx-portal-ui-libs/compare/v3.5.1...v3.5.2) (2023-12-05) + + +### Bug Fixes + +* diagram color range fix ([487f671](https://github.com/onecx/onecx-portal-ui-libs/commit/487f67180cfa473b8d554cd7149d7b90967db79d)) +* theme logo ([e8ebc0e](https://github.com/onecx/onecx-portal-ui-libs/commit/e8ebc0ebcd69364a9e000929f32380573858f7b3)) + ## [3.5.1](https://github.com/onecx/onecx-portal-ui-libs/compare/v3.5.0...v3.5.1) (2023-11-21) diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index 58a0753a..97db6476 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "3.5.1", + "version": "3.5.2", "peerDependencies": { "tslib": "^2.3.0", "rxjs": "7.8.1" diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index 5f9a3cb2..4971e957 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "3.5.1", + "version": "3.5.2", "peerDependencies": { "tslib": "^2.3.0", "rxjs": "7.8.1", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index 6af92b53..e47869a7 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "3.5.1", + "version": "3.5.2", "peerDependencies": { "@angular/common": ">=15.2.7", "@angular/core": ">=15.2.7", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index e3868bff..3669d876 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "3.5.1", + "version": "3.5.2", "peerDependencies": { "@angular-architects/module-federation": "15.0.0", "@angular/common": "^15.2.7", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index 3687d5c5..68eba514 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "3.5.1", + "version": "3.5.2", "peerDependencies": { "tslib": "^2.5.0" }, diff --git a/package.json b/package.json index 5114c394..2f83421b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "3.5.1", + "version": "3.5.2", "license": "Apache-2.0", "scripts": {}, "private": true, From 2d61c5c12a2d03a6326ffcfa77e99e7554d3aad2 Mon Sep 17 00:00:00 2001 From: Kim Tran Date: Wed, 6 Dec 2023 12:05:02 +0100 Subject: [PATCH 3/4] feat: add ifNotPermission (#28) * feat: add ifNotPermission * fix: add missing condition in if * feat: remove console log --------- Co-authored-by: kim.tran --- .../lib/core/directives/if-permission.directive.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/portal-integration-angular/src/lib/core/directives/if-permission.directive.ts b/libs/portal-integration-angular/src/lib/core/directives/if-permission.directive.ts index 6e245eae..aa0250dd 100644 --- a/libs/portal-integration-angular/src/lib/core/directives/if-permission.directive.ts +++ b/libs/portal-integration-angular/src/lib/core/directives/if-permission.directive.ts @@ -12,10 +12,16 @@ import { import { IAuthService } from '../../api/iauth.service' import { AUTH_SERVICE } from '../../api/injection-tokens' -@Directive({ selector: '[ocxIfPermission]' }) +@Directive({ selector: '[ocxIfPermission], [ocxIfNotPermission]' }) export class IfPermissionDirective implements OnInit { @Input('ocxIfPermission') permission: string | undefined + @Input('ocxIfNotPermission') set notPermission(value: string | undefined) { + this.permission = value + this.negate = true + } + @Input() onMissingPermission: 'hide' | 'disable' = 'hide' + negate = false constructor( private renderer: Renderer2, @@ -27,8 +33,7 @@ export class IfPermissionDirective implements OnInit { ngOnInit() { if (this.permission) { - if (!this.authService.hasPermission(this.permission)) { - console.log(`Permission check failed: ${this.permission}`) + if (this.negate === this.authService.hasPermission(this.permission)) { if (this.onMissingPermission === 'disable') { this.renderer.setAttribute(this.el.nativeElement, 'disabled', 'disabled') } else { From 8731992019ca92aed16666baac5b8962a7423b1a Mon Sep 17 00:00:00 2001 From: Henry Taeschner Date: Thu, 7 Dec 2023 12:36:27 +0100 Subject: [PATCH 4/4] fix: manual setting of version 3.6.0 in libs to finalize the release process --- CHANGELOG.md | 5 +++++ libs/accelerator/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 8 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 774f97e4..4ef6fb15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [3.6.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v3.5.2...v3.6.0) (2023-12-07) + +### Bug Fixes + + ## [3.5.2](https://github.com/onecx/onecx-portal-ui-libs/compare/v3.5.1...v3.5.2) (2023-12-05) diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index 97db6476..26b421a9 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "3.5.2", + "version": "3.6.0", "peerDependencies": { "tslib": "^2.3.0", "rxjs": "7.8.1" diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index 4971e957..c426c05d 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "3.5.2", + "version": "3.6.0", "peerDependencies": { "tslib": "^2.3.0", "rxjs": "7.8.1", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index e47869a7..9d3e4e12 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "3.5.2", + "version": "3.6.0", "peerDependencies": { "@angular/common": ">=15.2.7", "@angular/core": ">=15.2.7", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index 3669d876..dc32d917 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "3.5.2", + "version": "3.6.0", "peerDependencies": { "@angular-architects/module-federation": "15.0.0", "@angular/common": "^15.2.7", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index 68eba514..5194752b 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "3.5.2", + "version": "3.6.0", "peerDependencies": { "tslib": "^2.5.0" }, diff --git a/package-lock.json b/package-lock.json index 62fcf8c1..15bdc01b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "3.5.0", + "version": "3.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@onecx/onecx-portal-ui-libs", - "version": "3.5.0", + "version": "3.6.0", "license": "Apache-2.0", "dependencies": { "@angular-architects/module-federation": "15.0.0", diff --git a/package.json b/package.json index 2f83421b..c9cab0cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "3.5.2", + "version": "3.6.0", "license": "Apache-2.0", "scripts": {}, "private": true,