diff --git a/apps/red-ui/src/app/app.component.ts b/apps/red-ui/src/app/app.component.ts index a66f9a467..4e78439d4 100644 --- a/apps/red-ui/src/app/app.component.ts +++ b/apps/red-ui/src/app/app.component.ts @@ -1,13 +1,10 @@ -import { Component, inject, Renderer2, ViewContainerRef } from '@angular/core'; +import { Component, Renderer2, ViewContainerRef } from '@angular/core'; import { RouterHistoryService } from '@services/router-history.service'; -import { DOCUMENT } from '@angular/common'; import { UserPreferenceService } from '@users/user-preference.service'; -import { getConfig, IqserPermissionsService } from '@iqser/common-ui'; +import { getConfig } from '@iqser/common-ui'; import { AppConfig } from '@red/domain'; import { NavigationEnd, Router } from '@angular/router'; -import { filter, map, switchMap, take, tap } from 'rxjs/operators'; -import { Roles } from '@users/roles'; -import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { filter, map, switchMap, take } from 'rxjs/operators'; function loadCustomTheme() { const cssFileName = getConfig().THEME; @@ -37,9 +34,8 @@ export class AppComponent { userPreferenceService: UserPreferenceService, renderer: Renderer2, private readonly _router: Router, - iqserPermissionsService: IqserPermissionsService, ) { - renderer.addClass(inject(DOCUMENT).body, userPreferenceService.getTheme()); + renderer.addClass(document.body, userPreferenceService.getTheme()); loadCustomTheme(); const removeQueryParams = _router.events.pipe( @@ -51,13 +47,9 @@ export class AppComponent { ); removeQueryParams.subscribe(); - const changeFavicon = iqserPermissionsService.has$(Roles.getRss).pipe( - tap(hasRss => { - const faviconUrl = hasRss ? 'assets/icons/documine-logo.ico' : 'favicon.ico'; - document.getElementById('favicon').setAttribute('href', faviconUrl); - }), - ); - changeFavicon.pipe(takeUntilDestroyed()).subscribe(); + if (getConfig().IS_DOCUMINE) { + document.getElementById('favicon').setAttribute('href', 'assets/icons/documine-logo.ico'); + } } #removeKeycloakQueryParams() { diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.html b/apps/red-ui/src/app/components/base-screen/base-screen.component.html index c50d2e68e..b0a9e9658 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.html +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.html @@ -11,7 +11,10 @@ diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts index f37002b13..d1e8a888f 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts @@ -6,7 +6,7 @@ import { Title } from '@angular/platform-browser'; import { TranslateService } from '@ngx-translate/core'; import { SpotlightSearchAction } from '@components/spotlight-search/spotlight-search-action'; import { filter, map, startWith } from 'rxjs/operators'; -import { IqserPermissionsService } from '@iqser/common-ui'; +import { getConfig, IqserPermissionsService } from '@iqser/common-ui'; import { BreadcrumbsService } from '@services/breadcrumbs.service'; import { FeaturesService } from '@services/features.service'; import { ARCHIVE_ROUTE, DOSSIERS_ARCHIVE, DOSSIERS_ROUTE } from '@red/domain'; @@ -33,6 +33,7 @@ export class BaseScreenComponent { readonly roles = Roles; readonly documentViewer = inject(REDDocumentViewer); readonly currentUser = this.userService.currentUser; + readonly config = getConfig(); readonly searchActions: List = [ { text: this._translateService.instant('search.this-dossier'), diff --git a/apps/red-ui/src/app/components/skeleton/skeleton-top-bar/skeleton-top-bar.component.html b/apps/red-ui/src/app/components/skeleton/skeleton-top-bar/skeleton-top-bar.component.html index e83646bf0..ffc2d86fd 100644 --- a/apps/red-ui/src/app/components/skeleton/skeleton-top-bar/skeleton-top-bar.component.html +++ b/apps/red-ui/src/app/components/skeleton/skeleton-top-bar/skeleton-top-bar.component.html @@ -4,7 +4,7 @@ diff --git a/apps/red-ui/src/app/components/skeleton/skeleton-top-bar/skeleton-top-bar.component.ts b/apps/red-ui/src/app/components/skeleton/skeleton-top-bar/skeleton-top-bar.component.ts index 1ac32cbd5..936ef0af5 100644 --- a/apps/red-ui/src/app/components/skeleton/skeleton-top-bar/skeleton-top-bar.component.ts +++ b/apps/red-ui/src/app/components/skeleton/skeleton-top-bar/skeleton-top-bar.component.ts @@ -1,5 +1,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { Title } from '@angular/platform-browser'; +import { getConfig } from '@iqser/common-ui'; @Component({ selector: 'redaction-skeleton-top-bar', @@ -8,5 +9,7 @@ import { Title } from '@angular/platform-browser'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class SkeletonTopBarComponent { + readonly config = getConfig(); + constructor(readonly titleService: Title) {} } diff --git a/apps/red-ui/src/app/modules/icons/icons.module.ts b/apps/red-ui/src/app/modules/icons/icons.module.ts index 54c90a5a9..d0b98b06e 100644 --- a/apps/red-ui/src/app/modules/icons/icons.module.ts +++ b/apps/red-ui/src/app/modules/icons/icons.module.ts @@ -36,6 +36,7 @@ export class IconsModule { 'dictionary', 'denied', 'disable-analysis', + 'documine-logo', 'double-chevron-right', 'enable-analysis', 'enter', diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json index 570c25302..f96939231 100644 --- a/apps/red-ui/src/assets/config/config.json +++ b/apps/red-ui/src/assets/config/config.json @@ -3,6 +3,7 @@ "ADMIN_CONTACT_URL": null, "API_URL": "https://dan.iqser.cloud", "APP_NAME": "RedactManager very very very very long", + "IS_DOCUMINE": false, "AUTO_READ_TIME": 3, "BACKEND_APP_VERSION": "4.4.40", "EULA_URL": "EULA_URL", diff --git a/apps/red-ui/src/assets/icons/documine-logo.ico b/apps/red-ui/src/assets/icons/documine-logo.ico index e5947b475..0b233e850 100644 Binary files a/apps/red-ui/src/assets/icons/documine-logo.ico and b/apps/red-ui/src/assets/icons/documine-logo.ico differ diff --git a/apps/red-ui/src/assets/icons/general/documine-logo.svg b/apps/red-ui/src/assets/icons/general/documine-logo.svg new file mode 100644 index 000000000..64a5dbe47 --- /dev/null +++ b/apps/red-ui/src/assets/icons/general/documine-logo.svg @@ -0,0 +1,19 @@ + + + + + + + + + + \ No newline at end of file diff --git a/docker/red-ui/docker-entrypoint.sh b/docker/red-ui/docker-entrypoint.sh index a4f900adc..9177a469b 100755 --- a/docker/red-ui/docker-entrypoint.sh +++ b/docker/red-ui/docker-entrypoint.sh @@ -4,6 +4,7 @@ ADMIN_CONTACT_NAME="${ADMIN_CONTACT_NAME:-}" ADMIN_CONTACT_URL="${ADMIN_CONTACT_URL:-}" API_URL="${API_URL:-}" APP_NAME="${APP_NAME:-}" +IS_DOCUMINE="${IS_DOCUMINE:-}" AUTO_READ_TIME="${AUTO_READ_TIME:-1.5}" BACKEND_APP_VERSION="${BACKEND_APP_VERSION:-4.7.0}" EULA_URL="${EULA_URL:-}" @@ -25,13 +26,12 @@ BASE_TRANSLATIONS_DIRECTORY="${BASE_TRANSLATIONS_DIRECTORY:-/assets/i18n/redact/ THEME="${THEME:-theme-template}" WATERMARK_PREVIEW_PAPER_FORMAT="${WATERMARK_PREVIEW_PAPER_FORMAT:-a4}" - - echo '{ "ADMIN_CONTACT_NAME":"'"$ADMIN_CONTACT_NAME"'", "ADMIN_CONTACT_URL":"'"$ADMIN_CONTACT_URL"'", "API_URL":"'"$API_URL"'", "APP_NAME":"'"$APP_NAME"'", + "IS_DOCUMINE":"'"$IS_DOCUMINE"'", "AUTO_READ_TIME":"'"$AUTO_READ_TIME"'", "BACKEND_APP_VERSION":"'"$BACKEND_APP_VERSION"'", "EULA_URL":"'"$EULA_URL:"'", @@ -51,7 +51,7 @@ echo '{ "AVAILABLE_OLD_NOTIFICATIONS_MINUTES":"'"$AVAILABLE_OLD_NOTIFICATIONS_MINUTES"'", "NOTIFICATIONS_THRESHOLD":"'"$NOTIFICATIONS_THRESHOLD"'", "WATERMARK_PREVIEW_PAPER_FORMAT":"'"$WATERMARK_PREVIEW_PAPER_FORMAT"'" - }' > /usr/share/nginx/html/ui/assets/config/config.json + }' >/usr/share/nginx/html/ui/assets/config/config.json echo 'Env variables: ' cat /usr/share/nginx/html/ui/assets/config/config.json diff --git a/libs/common-ui b/libs/common-ui index 699e74a86..e69f8b3f0 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 699e74a867e53485844e8e5bcfc91ed1d2ff2d4f +Subproject commit e69f8b3f0df8701bbc3dbc79e2239aaad3acc889 diff --git a/libs/red-domain/src/lib/shared/app-config.ts b/libs/red-domain/src/lib/shared/app-config.ts index 343b6b097..a4c788e31 100644 --- a/libs/red-domain/src/lib/shared/app-config.ts +++ b/libs/red-domain/src/lib/shared/app-config.ts @@ -1,4 +1,4 @@ -import { IqserAppConfig } from '@iqser/common-ui/lib/utils'; +import { IqserAppConfig } from '@common-ui/utils'; export interface AppConfig extends IqserAppConfig { readonly ADMIN_CONTACT_NAME: string;