mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-4966] Extensible app config (#6914)
* merge app config from the extensions * improved service injection in unit tests * extra unit test * fix content tests * update code as per review * fix lint * fix lint * update code and tests * update schema
This commit is contained in:
@@ -27,9 +27,9 @@ export interface ExtensionRef {
|
||||
$license: string;
|
||||
$runtime?: string;
|
||||
$description?: string;
|
||||
|
||||
$dependencies?: Array<string>;
|
||||
|
||||
appConfig?: any;
|
||||
rules?: Array<RuleRef>;
|
||||
routes?: Array<RouteRef>;
|
||||
actions?: Array<ActionRef>;
|
||||
|
@@ -602,6 +602,10 @@
|
||||
"minItems": 0,
|
||||
"uniqueItems": true
|
||||
},
|
||||
"appConfig": {
|
||||
"description": "Application configuration parameters to add/override",
|
||||
"type": "object"
|
||||
},
|
||||
"rules": {
|
||||
"description": "List of rule definitions",
|
||||
"type": "array",
|
||||
|
@@ -25,6 +25,7 @@ import * as core from '../evaluators/core.evaluators';
|
||||
import { ComponentRegisterService } from './component-register.service';
|
||||
import { RuleService } from './rule.service';
|
||||
import { ExtensionElement } from '../config/extension-element';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
export function extensionJsonsFactory() {
|
||||
return [];
|
||||
@@ -58,6 +59,9 @@ export class ExtensionService {
|
||||
features: Array<any> = [];
|
||||
authGuards: { [key: string]: Type<{}> } = {};
|
||||
|
||||
protected onSetup$ = new BehaviorSubject<ExtensionConfig>(this.config);
|
||||
setup$ = this.onSetup$.asObservable();
|
||||
|
||||
constructor(
|
||||
protected loader: ExtensionLoaderService,
|
||||
protected componentRegister: ComponentRegisterService,
|
||||
@@ -103,6 +107,7 @@ export class ExtensionService {
|
||||
this.features = this.loader.getFeatures(config);
|
||||
|
||||
this.ruleService.setup(config);
|
||||
this.onSetup$.next(config);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user