diff --git a/libs/angular-accelerator/src/lib/directives/src.directive.ts b/libs/angular-accelerator/src/lib/directives/src.directive.ts index da3be811..ad8c7dbd 100644 --- a/libs/angular-accelerator/src/lib/directives/src.directive.ts +++ b/libs/angular-accelerator/src/lib/directives/src.directive.ts @@ -21,9 +21,9 @@ export class SrcDirective { // ok with content if (response?.status === 200) { const url = URL.createObjectURL(response.body as Blob) - this.el.nativeElement.onload = () => { + this.el.nativeElement.addEventListener('load', () => { URL.revokeObjectURL(url) - } + }) this.el.nativeElement.src = url } // no content diff --git a/libs/shell-core/src/index.ts b/libs/shell-core/src/index.ts index c886622b..4643da37 100644 --- a/libs/shell-core/src/index.ts +++ b/libs/shell-core/src/index.ts @@ -5,3 +5,6 @@ export * from './lib/components/portal-viewport/portal-viewport.component' export * from './lib/components/error-component/global-error.component' export * from './lib/services/permissions-cache.service' export * from './lib/model/constants' + +export * from './lib/shell-interface/show-content-provider' +export * from './lib/shell-interface/workspace-config-bff-service-provider' \ No newline at end of file diff --git a/libs/shell-core/src/lib/components/portal-footer/portal-footer.component.html b/libs/shell-core/src/lib/components/portal-footer/portal-footer.component.html index 95b79ab8..e0a34197 100644 --- a/libs/shell-core/src/lib/components/portal-footer/portal-footer.component.html +++ b/libs/shell-core/src/lib/components/portal-footer/portal-footer.component.html @@ -1,11 +1,12 @@
logo
© {{copyrightMsg$ | async}}
diff --git a/libs/shell-core/src/lib/components/portal-footer/portal-footer.component.ts b/libs/shell-core/src/lib/components/portal-footer/portal-footer.component.ts index b8631018..9785c42c 100644 --- a/libs/shell-core/src/lib/components/portal-footer/portal-footer.component.ts +++ b/libs/shell-core/src/lib/components/portal-footer/portal-footer.component.ts @@ -1,9 +1,11 @@ -import { Component, OnInit } from '@angular/core' +import { Component, Inject, OnInit, Optional } from '@angular/core' import { Router } from '@angular/router' -import { AppStateService, ConfigurationService, CONFIG_KEY, ThemeService } from '@onecx/angular-integration-interface' -import { ImageLogoUrlUtils } from '@onecx/portal-integration-angular' -import { combineLatest, concat, map, Observable, of, withLatestFrom } from 'rxjs' -import { SHELL_BFF_PREFIX } from '../../model/constants' +import { AppStateService, CONFIG_KEY, ConfigurationService, ThemeService } from '@onecx/angular-integration-interface' +import { Observable, combineLatest, concat, filter, map, mergeMap, of, withLatestFrom } from 'rxjs' +import { + WORKSPACE_CONFIG_BFF_SERVICE_PROVIDER, + WorkspaceConfigBffService, +} from '../../shell-interface/workspace-config-bff-service-provider' @Component({ selector: 'ocx-shell-footer', @@ -19,7 +21,10 @@ export class PortalFooterComponent implements OnInit { private configurationService: ConfigurationService, public router: Router, private appState: AppStateService, - private themeService: ThemeService + private themeService: ThemeService, + @Optional() + @Inject(WORKSPACE_CONFIG_BFF_SERVICE_PROVIDER) + public workspaceConfigBffService: WorkspaceConfigBffService | undefined ) { this.versionInfo$ = this.appState.currentMfe$.pipe( withLatestFrom(this.appState.currentPortal$.asObservable()), @@ -35,7 +40,15 @@ export class PortalFooterComponent implements OnInit { this.themeService.currentTheme$.asObservable(), this.appState.currentWorkspace$.asObservable(), ]).pipe( - map(([theme, portalData]) => ImageLogoUrlUtils.createLogoUrl(SHELL_BFF_PREFIX, theme.logoUrl || portalData.logoUrl)) + mergeMap(([theme, portalData]) => { + if (!theme.logoUrl && !portalData.logoUrl) { + return (this.workspaceConfigBffService?.getThemeLogoByName(theme.name ?? '') ?? of()).pipe( + filter((blob) => !!blob), + map((blob) => URL.createObjectURL(blob)) + ) + } + return of(theme.logoUrl || portalData.logoUrl) + }) ) } @@ -62,4 +75,10 @@ export class PortalFooterComponent implements OnInit { public onErrorHandleSrc(): void { this.logoUrl$ = of(undefined) } + + onLoad(logoUrl: string) { + if (logoUrl.startsWith('blob: ')) { + URL.revokeObjectURL(logoUrl) + } + } } diff --git a/libs/shell-core/src/lib/components/portal-header/header.component.html b/libs/shell-core/src/lib/components/portal-header/header.component.html index 6eb3c7ec..a1880797 100644 --- a/libs/shell-core/src/lib/components/portal-header/header.component.html +++ b/libs/shell-core/src/lib/components/portal-header/header.component.html @@ -1,14 +1,17 @@