Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide tab-panels if project is on whitelist #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sithera
Copy link

@sithera sithera commented Jan 22, 2018

Fixes #58

@gawlik
Copy link

gawlik commented Jan 22, 2018

Yes, it would be great to have it in the official release!

@@ -94,6 +96,9 @@ public ShowPanelReply showPanel(ShowPanelRequest arg0) {
isShowing = false;
}

if (configuration.getUseGerritProjectWhitelist() && ! isGerritProject(arg0.issue()))
isShowing = false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow surrounding code styles: braces around multi-line if blocks, and no space after !

        if (configuration.getUseGerritProjectWhitelist() && !isGerritProject(arg0.issue())) {
            isShowing = false;
        }

@@ -66,6 +68,9 @@ public ShowPanelReply showPanel(ShowPanelRequest request) {
if (isConfigurationReady()) {
Collection<Issue> subtasks = request.issue().getSubTaskObjects();
show = subtasks != null && subtasks.size() > 0;

if (configuration.getUseGerritProjectWhitelist() && ! isGerritProject(request.issue()))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@@ -81,4 +86,12 @@ private boolean isConfigurationReady() {
return configuration != null && configuration.getSshHostname() != null && configuration.getSshUsername() != null
&& configuration.getSshPrivateKey() != null && configuration.getSshPrivateKey().exists();
}

private boolean isGerritProject(final Issue issue) {
if (issue.getProjectId() == null)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

@@ -166,4 +171,12 @@ private void setUsersForChangeApprovals(GerritChange change) {
}
}
}

private boolean isGerritProject(final Issue issue) {
if (issue.getProjectId() == null)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tab-panels are not hidden if project is whitelisted
3 participants