[ 
https://issues.apache.org/jira/browse/NIFI-2888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15602553#comment-15602553
 ] 

ASF GitHub Bot commented on NIFI-2888:
--------------------------------------

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

    https://github.com/apache/nifi/pull/1151#discussion_r84731755
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor.js
 ---
    @@ -547,30 +557,64 @@ nf.Processor = (function () {
                         details.remove();
                     }
                 }
    -        });
    -        
    -        // ---------------
    -        // processor color
    -        // ---------------
    -
    -        // update the processor color
    -        updated.select('text.processor-icon')
    -            .style('fill', function (d) {
    -                
    -                // get the default color
    -                var color = nf.Processor.defaultColor();
    -                
    -                if (!d.permissions.canRead) {
    -                    return color;
    -                }
     
    -                // use the specified color if appropriate
    -                if 
(nf.Common.isDefinedAndNotNull(d.component.style['background-color'])) {
    -                    color = d.component.style['background-color'];
    -                }
    +            // ---------------
    +            // processor color
    +            // ---------------
     
    -                return color;
    -            });
    +            // update the processor color
    +            processor.select('text.processor-icon')
    +                .style('fill', function (d) {
    +
    +                    // get the default color
    +                    var color = nf.Processor.defaultColor();
    +
    +                    if (!d.permissions.canRead) {
    +                        //update the processor icon container
    +                        
processor.select('rect.processor-icon-container').classed('unauthorized', true);
    --- End diff --
    
    I don't think we should be updating/modifying these elements within the 
callback for a different element. Because we're already iterating through each 
matched processor, `d` is already available as `processorData`. Each of these` 
processor.select` should be brought outside of this callback.
    
    FYI - we're using `.each` in this case because of how the tooltips are 
implemented. They didn't directly map into the traditional mapping process.


> Display processor fill color when sufficiently zoomed out.
> ----------------------------------------------------------
>
>                 Key: NIFI-2888
>                 URL: https://issues.apache.org/jira/browse/NIFI-2888
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core UI
>            Reporter: Scott Aslan
>            Assignee: Scott Aslan
>             Fix For: 1.2.0
>
>         Attachments: processor-change-color.png
>
>
> As a user when viewing the zoomed out overview of my flow I want to be able 
> to quickly identify processors based on their fill color.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to