diff --git a/horizon/static/framework/widgets/action-list/actions.batch.mock.html b/horizon/static/framework/widgets/action-list/actions.batch.mock.html index b2e7295cd8..b42918b3b3 100644 --- a/horizon/static/framework/widgets/action-list/actions.batch.mock.html +++ b/horizon/static/framework/widgets/action-list/actions.batch.mock.html @@ -1,2 +1,2 @@ - + diff --git a/horizon/static/framework/widgets/action-list/actions.directive.js b/horizon/static/framework/widgets/action-list/actions.directive.js index 566d5cc51e..326576100c 100644 --- a/horizon/static/framework/widgets/action-list/actions.directive.js +++ b/horizon/static/framework/widgets/action-list/actions.directive.js @@ -35,71 +35,111 @@ * * Attributes: * - * allowedActions: actions allowed that can be displayed - * actionListType: allow the buttons to be shown as a list or doropdown + * @param {string} type + * Type can be only be 'row' or 'batch'. + * 'batch' actions are rendered as a button group, 'row' is rendered as a button dropdown menu. + * 'batch' actions are typically used for actions across multiple items while + * 'row' actions are used per item. * - * `allowedActions` is a list of allowed actions on the service. - * It's an array of objects of the form: - * { template: {}, permissions: , callback: 'callback'} + * @param {string=} item + * The item to pass to the callback when using 'row' type. + * The variable is evaluated and passed as an argument when evaluating 'allowed'. + * 'item' is not used when row type is 'batch'. * - * `template` is an object that can be + * @param {function} allowed + * Returns an array of actions that can be performed on the item(s). + * When using 'row' type, the current 'item' will be passed to the function. + * When using 'batch' type, no arguments are provided. * - * {url: 'template.html'} the location of the template for the action button. - * Use this for complete extensibility and control over what is rendered. - * The template will be responsible for binding the callback and styling. + * This is an array that should contain objects with the following properties: + * { + * template: