summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--catalog-ui/src/app/ng2/app.module.ts6
-rw-r--r--catalog-ui/src/app/ng2/services/config.service.ts16
2 files changed, 14 insertions, 8 deletions
diff --git a/catalog-ui/src/app/ng2/app.module.ts b/catalog-ui/src/app/ng2/app.module.ts
index 194d2e0095..c3cd06043b 100644
--- a/catalog-ui/src/app/ng2/app.module.ts
+++ b/catalog-ui/src/app/ng2/app.module.ts
@@ -64,8 +64,10 @@ export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
export function configServiceFactory(config:ConfigService) {
return () => {
- config.loadValidationConfiguration();
- config.loadPluginsConfiguration();
+ return Promise.all([
+ config.loadValidationConfiguration(),
+ config.loadPluginsConfiguration()
+ ]);
}
}
diff --git a/catalog-ui/src/app/ng2/services/config.service.ts b/catalog-ui/src/app/ng2/services/config.service.ts
index 3e6e667285..a9a4e86a55 100644
--- a/catalog-ui/src/app/ng2/services/config.service.ts
+++ b/catalog-ui/src/app/ng2/services/config.service.ts
@@ -72,15 +72,19 @@ export class ConfigService {
loadPluginsConfiguration(): Promise<PluginsConfiguration> {
let url:string = this.api.no_proxy_root + this.api.GET_plugins_configuration;
let promise: Promise<any> = this.http.get(url).map((res: Response) => res.json()).toPromise();
- promise.then((pluginsData: Plugins) => {
- PluginsConfiguration.plugins = pluginsData;
- }).catch((ex) => {
- console.error("Error loading plugins configuration from BE", ex);
+ return new Promise<PluginsConfiguration>((resolve) => {
+ promise.then((pluginsData: Plugins) => {
+ PluginsConfiguration.plugins = pluginsData;
+ console.log('RESOLVED PLUGINS!!!');
+ resolve();
+ }).catch((ex) => {
+ console.error("Error loading plugins configuration from BE", ex);
- PluginsConfiguration.plugins = [] as Plugins;
+ PluginsConfiguration.plugins = [] as Plugins;
+ });
});
- return promise;
+ // return promise;
}
}