summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/ng2')
-rw-r--r--catalog-ui/src/app/ng2/app.module.ts2
-rw-r--r--catalog-ui/src/app/ng2/services/designers.service.ts17
2 files changed, 19 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/app.module.ts b/catalog-ui/src/app/ng2/app.module.ts
index ecaa26e1ce..5cf4d80075 100644
--- a/catalog-ui/src/app/ng2/app.module.ts
+++ b/catalog-ui/src/app/ng2/app.module.ts
@@ -47,6 +47,7 @@ import {SdcConfig} from "./config/sdc-config.config";
import { TranslateModule } from "./shared/translator/translate.module";
import { TranslationServiceConfig } from "./config/translation.service.config";
import {DesignerFrameModule} from "./components/ui/designer/designer-frame.module";
+import {DesignersService} from "./services/designers.service";
export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
@@ -97,6 +98,7 @@ export function configServiceFactory(config:ConfigService) {
SdcConfig,
ComponentInstanceServiceNg2,
TranslationServiceConfig,
+ DesignersService,
{
provide: APP_INITIALIZER,
useFactory: configServiceFactory,
diff --git a/catalog-ui/src/app/ng2/services/designers.service.ts b/catalog-ui/src/app/ng2/services/designers.service.ts
new file mode 100644
index 0000000000..283b54b964
--- /dev/null
+++ b/catalog-ui/src/app/ng2/services/designers.service.ts
@@ -0,0 +1,17 @@
+import { Injectable } from '@angular/core';
+import {Designer, DesignersConfiguration} from "app/models";
+
+@Injectable()
+export class DesignersService {
+
+ constructor() {
+ }
+
+ public getDesignerByStateUrl = (stateUrl: string) => {
+ let designerKey: any = _.findKey(DesignersConfiguration.designers, (designerConfig: Designer) =>{
+ return designerConfig.designerStateUrl === stateUrl;
+ });
+
+ return DesignersConfiguration.designers[designerKey];
+ }
+}