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

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

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

    https://github.com/apache/nifi/pull/2899#discussion_r202814854
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
 ---
    @@ -167,12 +167,14 @@
                 
nfNgBridge.injector.get('breadcrumbsCtrl').resetScrollPosition();
     
                 // set page title to the name of the root processor group
    -            var rootBreadcrumb = breadcrumb;
    -            while(rootBreadcrumb.parentBreadcrumb != null) {
    -                rootBreadcrumb = rootBreadcrumb.parentBreadcrumb
    -            }
    +            if (breadcrumb.permissions.canRead) {
    +                var rootBreadcrumb = breadcrumb;
    +                while(rootBreadcrumb.parentBreadcrumb != null) {
    +                    rootBreadcrumb = rootBreadcrumb.parentBreadcrumb
    +                }
     
    -            document.title = rootBreadcrumb.breadcrumb.name;
    +                document.title = rootBreadcrumb.breadcrumb.name;
    --- End diff --
    
    @patricker Thanks for the PR!
    
    I haven't run this yet, but I think there may still be an issue. We need to 
ensure we have permissions to the `rootBreadcrumb` here. If the user navigated 
to a sub-Process Group but did not have permissions to the root Process Group I 
think we'd still have the error.
    
    Additionally, if the user navigated to a sub-Process Group which they 
didn't have access to but they did have access to the root Process Group we 
would unnecessarily avoid setting the document title.
    
    I don't believe there was an issue with identifying the `rootBreadcrumb`. 
The issue was attempting to extract the breadcrumb's name through the 
`breadcrumb` field which is `null`ed out when a user doesn't have permissions 
to the corresponding Process Group. 


> Set the Page Title to the name of the Root Process Group
> --------------------------------------------------------
>
>                 Key: NIFI-4535
>                 URL: https://issues.apache.org/jira/browse/NIFI-4535
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core UI
>            Reporter: Peter Wicks
>            Assignee: Peter Wicks
>            Priority: Minor
>             Fix For: 1.8.0
>
>
> NiFi's UI has a hard coded page title of NiFi. I have many servers and it's 
> hard to keep track of the tabs in Chrome.
> Please change the Title of the page so it matches the name of the Root 
> processor group. This way I can name the root group by server/instance, and 
> easily identify the right tab/window.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to