summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/workspace
diff options
context:
space:
mode:
authorIdan Amit <ia096e@intl.att.com>2018-01-23 15:53:11 +0200
committerIdan Amit <ia096e@intl.att.com>2018-01-24 21:00:39 +0000
commitae4ab937ea76cbd15dfb572d67ddd7d672503336 (patch)
tree12c78406974589581a82c281146311180e18a00d /catalog-ui/src/app/view-models/workspace
parent45772e3924ee075e9674864eb32586d7cdb276b4 (diff)
Add designer service
Fixed a bug in the configuration Change-Id: I6a40bff70ed71d72d6b75104ffb1002d83ade1b2 Issue-ID: SDC-958 Signed-off-by: Idan Amit <ia096e@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/view-models/workspace')
-rw-r--r--catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view-model.ts16
-rw-r--r--catalog-ui/src/app/view-models/workspace/workspace-view-model.ts2
2 files changed, 8 insertions, 10 deletions
diff --git a/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view-model.ts
index 03ce83ee18..2f4e1dafac 100644
--- a/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view-model.ts
+++ b/catalog-ui/src/app/view-models/workspace/tabs/designers/designers-tab-view-model.ts
@@ -1,4 +1,5 @@
-import {Designer, DesignersConfiguration} from "app/models";
+import {Designer} from "app/models";
+import {DesignersService} from "../../../../ng2/services/designers.service";
interface IDesignerTabViewModelScope extends ng.IScope {
@@ -8,21 +9,18 @@ interface IDesignerTabViewModelScope extends ng.IScope {
export class DesignersTabViewModel {
static '$inject' = [
'$scope',
- '$stateParams'
+ '$stateParams',
+ 'DesignersService'
];
constructor(private $scope:IDesignerTabViewModelScope,
- private $stateParams:any) {
+ private $stateParams:any,
+ private designersService:DesignersService) {
this.initScope();
}
private initScope = ():void => {
- // get the designer object by using the path parameter
- let designerKey: any = _.findKey(DesignersConfiguration.designers, (designerConfig: Designer) =>{
- return designerConfig.designerStateUrl === this.$stateParams.path;
- });
-
- this.$scope.designer = DesignersConfiguration.designers[designerKey];
+ this.$scope.designer = this.designersService.getDesignerByStateUrl(this.$stateParams.path);
}
}
diff --git a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts
index 3846cf075e..87d8367e5d 100644
--- a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts
+++ b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts
@@ -725,7 +725,7 @@ export class WorkspaceViewModel {
if (designer.designerDisplayOptions["context"]) {
let displayOptions : DesignerDisplayOptions = designer.designerDisplayOptions["context"];
- if (displayOptions.displayContext.indexOf(this.$scope.component.getComponentSubType()) !== -1) {
+ if (displayOptions.displayContext.indexOf(this.$scope.component.componentType) !== -1) {
menuItemsObjects.push({
text: displayOptions.displayName,
action: 'onMenuItemPressed',