aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/view-models/workspace
diff options
context:
space:
mode:
authorIdan Amit <ia096e@intl.att.com>2018-01-31 18:57:31 +0200
committerMichael Lando <ml636r@att.com>2018-02-01 08:15:25 +0000
commit162f50777e13eebe3b27ec8364ee892be628f7b0 (patch)
treeebce6947b372a61827745e9985eef0ac3f144af2 /catalog-ui/src/app/view-models/workspace
parent3c9f4df71b978e92a6eeb6f22bc7535e749d11c2 (diff)
Align configuration for new design
Aligned the designers configuration according to the new design addition and changes Change-Id: Id08942b5a8adbac10bbe76bdd8a2a6f093ec8b46 Issue-ID: SDC-975 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/plugins/plugins-context-view-model.ts2
-rw-r--r--catalog-ui/src/app/view-models/workspace/workspace-view-model.ts30
2 files changed, 16 insertions, 16 deletions
diff --git a/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-context-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-context-view-model.ts
index 76010b56f4..ca8c269116 100644
--- a/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-context-view-model.ts
+++ b/catalog-ui/src/app/view-models/workspace/tabs/plugins/plugins-context-view-model.ts
@@ -33,6 +33,8 @@ export class PluginsContextViewModel {
this.$scope.queryParams = {
userId: this.$scope.user.userId,
+ userRole: this.$scope.user.role,
+ displayType: "context",
contextType: this.$scope.component.componentType,
uuid: this.$scope.component.uuid,
lifecycleState: this.$scope.component.lifecycleState,
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 59dd2d8f00..0f9d7590c7 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
@@ -719,23 +719,21 @@ export class WorkspaceViewModel {
this.$scope.leftBarTabs = new MenuItemGroup();
const menuItemsObjects:Array<any> = this.updateMenuItemByRole(this.sdcMenu.component_workspace_menu_option[this.$scope.component.getComponentSubType()], this.role);
- // Only need to add plugins to the menu if the current role is Designer
- if (this.role === "DESIGNER") {
- _.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.plugins',
- params: {path: plugin.pluginStateUrl}
- });
- }
+ // Only adding plugins to the workspace if they can be displayed for the current user role
+ _.each(PluginsConfiguration.plugins, (plugin: Plugin) => {
+ if (plugin.pluginDisplayOptions["context"] && plugin.pluginDisplayOptions["context"].displayRoles.includes(this.role)) {
+ let displayOptions : PluginDisplayOptions = plugin.pluginDisplayOptions["context"];
+
+ if (displayOptions.displayContext.indexOf(this.$scope.component.getComponentSubType()) !== -1) {
+ menuItemsObjects.push({
+ text: displayOptions.displayName,
+ action: 'onMenuItemPressed',
+ state: 'workspace.plugins',
+ params: {path: plugin.pluginStateUrl}
+ });
}
- });
- }
+ }
+ });
this.$scope.leftBarTabs.menuItems = menuItemsObjects.map((item:MenuItem) => {
if (item.params) {