[AAE-7241] fix eslint warnings for Extensions project (#7491)

* fix eslint warnings for Extensions project

* fix production mode compilation
This commit is contained in:
Denys Vuika
2022-02-08 12:05:33 +00:00
committed by GitHub
parent 8a03e7a2e7
commit 8048cbeb21
17 changed files with 109 additions and 134 deletions

View File

@@ -25,32 +25,31 @@ 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';
import { BehaviorSubject, Observable } from 'rxjs';
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
export function extensionJsonsFactory() {
return [];
}
};
export const EXTENSION_JSONS = new InjectionToken<string[][]>('extension-jsons', {
providedIn: 'root',
factory: extensionJsonsFactory
});
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
export function provideExtensionConfig(jsons: string[]) {
return {
provide: EXTENSION_JSONS,
useValue: jsons,
multi: true
};
}
};
@Injectable({
providedIn: 'root'
})
export class ExtensionService {
protected config: ExtensionConfig = null;
configPath = 'assets/app.extensions.json';
pluginsPath = 'assets/plugins';
@@ -59,8 +58,10 @@ export class ExtensionService {
features: Array<any> = [];
authGuards: { [key: string]: Type<any> } = {};
setup$: Observable<ExtensionConfig>;
protected config: ExtensionConfig = null;
protected onSetup$ = new BehaviorSubject<ExtensionConfig>(this.config);
setup$ = this.onSetup$.asObservable();
constructor(
protected loader: ExtensionLoaderService,
@@ -68,6 +69,7 @@ export class ExtensionService {
protected ruleService: RuleService,
@Inject(EXTENSION_JSONS) protected extensionJsons: string[]
) {
this.setup$ = this.onSetup$.asObservable();
}
/**