[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:
Denys Vuika
2021-04-13 14:16:29 +01:00
committed by GitHub
parent bd8242922b
commit 84ce202ad2
54 changed files with 383 additions and 204 deletions

View File

@@ -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>;

View File

@@ -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",

View File

@@ -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);
}
/**