You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/06/21 18:16:44 UTC

[GitHub] [brooklyn-ui] ahgittin commented on a change in pull request #227: WIP Drag and drop enhancements

ahgittin commented on a change in pull request #227:
URL: https://github.com/apache/brooklyn-ui/pull/227#discussion_r655605319



##########
File path: ui-modules/blueprint-composer/app/components/util/d3-blueprint.js
##########
@@ -1097,25 +1097,53 @@ export function D3Blueprint(container, options) {
 
     /**
      * Draw menu with a confirmation request on the canvas for a node with a specified ID, under the node, in the middle.
+     *
+     * Single-selection mode offers choices as buttons:
      *  _________________________
      * | Confirmation message |X|| <- 'close' button
      * | ________                |
-     * ||Choice 1|               |
+     * ||Choice 1|               | <- e.g. Button with confirmation choice 'Choice 1'
      * | --------'               |
      * ||Choice 2|               |
      * | --------'               |
      * ||Etc.    |               |
      * '-------------------------'
      *
+     * Multi-selection mode offers choices as check-boxes and confirmation button.
+     *  _________________________
+     * | Confirmation message |X||
+     * | _                       |
+     * || | Choice 1             | <- e.g. Checkbox with confirmation choice 'Choice 1'
+     * | -                       |
+     * || | Choice 2             |
+     * | -                       |
+     * || | Etc.                 |
+     * | --------                |
+     * ||Apply    |              | <- Button to apply confirmed choices.
+     * '-------------------------'
+     *
+     * Confirmation choice is pre-selected for a single option in multi-selected mode.
+     *  _________________________
+     * | Confirmation message |X||
+     * | _                       |
+     * ||X| Choice 1             | <- Checkbox with pre-selected confirmation choice 'Choice 1'
+     * | --------                |
+     * ||Apply    |              | <- Button to apply confirmed choice.
+     * '-------------------------'
+     *
+     * Apply button is disabled until at least one choice is selected in the multi-selection mode.
+     *
      * @param {String} id The ID of a node to draw confirmation menu for.
      * @param {String} message The confirmation message.
-     * @param {Array.<String>} choices The confirmation choices.
-     * @param {Function} callback The confirmation callback with a boolean parameter, true if confirmed (Yes),
-     *        false if denied (No), null otherwise (ignored).
+     * @param {Array.<String|Object>} choices The confirmation choices as plain strings or objects that implement toString
+     *        to display choice options. Use objects with distinct *.id value for choices that return same toString value.
+     * @param {Function} callback The callback with confirmed choice in the single-selection mode, or with {Array.<String>}
+     *        of confirmed choices in the multi-selection mode.
+     * @param {Boolean} isMultiSelection Indicates if confirmation selection is multi-selection, single-selection is default.

Review comment:
       should `default` of type `<String|Object>` (or `Array` thereof for `isMultiSelection`) be a parameter?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org