mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[MNT-24553] Allow custom viewer extension components to obtain node id (#10115)
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
[readOnly]="readOnly"
|
||||
[allowedEditActions]="allowedEditActions"
|
||||
[viewerExtensions]="viewerExtensions"
|
||||
[nodeId]="nodeId"
|
||||
(downloadFile)="onDownloadFile()"
|
||||
(navigateBefore)="onNavigateBeforeClick($event)"
|
||||
(navigateNext)="onNavigateNextClick($event)"
|
||||
|
@@ -24,6 +24,7 @@
|
||||
[id]="externalViewer.component"
|
||||
[url]="urlFile"
|
||||
[extension]="externalViewer.fileExtension"
|
||||
[nodeId]="nodeId"
|
||||
[attr.data-automation-id]="externalViewer.component">
|
||||
</adf-preview-extension>
|
||||
</ng-container>
|
||||
@@ -75,6 +76,7 @@
|
||||
[id]="ext.component"
|
||||
[url]="urlFile"
|
||||
[extension]="extension"
|
||||
[nodeId]="nodeId"
|
||||
[attr.data-automation-id]="ext.component">
|
||||
</adf-preview-extension>
|
||||
</ng-container>
|
||||
|
@@ -110,6 +110,10 @@ export class ViewerRenderComponent implements OnChanges, OnInit, OnDestroy {
|
||||
@Input()
|
||||
tracks: Track[] = [];
|
||||
|
||||
/** Identifier of a node that is opened by the viewer. */
|
||||
@Input()
|
||||
nodeId: string = null;
|
||||
|
||||
/** Template containing ViewerExtensionDirective instances providing different viewer extensions based on supported file extension. */
|
||||
@Input()
|
||||
viewerTemplateExtensions: TemplateRef<any>;
|
||||
|
@@ -171,7 +171,8 @@
|
||||
[urlFile]="urlFile"
|
||||
(isSaving)="allowNavigate = !$event"
|
||||
[tracks]="tracks"
|
||||
[viewerTemplateExtensions]="viewerExtensions ?? viewerTemplateExtensions">
|
||||
[viewerTemplateExtensions]="viewerExtensions ?? viewerTemplateExtensions"
|
||||
[nodeId]="nodeId">
|
||||
</adf-viewer-render>
|
||||
|
||||
</div>
|
||||
|
@@ -238,6 +238,10 @@ export class ViewerComponent<T> implements OnDestroy, OnInit, OnChanges {
|
||||
@Input()
|
||||
viewerExtensions: TemplateRef<any>;
|
||||
|
||||
/** Identifier of a node that is opened by the viewer. */
|
||||
@Input()
|
||||
nodeId: string = null;
|
||||
|
||||
/**
|
||||
* Enable dialog box to allow user to download the previewed file, in case the preview is not responding for a set period of time.
|
||||
*/
|
||||
|
@@ -31,6 +31,10 @@ export class PreviewExtensionComponent implements OnInit, OnChanges, OnDestroy {
|
||||
@Input()
|
||||
id: string;
|
||||
|
||||
/** Identifier of a node that is opened by the viewer. */
|
||||
@Input()
|
||||
nodeId: string = null;
|
||||
|
||||
/** URL of the content in the repository. */
|
||||
@Input()
|
||||
url: string;
|
||||
@@ -73,6 +77,7 @@ export class PreviewExtensionComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
instance.url = this.url;
|
||||
instance.extension = this.extension;
|
||||
instance.nodeId = this.nodeId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user