summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/services
diff options
context:
space:
mode:
authorIdan Amit <ia096e@intl.att.com>2018-01-15 14:31:42 +0200
committerMichael Lando <ml636r@att.com>2018-01-16 16:58:47 +0000
commit5197c8b7b3cf7576f1198e4b59a7d6484e793107 (patch)
tree55e938e420d863fac9f1c92901f4e7c2e34787c4 /catalog-ui/src/app/ng2/services
parentfd19ae43d9f057f9ce51d48f95ef3f5f60173f22 (diff)
Designer-view component for top-nav
Create a designer-view component for opening a designer view from the top-nav Updated the API to return the designers as a list and not as an object Created a designer-frame component that will get a designer url to open in the dedicated position Change-Id: Ic42f7695277e88aacdeaa74d4d0f95b49ce44999 Issue-ID: SDC-884 Signed-off-by: Idan Amit <ia096e@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/services')
-rw-r--r--catalog-ui/src/app/ng2/services/config.service.ts17
1 files changed, 10 insertions, 7 deletions
diff --git a/catalog-ui/src/app/ng2/services/config.service.ts b/catalog-ui/src/app/ng2/services/config.service.ts
index 1c0ee18d33..8675ea7d3d 100644
--- a/catalog-ui/src/app/ng2/services/config.service.ts
+++ b/catalog-ui/src/app/ng2/services/config.service.ts
@@ -25,7 +25,7 @@
import { Injectable, Inject } from '@angular/core';
import { Http, Response } from '@angular/http';
import 'rxjs/add/operator/toPromise';
-import {IAppConfigurtaion, ValidationConfiguration, Validations} from "app/models";
+import {IAppConfigurtaion, ValidationConfiguration, Validations, Designers, DesignersConfiguration} from "app/models";
import {IApi} from "app/models/app-config";
import {SdcConfigToken, ISdcConfig} from "../config/sdc-config.config";
@@ -69,15 +69,18 @@ export class ConfigService {
return promise;
}
- loadDesignersConfiguration(): void {
+ loadDesignersConfiguration(): Promise<DesignersConfiguration> {
let url:string = this.api.no_proxy_root + this.api.GET_designers_configuration;
let promise: Promise<any> = this.http.get(url).map((res: Response) => res.json()).toPromise();
-
- promise.then((config:any) => {
- console.log(config);
+ promise.then((designersData: Designers) => {
+ DesignersConfiguration.designers = designersData;
}).catch((ex) => {
- console.error('Error was:', ex);
- })
+ console.error("Error loading designers configuration from BE", ex);
+
+ DesignersConfiguration.designers = [] as Designers;
+ });
+
+ return promise;
}
}