From f8e0dbd5b74198fabe35245c7ceb39b762fb436f Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 8 Oct 2015 14:12:36 -0700 Subject: [PATCH] [Create] Add category for create actions --- platform/commonUI/browse/src/creation/CreateAction.js | 3 ++- .../commonUI/browse/src/creation/CreateActionProvider.js | 5 ++++- .../commonUI/browse/src/creation/CreateMenuController.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/commonUI/browse/src/creation/CreateAction.js b/platform/commonUI/browse/src/creation/CreateAction.js index 984b26cfe5..cf124bb1e3 100644 --- a/platform/commonUI/browse/src/creation/CreateAction.js +++ b/platform/commonUI/browse/src/creation/CreateAction.js @@ -53,11 +53,12 @@ define( */ function CreateAction(type, parent, context, dialogService, creationService, policyService) { this.metadata = { - key: 'create', + key: 'create.' + type.getKey(), glyph: type.getGlyph(), name: type.getName(), type: type.getKey(), description: type.getDescription(), + category: [ 'creation' ], context: context }; diff --git a/platform/commonUI/browse/src/creation/CreateActionProvider.js b/platform/commonUI/browse/src/creation/CreateActionProvider.js index 4ca2bce59f..836dde693c 100644 --- a/platform/commonUI/browse/src/creation/CreateActionProvider.js +++ b/platform/commonUI/browse/src/creation/CreateActionProvider.js @@ -63,7 +63,10 @@ define( // domain object to serve as the container for the // newly-created object (although the user may later // make a different selection) - if (key !== 'create' || !destination) { + if (!destination) { + return []; + } + if (context.category && context.category !== "creation") { return []; } diff --git a/platform/commonUI/browse/src/creation/CreateMenuController.js b/platform/commonUI/browse/src/creation/CreateMenuController.js index 624764c2e4..78fd0611df 100644 --- a/platform/commonUI/browse/src/creation/CreateMenuController.js +++ b/platform/commonUI/browse/src/creation/CreateMenuController.js @@ -41,7 +41,7 @@ define( // Update the set of Create actions function refreshActions() { $scope.createActions = $scope.action ? - $scope.action.getActions('create') : + $scope.action.getActions({ category: "creation" }) : []; }