mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
extensibility improvements (#4484)
* add missing interfaces to extensions library * separate rule service * api enhancements * fix test * improve APIs
This commit is contained in:
committed by
Eugenio Romano
parent
80aaaef65d
commit
26c5982a1a
@@ -196,7 +196,7 @@
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngSwitchCase="'custom'">
|
||||
<ng-container *ngFor="let ext of viewerExtensions">
|
||||
<ng-container *ngFor="let ext of viewerExtensions">
|
||||
<adf-preview-extension
|
||||
*ngIf="checkExtensions(ext.fileExtension)"
|
||||
[id]="ext.component"
|
||||
@@ -208,9 +208,10 @@
|
||||
</ng-container>
|
||||
|
||||
<span class="adf-viewer-custom-content" *ngFor="let extensionTemplate of extensionTemplates">
|
||||
<ng-template *ngIf="extensionTemplate.isVisible"
|
||||
[ngTemplateOutlet]="extensionTemplate.template"
|
||||
[ngTemplateOutletContext]="{ urlFileContent: urlFileContent, extension:extension }">
|
||||
<ng-template
|
||||
*ngIf="extensionTemplate.isVisible"
|
||||
[ngTemplateOutlet]="extensionTemplate.template"
|
||||
[ngTemplateOutletContext]="{ urlFileContent: urlFileContent, extension:extension }">
|
||||
</ng-template>
|
||||
</span>
|
||||
</ng-container>
|
||||
|
@@ -31,7 +31,7 @@ import { ViewerSidebarComponent } from './viewer-sidebar.component';
|
||||
import { ViewerToolbarComponent } from './viewer-toolbar.component';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { ViewUtilService } from '../services/view-util.service';
|
||||
import { ExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
|
||||
import { AppExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-viewer',
|
||||
@@ -238,7 +238,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
private viewUtils: ViewUtilService,
|
||||
private logService: LogService,
|
||||
private location: Location,
|
||||
private extensionService: ExtensionService,
|
||||
private extensionService: AppExtensionService,
|
||||
private el: ElementRef) {
|
||||
}
|
||||
|
||||
@@ -251,14 +251,15 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this.apiService.nodeUpdated.subscribe((node) => this.onNodeUpdated(node))
|
||||
);
|
||||
|
||||
this.extensionLoad();
|
||||
this.loadExtensions();
|
||||
}
|
||||
|
||||
private extensionLoad() {
|
||||
this.viewerExtensions = this.extensionService.getFeature('viewer.content');
|
||||
this.viewerExtensions.forEach((currentViewerExtension: ViewerExtensionRef) => {
|
||||
this.externalExtensions.push(currentViewerExtension.fileExtension);
|
||||
});
|
||||
private loadExtensions() {
|
||||
this.viewerExtensions = this.extensionService.getViewerExtensions();
|
||||
this.viewerExtensions
|
||||
.forEach((extension: ViewerExtensionRef) => {
|
||||
this.externalExtensions.push(extension.fileExtension);
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
Reference in New Issue
Block a user