mcgilman commented on code in PR #5671:
URL: https://github.com/apache/nifi/pull/5671#discussion_r967389978


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/statusbar/jquery.statusbar.js:
##########
@@ -22,7 +22,19 @@
  *
  *
  */
-(function ($) {
+(function (root, factory) {
+    if (typeof define === 'function' && define.amd) {
+        define(['jquery', 'nf.Common'],
+            function ($, nfCommon) {
+                return (nf.CanvasUtils = factory($, nfCommon));
+            });
+    } else if (typeof exports === 'object' && typeof module === 'object') {
+        module.exports = (nf.CanvasUtils = factory(require('d3'), 
require('nf.Common')));
+    } else {
+        nf.CanvasUtils = factory(root.$, root.nf.Common);
+    }
+}(this, function ($, nfCommon) {

Review Comment:
   I suspect the references to `nf.CanvasUtils` here are a copy/paste issue. 
Generally, our `jquery` plugins do not reference any `nf` classes. The intended 
direction is for our `nf` classes to reference and use the `jquery` plugins. Is 
it possible here to instead of calling the formatting code here to instead let 
the client of the `statusbar` format the bulletins and pass in a `jquery` 
reference (`$`)?



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-parameter-contexts.js:
##########
@@ -1086,12 +1111,13 @@
         $('#parameter-context-dialog').modal('refreshButtons');
     };
 
-
     var hasParameterContextChanged = function (parameterContextEntity) {
-        var parameters = marshalParameters();
         var proposedParamContextName = $('#parameter-context-name').val();
         var proposedParamContextDesc = 
$('#parameter-context-description-field').val();
         var inheritedParameterContexts = marshalInheritedParameterContexts();
+        var componentDescription = 
nfCommon.isDefinedAndNotNull(_.get(parameterContextEntity, 
'component.description'))
+            ? _.get(parameterContextEntity, 'component.description')
+            : '';

Review Comment:
   `_.get(...)` supports a default value.



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js:
##########
@@ -1712,14 +2582,17 @@
                     name: 'General',
                     tabContentId: 'general-settings-tab-content'
                 }, {
-                    name: 'Reporting Task Controller Services',
+                    name: 'Controller Level Controller Services',

Review Comment:
   The user guide is still referencing `Reporting Task Controller Services`.



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-parameter-contexts.js:
##########
@@ -2674,6 +2731,11 @@
                     $('#parameter-context-id-setting').addClass('hidden');
                 }
 
+                // initially hide the provider setting
+                if 
(!$('#parameter-context-provider-setting').hasClass('hidden')) {
+                    
$('#parameter-context-provider-setting').addClass('hidden');

Review Comment:
   Generally, dialog fields are reset in `resetDialog` into a consistent or 
base state. Then when opening the dialog we know what the base state is and we 
just need to adjust from there. Thoughts on always hiding the 
`parameter-context-provider-setting` always in `resetDialog`. When opening a 
Parameter Context that is bound to a Parameter Provider we just populate the 
field and show the `div`.



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-parameter-contexts.js:
##########
@@ -2480,6 +2514,7 @@
         var parameterContextActionFormatter = function (row, cell, value, 
columnDef, dataContext) {
             var markup = '';
 
+            var component = dataContext.component ? dataContext.component : 
null;

Review Comment:
   Please use `canRead` to drive whether `component` is populated.



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to