diff options
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.ts | 16 | ||||
-rw-r--r-- | catalog-ui/src/app/view-models/workspace/workspace-view-model.ts | 2 |
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', |