mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[MNT-24553] Allow custom viewer extension components to obtain node id (#10115)
This commit is contained in:
parent
8d7ea71711
commit
4124efd4a0
@ -63,6 +63,7 @@ Using with file [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob):
|
|||||||
| tracks | [`Track`](../../../lib/core/src/lib/viewer/models/viewer.model.ts)`[]` | \[] | media subtitles for the media player |
|
| tracks | [`Track`](../../../lib/core/src/lib/viewer/models/viewer.model.ts)`[]` | \[] | media subtitles for the media player |
|
||||||
| urlFile | `string` | "" | If you want to load an external file that does not come from ACS you can use this URL to specify where to load the file from. |
|
| urlFile | `string` | "" | If you want to load an external file that does not come from ACS you can use this URL to specify where to load the file from. |
|
||||||
| viewerTemplateExtensions | [`TemplateRef`](https://angular.io/api/core/TemplateRef)`<any>` | null | Template containing ViewerExtensionDirective instances providing different viewer extensions based on supported file extension. |
|
| viewerTemplateExtensions | [`TemplateRef`](https://angular.io/api/core/TemplateRef)`<any>` | null | Template containing ViewerExtensionDirective instances providing different viewer extensions based on supported file extension. |
|
||||||
|
| nodeId | `string` | null | Identifier of a node opened by a viewer. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@ See the [Custom layout](#custom-layout) section for full details of all availabl
|
|||||||
| tracks | [`Track`](../../../lib/core/src/lib/viewer/models/viewer.model.ts)`[]` | \[] | media subtitles for the media player |
|
| tracks | [`Track`](../../../lib/core/src/lib/viewer/models/viewer.model.ts)`[]` | \[] | media subtitles for the media player |
|
||||||
| urlFile | `string` | "" | If you want to load an external file that does not come from ACS you can use this URL to specify where to load the file from. |
|
| urlFile | `string` | "" | If you want to load an external file that does not come from ACS you can use this URL to specify where to load the file from. |
|
||||||
| viewerExtensions | [`TemplateRef`](https://angular.io/api/core/TemplateRef)`<any>` | null | Template containing ViewerExtensionDirective instances providing different viewer extensions based on supported file extension. |
|
| viewerExtensions | [`TemplateRef`](https://angular.io/api/core/TemplateRef)`<any>` | null | Template containing ViewerExtensionDirective instances providing different viewer extensions based on supported file extension. |
|
||||||
|
| nodeId | `string` | null | Identifier of a node opened by a viewer. |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ an example of a real working viewer extension project.
|
|||||||
| ---- | ---- | ------------- | ----------- |
|
| ---- | ---- | ------------- | ----------- |
|
||||||
| extension | `string` | | File extension (.jpg, .png, etc) for the viewer. |
|
| extension | `string` | | File extension (.jpg, .png, etc) for the viewer. |
|
||||||
| id | `string` | | ID string of the component to preview. |
|
| id | `string` | | ID string of the component to preview. |
|
||||||
|
| nodeId | `string` | null | Identifier of a node opened by a viewer. |
|
||||||
| url | `string` | | URL of the content in the repository. |
|
| url | `string` | | URL of the content in the repository. |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
[readOnly]="readOnly"
|
[readOnly]="readOnly"
|
||||||
[allowedEditActions]="allowedEditActions"
|
[allowedEditActions]="allowedEditActions"
|
||||||
[viewerExtensions]="viewerExtensions"
|
[viewerExtensions]="viewerExtensions"
|
||||||
|
[nodeId]="nodeId"
|
||||||
(downloadFile)="onDownloadFile()"
|
(downloadFile)="onDownloadFile()"
|
||||||
(navigateBefore)="onNavigateBeforeClick($event)"
|
(navigateBefore)="onNavigateBeforeClick($event)"
|
||||||
(navigateNext)="onNavigateNextClick($event)"
|
(navigateNext)="onNavigateNextClick($event)"
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
[id]="externalViewer.component"
|
[id]="externalViewer.component"
|
||||||
[url]="urlFile"
|
[url]="urlFile"
|
||||||
[extension]="externalViewer.fileExtension"
|
[extension]="externalViewer.fileExtension"
|
||||||
|
[nodeId]="nodeId"
|
||||||
[attr.data-automation-id]="externalViewer.component">
|
[attr.data-automation-id]="externalViewer.component">
|
||||||
</adf-preview-extension>
|
</adf-preview-extension>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
@ -75,6 +76,7 @@
|
|||||||
[id]="ext.component"
|
[id]="ext.component"
|
||||||
[url]="urlFile"
|
[url]="urlFile"
|
||||||
[extension]="extension"
|
[extension]="extension"
|
||||||
|
[nodeId]="nodeId"
|
||||||
[attr.data-automation-id]="ext.component">
|
[attr.data-automation-id]="ext.component">
|
||||||
</adf-preview-extension>
|
</adf-preview-extension>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -110,6 +110,10 @@ export class ViewerRenderComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
@Input()
|
@Input()
|
||||||
tracks: Track[] = [];
|
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. */
|
/** Template containing ViewerExtensionDirective instances providing different viewer extensions based on supported file extension. */
|
||||||
@Input()
|
@Input()
|
||||||
viewerTemplateExtensions: TemplateRef<any>;
|
viewerTemplateExtensions: TemplateRef<any>;
|
||||||
|
@ -171,7 +171,8 @@
|
|||||||
[urlFile]="urlFile"
|
[urlFile]="urlFile"
|
||||||
(isSaving)="allowNavigate = !$event"
|
(isSaving)="allowNavigate = !$event"
|
||||||
[tracks]="tracks"
|
[tracks]="tracks"
|
||||||
[viewerTemplateExtensions]="viewerExtensions ?? viewerTemplateExtensions">
|
[viewerTemplateExtensions]="viewerExtensions ?? viewerTemplateExtensions"
|
||||||
|
[nodeId]="nodeId">
|
||||||
</adf-viewer-render>
|
</adf-viewer-render>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -238,6 +238,10 @@ export class ViewerComponent<T> implements OnDestroy, OnInit, OnChanges {
|
|||||||
@Input()
|
@Input()
|
||||||
viewerExtensions: TemplateRef<any>;
|
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.
|
* 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()
|
@Input()
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
|
/** Identifier of a node that is opened by the viewer. */
|
||||||
|
@Input()
|
||||||
|
nodeId: string = null;
|
||||||
|
|
||||||
/** URL of the content in the repository. */
|
/** URL of the content in the repository. */
|
||||||
@Input()
|
@Input()
|
||||||
url: string;
|
url: string;
|
||||||
@ -73,6 +77,7 @@ export class PreviewExtensionComponent implements OnInit, OnChanges, OnDestroy {
|
|||||||
|
|
||||||
instance.url = this.url;
|
instance.url = this.url;
|
||||||
instance.extension = this.extension;
|
instance.extension = this.extension;
|
||||||
|
instance.nodeId = this.nodeId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user