You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/11/12 16:33:25 UTC

[GitHub] [nifi] mcgilman commented on a change in pull request #5516: NIFI-9205 - Update prioritizer configuration

mcgilman commented on a change in pull request #5516:
URL: https://github.com/apache/nifi/pull/5516#discussion_r748426135



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js
##########
@@ -1526,7 +1608,13 @@
 
                     // handle each prioritizer
                     $.each(connection.prioritizers, function (i, type) {
-                        $('#prioritizer-available').children('li[id="' + type + '"]').detach().appendTo('#prioritizer-selected');
+                        var selectedPrioritizer = $('#prioritizer-available').children('li[id="' + type + '"]');
+
+                        var draggableElement = selectedPrioritizer.find('div.draggable-control');
+                        if (draggableElement.length === 0 ) {

Review comment:
       Is there a scenario where prioritizer from the available list will already have a `draggable-control`?

##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection-configuration.js
##########
@@ -1374,6 +1418,44 @@
             }
         },
 
+        /**
+         * Sorts the available prioritizers.
+         */
+        sortAvailablePrioritizers: function () {
+            var availablePrioritizersList = $('#prioritizer-available');
+            availablePrioritizersList.children('li')
+                .detach()
+                .sort(function (aElement, bElement) {
+                    var nameA = $(aElement).text();
+                    var nameB = $(bElement).text();
+                    return nameA.localeCompare(nameB);
+                })
+                .appendTo(availablePrioritizersList);
+        },
+
+        /**
+         * Adds the controls to the specified selected draggable element.
+         *
+         * @argument {jQuery} draggableElement
+         */
+        addControlsForSelectedPrioritizer: function (draggableElement) {
+            var removeIcon = $('<div class="draggable-control"><div class="fa fa-remove"></div></div>')
+                .on('click', function () {
+                    // remove the remove ice

Review comment:
       Minor typo. Appears to be from copying/pasting from `nf-parameter-contexts`. Can you please update both?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

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