mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-4679] Added code changes and env variables to enable DownloadPrompt and FileAutoDownload features on ACA (#3127)
* [ACA-4679] Added docker variables, app.config.json.tpl config and additional code for enabling non-responsive file preview download and file auto download features in ACA * [ACA-4679] Added defaults for downloadPrompt for viewer and fileAutoDownload features. Updated variable names from 'nonResponsiveDialog' to 'downloadPrompt' * [ACA-4679] Added unit test cases for FileAutoDownloadService * [ACA-4679] Updated env variable references from NonResponsiveDialog to DownloadPrompt * [ACA-4679] Added missing licence header on new files * [ACA-4679] Added env variable configuration for GithubActions jobs * [ACA-4679] Added env variable configuration for GithubActions jobs * [ACA-4679] Removed unneeded env variable configuration for GithubActions jobs * [ACA-4679] Updated .env file configuration in README.md
This commit is contained in:
@@ -28,6 +28,7 @@ import { AppStore, ViewNodeAction, getAppSelection } from '@alfresco/aca-shared/
|
||||
import { Router } from '@angular/router';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { SharedLinkEntry } from '@alfresco/js-api';
|
||||
import { AcaFileAutoDownloadService } from '@alfresco/aca-shared';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-node',
|
||||
@@ -53,22 +54,26 @@ import { SharedLinkEntry } from '@alfresco/js-api';
|
||||
export class ViewNodeComponent {
|
||||
@Input() data: { title?: string; menuButton?: boolean; iconButton?: boolean };
|
||||
|
||||
constructor(private store: Store<AppStore>, private router: Router) {}
|
||||
constructor(private store: Store<AppStore>, private router: Router, private fileAutoDownloadService: AcaFileAutoDownloadService) {}
|
||||
|
||||
onClick() {
|
||||
this.store
|
||||
.select(getAppSelection)
|
||||
.pipe(take(1))
|
||||
.subscribe((selection) => {
|
||||
let id: string;
|
||||
|
||||
if (selection.file.entry.nodeType === 'app:filelink') {
|
||||
id = selection.file.entry.properties['cm:destination'];
|
||||
if (this.fileAutoDownloadService.shouldFileAutoDownload(selection.file.entry?.content?.sizeInBytes)) {
|
||||
this.fileAutoDownloadService.autoDownloadFile(selection.file);
|
||||
} else {
|
||||
id = (selection.file as SharedLinkEntry).entry.nodeId || (selection.file as any).entry.guid || selection.file.entry.id;
|
||||
}
|
||||
let id: string;
|
||||
|
||||
this.store.dispatch(new ViewNodeAction(id, { location: this.router.url }));
|
||||
if (selection.file.entry.nodeType === 'app:filelink') {
|
||||
id = selection.file.entry.properties['cm:destination'];
|
||||
} else {
|
||||
id = (selection.file as SharedLinkEntry).entry.nodeId || (selection.file as any).entry.guid || selection.file.entry.id;
|
||||
}
|
||||
|
||||
this.store.dispatch(new ViewNodeAction(id, { location: this.router.url }));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user