ACS-8404: Update application settings service (#3988)

This commit is contained in:
Denys Vuika
2024-08-22 11:50:00 -04:00
committed by GitHub
parent 360970da85
commit 11f51af54c
12 changed files with 86 additions and 40 deletions

View File

@@ -23,13 +23,20 @@
*/
import { inject, Injectable } from '@angular/core';
import { AppConfigService } from '@alfresco/adf-core';
import { AppConfigService, CloseButtonPosition } from '@alfresco/adf-core';
import { AlfrescoMimeType, DefaultMimeTypes } from '../constants/mime-types';
@Injectable({ providedIn: 'root' })
export class AppSettingsService {
private appConfig = inject(AppConfigService);
/**
* Get the application copyright text from the app settings.
*/
get appCopyright(): string {
return this.appConfig.get<string>('application.copyright', '');
}
/**
* Get the AOS (Alfresco Office Services) host URL from the app settings.
*/
@@ -98,6 +105,34 @@ export class AppSettingsService {
return result;
}
/**
* Get the viewer close button position from the app settings.
*/
get viewerCloseButtonPosition(): CloseButtonPosition {
return this.appConfig.get('viewer.closeButtonPosition', CloseButtonPosition.Right);
}
/**
* Get the viewer max retries from the app settings.
*/
get viewerMaxRetries(): number {
return this.appConfig.get<number>('viewer.maxRetries', 1);
}
/**
* Enabled state of the comment feature for upload dialog
*/
get uploadAllowComments(): boolean {
return this.appConfig.get<boolean>('adf-version-manager.allowComments', true);
}
/**
* Enabled state of the download feature for upload dialog
*/
get uploadAllowDownload(): boolean {
return this.appConfig.get<boolean>('adf-version-manager.allowDownload', true);
}
/**
* Gets the enablement of the file auto tryDownload feature from the app settings.
*/