mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-3394] Generally available file preview feature for extensions (#1496)
* Adding general purpose preview overlay route Preparation for file preview feature Remove unnecessary preview root route and ability to use loadChildren Extract RouterExtensionService Remove loadChildren support and use component instead Cover RouterExtensionService with unit tests Fix tests Fix build Fix rebase issue Add generally available PluginPreviewAction Add data option to child routes and navigateBackAsClose option for the preview component Support plain mode preview Fix linting Update to latest alpha of ADF * Adding documentation * Rebase fix * Update to latest adf
This commit is contained in:
@@ -27,10 +27,8 @@
|
||||
</ng-container>
|
||||
</adf-viewer-open-with>
|
||||
|
||||
<adf-viewer-toolbar-actions>
|
||||
<ng-container
|
||||
*ngFor="let action of viewerToolbarActions; trackBy: trackByActionId"
|
||||
>
|
||||
<adf-viewer-toolbar-actions *ngIf="!simplestMode">
|
||||
<ng-container *ngFor="let action of viewerToolbarActions; trackBy: trackByActionId">
|
||||
<aca-toolbar-action [actionRef]="action"></aca-toolbar-action>
|
||||
</ng-container>
|
||||
</adf-viewer-toolbar-actions>
|
||||
|
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
import { Component, OnInit, OnDestroy, ViewEncapsulation, HostListener } from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { ActivatedRoute, Router, UrlTree, UrlSegmentGroup, UrlSegment, PRIMARY_OUTLET } from '@angular/router';
|
||||
import { debounceTime, map, takeUntil } from 'rxjs/operators';
|
||||
import { UserPreferencesService, ObjectUtils, UploadService, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
@@ -57,6 +58,8 @@ export class PreviewComponent extends PageComponent implements OnInit, OnDestroy
|
||||
openWith: Array<ContentActionRef> = [];
|
||||
contentExtensions: Array<ViewerExtensionRef> = [];
|
||||
showRightSide = false;
|
||||
navigateBackAsClose = false;
|
||||
simplestMode = false;
|
||||
|
||||
recentFileFilters = [
|
||||
'TYPE:"content"',
|
||||
@@ -92,6 +95,7 @@ export class PreviewComponent extends PageComponent implements OnInit, OnDestroy
|
||||
private apiService: AlfrescoApiService,
|
||||
private uploadService: UploadService,
|
||||
private actions$: Actions,
|
||||
private location: Location,
|
||||
store: Store<AppStore>,
|
||||
extensions: AppExtensionService,
|
||||
content: ContentManagementService
|
||||
@@ -111,6 +115,8 @@ export class PreviewComponent extends PageComponent implements OnInit, OnDestroy
|
||||
this.previewLocation = this.router.url.substr(0, this.router.url.indexOf('/', 1)).replace(/\//g, '');
|
||||
|
||||
const routeData = this.route.snapshot.data;
|
||||
this.navigateBackAsClose = !!routeData.navigateBackAsClose;
|
||||
this.simplestMode = !!routeData.simplestMode;
|
||||
|
||||
if (routeData.navigateMultiple) {
|
||||
this.navigateMultiple = true;
|
||||
@@ -202,16 +208,18 @@ export class PreviewComponent extends PageComponent implements OnInit, OnDestroy
|
||||
}
|
||||
|
||||
navigateToFileLocation(shouldNavigate: boolean) {
|
||||
const shouldSkipNavigation = this.routesSkipNavigation.includes(this.previewLocation);
|
||||
|
||||
if (shouldNavigate) {
|
||||
const route = this.getNavigationCommands(this.previewLocation);
|
||||
if (this.navigateBackAsClose) {
|
||||
this.location.back();
|
||||
} else {
|
||||
const shouldSkipNavigation = this.routesSkipNavigation.includes(this.previewLocation);
|
||||
const route = this.getNavigationCommands(this.previewLocation);
|
||||
|
||||
if (!shouldSkipNavigation && this.folderId) {
|
||||
route.push(this.folderId);
|
||||
if (!shouldSkipNavigation && this.folderId) {
|
||||
route.push(this.folderId);
|
||||
}
|
||||
this.router.navigate(route);
|
||||
}
|
||||
|
||||
this.router.navigate(route);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user