mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[AAE-6811] Load custom theme (#2402)
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
"sharedLinkDateTimePickerType": "date",
|
||||
"headerColor": "#ffffff",
|
||||
"headerTextColor": "#000000",
|
||||
"customCssPath": "",
|
||||
"pagination": {
|
||||
"size": 25,
|
||||
"supportedPageSizes": [25, 50, 100]
|
||||
|
@@ -44,7 +44,8 @@ import {
|
||||
SetUserProfileAction,
|
||||
SnackbarErrorAction,
|
||||
CloseModalDialogsAction,
|
||||
SetRepositoryInfoAction
|
||||
SetRepositoryInfoAction,
|
||||
getCustomCssPath
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { filter, takeUntil } from 'rxjs/operators';
|
||||
import { RouterExtensionService, AppService, ContentApiService } from '@alfresco/aca-shared';
|
||||
@@ -97,6 +98,8 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.loadAppSettings();
|
||||
|
||||
this.loadCustomCss();
|
||||
|
||||
const { router, pageTitle } = this;
|
||||
|
||||
this.router.events
|
||||
@@ -164,6 +167,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
headerTextColor: this.config.get<string>('headerTextColor', '#000000'),
|
||||
logoPath: this.config.get<string>('application.logo'),
|
||||
headerImagePath: this.config.get<string>('application.headerImagePath'),
|
||||
customCssPath: this.config.get<string>('customCssPath'),
|
||||
sharedUrl: baseShareUrl
|
||||
};
|
||||
|
||||
@@ -195,4 +199,16 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.store.dispatch(new SnackbarErrorAction(message));
|
||||
}
|
||||
|
||||
private loadCustomCss(): void {
|
||||
this.store.select(getCustomCssPath).subscribe((cssPath) => {
|
||||
if (cssPath) {
|
||||
const cssLinkElement = document.createElement('link');
|
||||
cssLinkElement.setAttribute('rel', 'stylesheet');
|
||||
cssLinkElement.setAttribute('type', 'text/css');
|
||||
cssLinkElement.setAttribute('href', cssPath);
|
||||
document.head.appendChild(cssLinkElement);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ export const INITIAL_APP_STATE: AppState = {
|
||||
headerTextColor: '#000000',
|
||||
logoPath: 'assets/images/alfresco-logo-white.svg',
|
||||
headerImagePath: 'assets/images/mastHead-bg-shapesPattern.svg',
|
||||
customCssPath: '',
|
||||
sharedUrl: '',
|
||||
user: {
|
||||
isAdmin: null,
|
||||
|
Reference in New Issue
Block a user