Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-3681

Hide Empty Tabs (Views) in the GUI

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • None
    • Platform: All, OS: All

    Description

      I'd like the ability to hide tabs that have no visible jobs. We use Project
      Based Security to limit development access to only their projects. I don't like
      that developers can still see all tabs used by the other groups, even though
      they are empty due to the security settings.

      Attachments

        Issue Links

          Activity

            rnell rnell added a comment -

            In Hudson a Tab is known as a View.

            rnell rnell added a comment - In Hudson a Tab is known as a View.
            mindless Alan Harder added a comment -
                • Issue 4893 has been marked as a duplicate of this issue. ***
            mindless Alan Harder added a comment - Issue 4893 has been marked as a duplicate of this issue. ***
            mindless Alan Harder added a comment -
                • Issue 3945 has been marked as a duplicate of this issue. ***
            mindless Alan Harder added a comment - Issue 3945 has been marked as a duplicate of this issue. ***
            mindless Alan Harder added a comment -

            I've closed 2 requests for setting view permissions in favor of this request..
            use the project permissions to control what can be seen, and the UI should just
            hide those view tabs where the current user can't see any of the projects.
            We'll need to figure out when to show a tab even when empty though.. maybe
            admins always see all views, or anyone who can edit a view always sees it.. that
            way someone can find the view to add projects or delete it.

            mindless Alan Harder added a comment - I've closed 2 requests for setting view permissions in favor of this request.. use the project permissions to control what can be seen, and the UI should just hide those view tabs where the current user can't see any of the projects. We'll need to figure out when to show a tab even when empty though.. maybe admins always see all views, or anyone who can edit a view always sees it.. that way someone can find the view to add projects or delete it.
            mindless Alan Harder added a comment -

            This works by simply wrapping each <l:tab> inside this condition in View/main.jelly:
            <j:if test="${v==it or v.hasPermission(v.CONFIGURE) or !empty(v.items)}">

            however, this calls View.getItems() on every view every time a view page is shown. should there be a short-term cache to avoid recomputation?

            mindless Alan Harder added a comment - This works by simply wrapping each <l:tab> inside this condition in View/main.jelly: <j:if test="${v==it or v.hasPermission(v.CONFIGURE) or !empty(v.items)}"> however, this calls View.getItems() on every view every time a view page is shown. should there be a short-term cache to avoid recomputation?
            infinitodev infinitodev added a comment -

            Any update on this issue?

            infinitodev infinitodev added a comment - Any update on this issue?
            saheba saheba added a comment - - edited

            Same problem here. We would like to reduce the size of the view tab bar and use project-based security as well. Anything new regarding this issue?

            saheba saheba added a comment - - edited Same problem here. We would like to reduce the size of the view tab bar and use project-based security as well. Anything new regarding this issue?
            domi Dominik Bartholdi added a comment - just placed a pull request: https://github.com/jenkinsci/jenkins/pull/370
            saheba saheba added a comment -

            thanks for the pull request. I am scheduling an update session as soon as it is merged to jenkins:master.

            saheba saheba added a comment - thanks for the pull request. I am scheduling an update session as soon as it is merged to jenkins:master.

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            changelog.html
            core/src/main/java/hudson/model/View.java
            core/src/main/java/hudson/model/ViewGroupMixIn.java
            core/src/main/java/hudson/security/AuthorizationStrategy.java
            core/src/main/resources/hudson/model/Messages.properties
            http://jenkins-ci.org/commit/jenkins/85e13303f8cfbebeb7dab347fda8ccf4069070b6
            Log:
            [FIXED JENKINS-3681] Added View.READ permission.

            The trick for backward compatibility is in the default implementation
            that grants View.READ to those who have access to items.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/model/View.java core/src/main/java/hudson/model/ViewGroupMixIn.java core/src/main/java/hudson/security/AuthorizationStrategy.java core/src/main/resources/hudson/model/Messages.properties http://jenkins-ci.org/commit/jenkins/85e13303f8cfbebeb7dab347fda8ccf4069070b6 Log: [FIXED JENKINS-3681] Added View.READ permission. The trick for backward compatibility is in the default implementation that grants View.READ to those who have access to items.
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #1628
            [FIXED JENKINS-3681] Added View.READ permission. (Revision 85e13303f8cfbebeb7dab347fda8ccf4069070b6)

            Result = SUCCESS
            Kohsuke Kawaguchi : 85e13303f8cfbebeb7dab347fda8ccf4069070b6
            Files :

            • changelog.html
            • core/src/main/java/hudson/model/View.java
            • core/src/main/java/hudson/security/AuthorizationStrategy.java
            • core/src/main/resources/hudson/model/Messages.properties
            • core/src/main/java/hudson/model/ViewGroupMixIn.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #1628 [FIXED JENKINS-3681] Added View.READ permission. (Revision 85e13303f8cfbebeb7dab347fda8ccf4069070b6) Result = SUCCESS Kohsuke Kawaguchi : 85e13303f8cfbebeb7dab347fda8ccf4069070b6 Files : changelog.html core/src/main/java/hudson/model/View.java core/src/main/java/hudson/security/AuthorizationStrategy.java core/src/main/resources/hudson/model/Messages.properties core/src/main/java/hudson/model/ViewGroupMixIn.java
            dogfood dogfood added a comment -

            Integrated in jenkins_ui-changes_branch #21
            [FIXED JENKINS-3681] Added View.READ permission. (Revision 85e13303f8cfbebeb7dab347fda8ccf4069070b6)

            Result = SUCCESS
            Kohsuke Kawaguchi : 85e13303f8cfbebeb7dab347fda8ccf4069070b6
            Files :

            • core/src/main/java/hudson/model/ViewGroupMixIn.java
            • core/src/main/resources/hudson/model/Messages.properties
            • core/src/main/java/hudson/security/AuthorizationStrategy.java
            • changelog.html
            • core/src/main/java/hudson/model/View.java
            dogfood dogfood added a comment - Integrated in jenkins_ui-changes_branch #21 [FIXED JENKINS-3681] Added View.READ permission. (Revision 85e13303f8cfbebeb7dab347fda8ccf4069070b6) Result = SUCCESS Kohsuke Kawaguchi : 85e13303f8cfbebeb7dab347fda8ccf4069070b6 Files : core/src/main/java/hudson/model/ViewGroupMixIn.java core/src/main/resources/hudson/model/Messages.properties core/src/main/java/hudson/security/AuthorizationStrategy.java changelog.html core/src/main/java/hudson/model/View.java
            salsa Sami Salonen added a comment -

            This change introduces a small side effect. I use Sectioned View plugin to create a view, which does not contain projects, but informative content in textual format like FAQs, announcements, etc. With this change, this "info view" became unavailable for end users.

            As a workaround I added a List View section with one project to the bottom of the view. I also removed all columns from the section. This leaves two empty bars at the end of the view. It does not look pretty, but at least the view is visible to end users again.

            Jenkins version is 1.460.

            salsa Sami Salonen added a comment - This change introduces a small side effect. I use Sectioned View plugin to create a view, which does not contain projects, but informative content in textual format like FAQs, announcements, etc. With this change, this "info view" became unavailable for end users. As a workaround I added a List View section with one project to the bottom of the view. I also removed all columns from the section. This leaves two empty bars at the end of the view. It does not look pretty, but at least the view is visible to end users again. Jenkins version is 1.460.

            People

              Unassigned Unassigned
              rnell rnell
              Votes:
              6 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: