kasancode / gitbucket-label-kanban-plugin

A GitBucket plugin for Kanban style issue management.
Apache License 2.0
46 stars 8 forks source link

[bug] Disable if the project is using an external issue tracker. #10

Closed aadrian closed 4 years ago

aadrian commented 5 years ago

If this plug-in is installed, than all GIT repos will have a board, even those that have the issue tracker disabled and configured to an external URL.

kasancode commented 5 years ago

What is "Issue tracker"? Redmine? I don't use Issue trackers. So I need more information.

And the New Issue page from Kanban board is different to the default New Issue page, because annotate the issue with the lane (label) or priority etc.

Is this behavior related to your issue?

Default New Issue page image

from this button image

New Issue page with Annotation (different url) image

from this button image

aadrian commented 5 years ago

What is "Issue tracker"? Redmine? I don't use Issue trackers. So I need more information.

@kasancode

Your Plug-in displays a Kanban Board of the GitBucket Issues for each GIT project (for all projects) if one installs your plug-in.

GitBucket however has individual project settings that allow to disable the Issues (and optionally specify an external URL for some other Issue Trackers like Redmine, Trac, JIRA, etc).

In this case that project won't have any (internal) issues, so your Kanban Board and Menu Item on the side should be disabled for that project.

kasancode commented 5 years ago

I understood. I'll try to disable the plugin according to the setting.

kasancode commented 5 years ago

I investigated the GitBucket codes.

It is difficult to hide the Kanban link in the side menu. Perhaps, It is required to modify the GitBucket codes.

However, I can display a Warning if someone visits an invalid Kanban page.

aadrian commented 5 years ago

@kasancode If a GIT Project has the Internal Issues disabled, than in the table repository the column issues_option has the value DISABLE . In the corresponding model, for that project, the entity Repository has the field issuesOption for this.

If the GIT Project is using even an external Issue Tracker, than in the table repository the column EXTERNAL_ISSUES_URL also has a non-null value.

kasancode commented 5 years ago

Yes, I comfirmed related codes. Therefore we can detect the Internal Issue Tracking is desabled or not. But, the menu bar displays all plugin items for each repository under any condition.

https://github.com/gitbucket/gitbucket/blob/master/src/main/twirl/gitbucket/core/menu.scala.html#L61

aadrian commented 4 years ago

@kasancode the menu display can be configured dynamically from inside a plug-in.

The author of GitBucket explained it here: https://gitter.im/gitbucket/gitbucket_dev?at=5e10a1593062aa3e8df4de7f

kasancode commented 4 years ago

Oh, It's working ! Try v3.4.1.

aadrian commented 4 years ago

@kasancode this works great! Thank you very much.