aeaversa commented on a change in pull request #3281: NIFI-5986 Adding "Stop & 
Configure" button functionality to Processor…
URL: https://github.com/apache/nifi/pull/3281#discussion_r278694332
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
 ##########
 @@ -296,6 +317,81 @@
                     });
                 }
 
+                //Populate the status bar if the feature is enabled
+                if (config.supportsStatusBar && 
nfCommon.isDefinedAndNotNull(config.nfCanvasUtils)){
+
+                    //Synchronize the status bar values to the canvas component
+                    var target = function(){
+                        return 
config.nfCanvasUtils.getSelectionById(processor.id)['datum']();
+                    }
+                    
$("#processor-details-status-bar").statusbar('observe',target);
+
+                    //fetch the component as a selection from the canvas
+                    selection = 
config.nfCanvasUtils.getSelectionById(processor.id);
+
+                    // Add the stop & configure button if appropriate
+                    if(nfCommon.isDefinedAndNotNull(config.nfActions) &&
+                        config.nfCanvasUtils.isProcessor(selection) &&
+                        config.nfCanvasUtils.canModify(selection)){
+
+                        
$("#processor-details-status-bar").statusbar('buttons',[{
+                            buttonHtml: '<i class="fa fa-stop 
stop-configure-icon" aria-hidden="true"></i><span>Stop & Configure</span>',
+                            clazz: 'button button-icon auto-width',
+                            color: {
+                                hover: '#C7D2D7',
+                                base: 'transparent',
+                                text: '#004849'
+                            },
+                            disabled : function() {
+                                return 
!config.nfCanvasUtils.isStoppable(selection);
+                            },
+                            handler: {
+                                click: function() {
+                                    //Assign a callback when the 
ProcessorConfiguration window is ready
+                                    var cb = function(){
 
 Review comment:
   @mcgilman  - Refactored callback to remove duplicated code.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to