document list extensions (demo shell) (#4511)

* doclist extensibility test page

* desktopOnly support

* extensions category, custom column

* update code

* Fix styling for column templates

* update package lock
This commit is contained in:
Denys Vuika
2019-03-29 09:14:36 +00:00
committed by Eugenio Romano
parent 49847bf809
commit b51fc8a7d2
14 changed files with 414 additions and 50 deletions

View File

@@ -20,6 +20,7 @@ import { ExtensionConfig, ExtensionRef } from '../config/extension.config';
import { ExtensionService } from '../services/extension.service';
import { Observable, BehaviorSubject } from 'rxjs';
import { ViewerExtensionRef } from '../config/viewer.extensions';
import { DocumentListPresetRef } from '../config/document-list.extensions';
@Injectable({
providedIn: 'root'
@@ -49,9 +50,22 @@ export class AppExtensionService {
this._references.next(references);
}
/**
* Provides a collection of document list columns for the particular preset.
* The result is filtered by the **disabled** state.
* @param key Preset key.
*/
getDocumentListPreset(key: string) {
return this.extensionService
.getElements<DocumentListPresetRef>(
`features.documentList.${key}`
)
.filter((entry) => !entry.disabled);
}
/**
* Provides a list of the Viewer content extensions,
* filtered by disabled state and rules.
* filtered by **disabled** state and **rules**.
*/
getViewerExtensions(): ViewerExtensionRef[] {
return this.extensionService