mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ACS-7679] Reduce the usage of AppConfigService in components and tests (#9563)
* remove unused app config setting * remove unused app config setting * remove unnecessary app config service reference * remove unnecessary app config service reference * remove unnecessary app config service reference * remove unnecessary app config service reference * remove unnecessary app config service reference * support input params for the viewer; optional configuration * remove useless imports [ci:force] * fix imports [ci:force]
This commit is contained in:
@@ -57,7 +57,8 @@ import {
|
||||
DataRow,
|
||||
DataTableService,
|
||||
DataTableSchema,
|
||||
DataColumn
|
||||
DataColumn,
|
||||
ViewerComponentConfig
|
||||
} from '@alfresco/adf-core';
|
||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||
import { Node, NodeEntry, NodePaging, NodesApi, Pagination } from '@alfresco/js-api';
|
||||
@@ -789,9 +790,10 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
|
||||
onPreviewFile(node: NodeEntry) {
|
||||
if (node) {
|
||||
const sizeInMB = node.entry?.content?.sizeInBytes / BYTES_TO_MB_CONVERSION_VALUE;
|
||||
const config = this.appConfig.get<ViewerComponentConfig>('viewer');
|
||||
|
||||
const fileAutoDownloadFlag: boolean = this.appConfig.get('viewer.enableFileAutoDownload', true);
|
||||
const sizeThreshold: number = this.appConfig.get('viewer.fileAutoDownloadSizeThresholdInMB', 15);
|
||||
const fileAutoDownloadFlag = config?.enableFileAutoDownload ?? true;
|
||||
const sizeThreshold = config?.fileAutoDownloadSizeThresholdInMB ?? 15;
|
||||
|
||||
if (fileAutoDownloadFlag && sizeInMB && sizeInMB > sizeThreshold) {
|
||||
this.dialog.open(FileAutoDownloadComponent, { disableClose: true, data: node });
|
||||
|
Reference in New Issue
Block a user