From eedaaf983d731d0179916b3f3a8e4d3a0d80981b Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Wed, 31 Jan 2018 13:27:33 +0200 Subject: Change designer to plugin in code Changed all the use of the designer configuration in the code to be plugin Change-Id: Id9792cbd4fb9385446780c28fb7fb5418772acf6 Issue-ID: SDC-974 Signed-off-by: Idan Amit --- .../view-models/workspace/workspace-view-model.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'catalog-ui/src/app/view-models/workspace/workspace-view-model.ts') 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 87d8367e5d..59dd2d8f00 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 @@ -22,7 +22,7 @@ * Created by obarda on 3/30/2016. */ 'use strict'; -import {IUserProperties, IAppMenu, Resource, Component, Designer, DesignersConfiguration, DesignerDisplayOptions} from "app/models"; +import {IUserProperties, IAppMenu, Resource, Component, Plugin, PluginsConfiguration, PluginDisplayOptions} from "app/models"; import { WorkspaceMode, ComponentFactory, ChangeLifecycleStateHandler, Role, ComponentState, MenuItemGroup, MenuHandler, MenuItem, ModalsHandler, States, EVENTS, CHANGE_COMPONENT_CSAR_VERSION_FLAG, ResourceType @@ -58,7 +58,7 @@ export interface IWorkspaceViewModelScope extends ng.IScope { changeVersion:any; isComposition:boolean; isDeployment:boolean; - isDesigners:boolean; + isPlugins:boolean; $state:ng.ui.IStateService; user:IUserProperties; thirdParty:boolean; @@ -629,8 +629,8 @@ export class WorkspaceViewModel { let selectedIndex = selectedItem ? this.$scope.leftBarTabs.menuItems.indexOf(selectedItem) : 0; - if (stateArray[1] === 'designers') { - selectedIndex += _.findIndex(DesignersConfiguration.designers, (designer: Designer) => designer.designerStateUrl === this.$state.params.path); + if (stateArray[1] === 'plugins') { + selectedIndex += _.findIndex(PluginsConfiguration.plugins, (plugin: Plugin) => plugin.pluginStateUrl === this.$state.params.path); } this.$scope.leftBarTabs.selectedIndex = selectedIndex; @@ -644,7 +644,7 @@ export class WorkspaceViewModel { if (newVal) { this.$scope.isComposition = (newVal.indexOf(States.WORKSPACE_COMPOSITION) > -1); this.$scope.isDeployment = newVal == States.WORKSPACE_DEPLOYMENT; - this.$scope.isDesigners = newVal == States.WORKSPACE_DESIGNERS; + this.$scope.isPlugins = newVal == States.WORKSPACE_PLUGINS; } }); @@ -719,18 +719,18 @@ export class WorkspaceViewModel { this.$scope.leftBarTabs = new MenuItemGroup(); const menuItemsObjects:Array = this.updateMenuItemByRole(this.sdcMenu.component_workspace_menu_option[this.$scope.component.getComponentSubType()], this.role); - // Only need to add designers to the menu if the current role is Designer + // Only need to add plugins to the menu if the current role is Designer if (this.role === "DESIGNER") { - _.each(DesignersConfiguration.designers, (designer: Designer) => { - if (designer.designerDisplayOptions["context"]) { - let displayOptions : DesignerDisplayOptions = designer.designerDisplayOptions["context"]; + _.each(PluginsConfiguration.plugins, (plugin: Plugin) => { + if (plugin.pluginDisplayOptions["context"]) { + let displayOptions : PluginDisplayOptions = plugin.pluginDisplayOptions["context"]; if (displayOptions.displayContext.indexOf(this.$scope.component.componentType) !== -1) { menuItemsObjects.push({ text: displayOptions.displayName, action: 'onMenuItemPressed', - state: 'workspace.designers', - params: {path: designer.designerStateUrl} + state: 'workspace.plugins', + params: {path: plugin.pluginStateUrl} }); } } -- cgit 1.2.3-korg