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

add/remove label on kanban column change #28745

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iminfinity
Copy link

@iminfinity iminfinity commented Jan 9, 2024

add/remove label on kanban column change

the idea is each column in a kanban can have a labelId attached to it
and everytime an issue is moved to a new column that label is added to the issue(and the other label attached is removed)
this does not affect other labels that may be present in the issue

resolves #26704

Screencast.from.09-01-24.webm

PR sponsored by Obmondo.com

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 9, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 9, 2024
@iminfinity iminfinity changed the title Draft: add/remove label on kanban column change add/remove label on kanban column change Jan 9, 2024
@techknowlogick techknowlogick marked this pull request as draft January 9, 2024 18:21
@KlavsKlavsen
Copy link

We understand that this will need some adjustments to get merged - but I hope you'll work with us on what to improve - so we can get this feature merged to the benefit of everyone :)

@KN4CK3R
Copy link
Member

KN4CK3R commented Jan 11, 2024

Did not look into much code but I think only adding one label may be not enough. And adding n labels per column needs a different backend structure.

@KlavsKlavsen
Copy link

we add 1 label per column - and remove "the other column labels" - when you switch issue to new column. That way you can search for ALL issues in a certain column (like 'ready' - or what states you want to use for your kanban columns)

We use this for several things - and also the fact that we now get notifications - means our webhook informs when someone moves issues around in kanban

@KN4CK3R
Copy link
Member

KN4CK3R commented Jan 12, 2024

I understand that, but other people may want to add two labels when moving an item. And that would need a totaly different backend structure. Just don't want to see code for just one label merged just to get replaced some weeks later with code for multiple labels.

@KlavsKlavsen
Copy link

Having 2 labels for one state (column) - would seem a very odd requirement. Building the generic "do anything" - someone else did a PR for - but we were not able to make it work - so we opted for the simpler option that IMHO would fit the needs of many.
Later - if someone has the skills and time - I do agree that the "custom" - do any action on kanban column switch feature - should be developed.. But that does not remove the value of the "simple and enough for most usecases" option. - which will be simpler to enable.

@KN4CK3R
Copy link
Member

KN4CK3R commented Jan 12, 2024

would seem a very odd requirement

Column Testing could add test/ui and test/backend to trigger two different groups of people to do something. I don't think that's an odd requirement.

@iminfinity iminfinity marked this pull request as ready for review January 25, 2024 13:03
@@ -55,6 +55,7 @@ type Board struct {
Default bool `xorm:"NOT NULL DEFAULT false"` // issues not assigned to a specific board will be assigned to this board
Sorting int8 `xorm:"NOT NULL DEFAULT 0"`
Color string `xorm:"VARCHAR(7)"`
LabelID int64 `xorm:"DEFAULT 0"`
Copy link
Member

Choose a reason for hiding this comment

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

Only one label is allowed?

Copy link
Member

Choose a reason for hiding this comment

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

And migrations are necessary.

Choose a reason for hiding this comment

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

We did not see the relevance to assign more than 1 label on column change. see just above where I explained it :)
#28745 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow kanban/project board to set labels on column switch
6 participants