filter out disabled column templates

This commit is contained in:
Denys Vuika
2018-10-15 11:23:01 +01:00
parent b9d99411d7
commit 59841a3b81

View File

@@ -158,30 +158,12 @@ export class AppExtensionService implements RuleContext {
this.contentMetadata = this.loadContentMetadata(config); this.contentMetadata = this.loadContentMetadata(config);
this.documentListPresets = { this.documentListPresets = {
files: this.loader.getElements<DocumentListPresetRef>( files: this.getDocumentListPreset(config, 'files'),
config, libraries: this.getDocumentListPreset(config, 'libraries'),
'features.documentList.files' shared: this.getDocumentListPreset(config, 'shared'),
), recent: this.getDocumentListPreset(config, 'recent'),
libraries: this.loader.getElements<DocumentListPresetRef>( favorites: this.getDocumentListPreset(config, 'favorites'),
config, trashcan: this.getDocumentListPreset(config, 'trashcan')
'features.documentList.libraries'
),
shared: this.loader.getElements<DocumentListPresetRef>(
config,
'features.documentList.shared'
),
recent: this.loader.getElements<DocumentListPresetRef>(
config,
'features.documentList.recent'
),
favorites: this.loader.getElements<DocumentListPresetRef>(
config,
'features.documentList.favorites'
),
trashcan: this.loader.getElements<DocumentListPresetRef>(
config,
'features.documentList.trashcan'
)
}; };
} }
@@ -189,6 +171,15 @@ export class AppExtensionService implements RuleContext {
return this.loader.getElements<NavBarGroupRef>(config, 'features.navbar'); return this.loader.getElements<NavBarGroupRef>(config, 'features.navbar');
} }
protected getDocumentListPreset(config: ExtensionConfig, key: string) {
return this.loader
.getElements<DocumentListPresetRef>(
config,
`features.documentList.${key}`
)
.filter(entry => !entry.disabled);
}
getApplicationNavigation(elements) { getApplicationNavigation(elements) {
return elements.map(group => { return elements.map(group => {
return { return {