aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/view-models')
-rw-r--r--catalog-ui/src/app/view-models/designers/designers-view-model.ts18
-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
3 files changed, 15 insertions, 21 deletions
diff --git a/catalog-ui/src/app/view-models/designers/designers-view-model.ts b/catalog-ui/src/app/view-models/designers/designers-view-model.ts
index 42c1194258..380e093cb2 100644
--- a/catalog-ui/src/app/view-models/designers/designers-view-model.ts
+++ b/catalog-ui/src/app/view-models/designers/designers-view-model.ts
@@ -1,6 +1,7 @@
-import {Designer, IUserProperties, DesignersConfiguration} from "app/models";
+import {Designer, IUserProperties} from "app/models";
import {CacheService} from "app/services";
import {MenuItemGroup} from "app/utils";
+import {DesignersService} from "../../ng2/services/designers.service";
interface IDesignerViewModelScope extends ng.IScope {
@@ -14,25 +15,20 @@ export class DesignersViewModel {
static '$inject' = [
'$scope',
'$stateParams',
- '$sce',
- 'Sdc.Services.CacheService'
+ 'Sdc.Services.CacheService',
+ 'DesignersService'
];
constructor(private $scope:IDesignerViewModelScope,
private $stateParams:any,
- private $sce:any,
- private cacheService:CacheService) {
+ private cacheService:CacheService,
+ 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);
this.$scope.version = this.cacheService.get('version');
this.$scope.topNavMenuModel = [];
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',