Github user zenfenan commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2509#discussion_r181573096
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js
 ---
    @@ -741,8 +742,8 @@
                             }
                         });
     
    -                    // show the execution node option if we're cluster or 
we're currently configured to run on the primary node only
    -                    if (nfClusterSummary.isClustered() || executionNode 
=== 'PRIMARY') {
    +                    // show the execution node option if we're clustered 
and execution node is not restricted to run only in primary node
    +                    if (nfClusterSummary.isClustered() && 
executionNodeRestricted !== true) {
    --- End diff --
    
    @mcgilman With the current state of the commit, if a processor previously 
didn't have `executionNodeRestricted` and the `executionNode` was `ALL`, it 
will still be hidden. Now I understand that shouldn't be the case. Thanks for 
the clarification so I think the following will address this:
    
        var getExecutionNodeOptions = function (processor) {
            return [{
                text: 'All nodes',
                value: 'ALL',
                description: 'Processor will be scheduled to run on all nodes',
                disabled: processor.executionNodeRestricted === true
            }, {
                text: 'Primary node',
                value: 'PRIMARY',
                description: 'Processor will be scheduled to run only on the 
primary node',
                disabled: !nfClusterSummary.isClustered() && 
processor.config['executionNode'] === 'PRIMARY'
            }];
        };
    
    And changing the code to show when `execution-node-options` gets shown in 
the UI to the following:
    
        if ((nfClusterSummary.isClustered() && executionNodeRestricted !== 
true) ||
            (!nfClusterSummary.isClustered() && executionNode === 'PRIMARY') ||
            (executionNodeRestricted === true && executionNode === 'ALL')) {
            $('#execution-node-options').show();
        } else {
            $('#execution-node-options').hide();
        }
    
    There are two much checks in the `if` but I think they are needed to 
address this. If that can be optimized or modified, do let me know.


---

Reply via email to