[ACA-4681] Added file auto download feature to DocumentList component (#8423)

* [ACA-4681] Added feature in DocumentListComponent to auto download a file if it exceeds a pre defined file size threshold

* [ACA-4681] Added test cases for file auto download feature in document list (NOT WORKING)

* [ACA-4681] Fixed unit tests for file auto download feature of document list

* [ACA-4681] Removed unused variables from app.config.json

* [ACA-4681] Resolved code review findings. Local constants are no longer upper case only (used camelCase instead). FileAutoDownload component template now uses mat-dialog provided directives and components. Removed file-auto-download.component.scss. Removed unused methods from file-auto-download.component.ts

* [ACA-4681] Added licence info to file-auto-download-actions.enum.ts

* [ACA-4681] Added license info to file-auto-download.component.ts

* [ACA-4681] Removed empty constructor

* [ACA-4681] Updated appConfig property name from "preview-config" to "viewer".

* [ACA-4681] Added JSDoc for FileAutoDownloadActionsEnum

* [ACA-4681] Updated ADF demo shell application to use "viewer" appConfig object instead of "preview-config"

* [ACA-4681] Resolved lint issues

* [ACA-4681] Removed dependency from NodeActionsService inside DocumentListComponent. FileAutoDownload component now directly triggers the file download, instead of emitting FileAutoDownloadActionsEnum.Download.

* [ACA-4681] Removed unused async. Updated import statement

* [ACA-4681] Added FileAutoDownloadComponent to public-api.ts
This commit is contained in:
swapnil-verma-gl
2023-04-04 13:01:23 +05:30
committed by GitHub
parent 2bd72f71d5
commit fc3ad78004
12 changed files with 247 additions and 7 deletions

View File

@@ -251,6 +251,9 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
selectedNodes = [];
enableFileAutoDownload: boolean = this.appConfig.get('viewer.enableFileAutoDownload', true);
fileAutoDownloadSizeThresholdInMB: number = this.appConfig.get('viewer.fileAutoDownloadSizeThresholdInMB', 15);
constructor(private notificationService: NotificationService,
private uploadService: UploadService,
private contentService: ContentService,
@@ -777,4 +780,14 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
this.selectedNodes = [];
}
onEnableFileAutoDownloadChange() {
const previewConfig = this.appConfig?.config['viewer'];
previewConfig['enableFileAutoDownload'] = this.enableFileAutoDownload;
}
onFileAutoDownloadSizeThresholdChange() {
const previewConfig = this.appConfig?.config['viewer'];
previewConfig['fileAutoDownloadSizeThresholdInMB'] = this.fileAutoDownloadSizeThresholdInMB;
}
}