[ACA-1591] Load extensions from multiple files (#521)

* rework extension service, separate file with config

* improve loading, optional entries

* simplify config and unify content actions

* load and merge multiple files

* improve plugin loading, introduce second demo

* move demo stuff to a plugin

* rework navbar to make it pluggable

* code and naming convention cleanup

* extension schema

* switch off custom navbar group by default

* hotfix for facetQueries issue

* consolidate files, final renames
This commit is contained in:
Denys Vuika
2018-07-19 20:54:39 +01:00
committed by GitHub
parent 43a71aa1c8
commit 8c9ffc1160
34 changed files with 1209 additions and 1048 deletions

View File

@@ -30,21 +30,38 @@ import { AboutComponent } from '../components/about/about.component';
import { LayoutComponent } from '../components/layout/layout.component';
import { ToolbarActionComponent } from './components/toolbar-action/toolbar-action.component';
import { CommonModule } from '@angular/common';
import { RuleService } from './rules/rule.service';
import { ActionService } from './actions/action.service';
import { every, some } from './evaluators/core.evaluators';
import {
canCreateFolder,
hasFolderSelected,
canUpdateSelectedFolder,
hasFileSelected,
canDownloadSelection
} from './evaluators/app.evaluators';
@NgModule({
imports: [CommonModule, CoreModule.forChild()],
declarations: [ToolbarActionComponent],
exports: [ToolbarActionComponent],
entryComponents: [AboutComponent],
providers: [ExtensionService, RuleService, ActionService]
providers: [ExtensionService]
})
export class CoreExtensionsModule {
constructor(extensions: ExtensionService) {
extensions
.setComponent('aca:layouts/main', LayoutComponent)
.setComponent('aca:components/about', AboutComponent)
.setAuthGuard('aca:auth', AuthGuardEcm);
.setComponent('app.layout.main', LayoutComponent)
.setComponent('app.components.about', AboutComponent)
.setAuthGuard('app.auth', AuthGuardEcm)
.setEvaluator('core.every', every)
.setEvaluator('core.some', some)
.setEvaluator('app.selection.canDownload', canDownloadSelection)
.setEvaluator('app.selection.file', hasFileSelected)
.setEvaluator('app.selection.folder', hasFolderSelected)
.setEvaluator(
'app.selection.folder.canUpdate',
canUpdateSelectedFolder
)
.setEvaluator('app.navigation.folder.canCreate', canCreateFolder);
}
}