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

enable ordering work packages by hierarchy items #17304

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

brunopagno
Copy link
Contributor

@brunopagno brunopagno commented Nov 28, 2024

Ticket

https://community.openproject.org/wp/59766

What are you trying to accomplish?

Enable ordering by custom field hierarchies on work packages

Screenshots

Screencast.From.2024-11-29.08-25-21.mp4

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@brunopagno brunopagno self-assigned this Nov 28, 2024
@brunopagno brunopagno force-pushed the impl/59766-ordering-for-wp-hierarchy-item branch from 9cdcae9 to a03aec8 Compare November 29, 2024 09:36
@brunopagno brunopagno marked this pull request as ready for review November 29, 2024 09:36

def join_for_order_by_hierarchy_sql
table_name = CustomField::Hierarchy::Item.quoted_table_name
join_for_order_sql(value: "item.label", join: "INNER JOIN #{table_name} item ON item.id = cv.value::bigint")
Copy link
Member

Choose a reason for hiding this comment

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

⚠️ Do I read this correctly, that this is now sorted by label (as it is joined into the values table). So we should keep that in mind, whenever we decide to change the display representation in the wp table view. (e.g. no longer starting with the label, but some shorts of ancestors).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just implemented the simples possible way forward.

To be fair this could also be extended to handle multi values... I think it's fair to bring to discussion.

@brunopagno brunopagno force-pushed the impl/59766-ordering-for-wp-hierarchy-item branch from a03aec8 to 441f320 Compare November 29, 2024 12:26
@brunopagno
Copy link
Contributor Author

image

Flaky test looks green locally on the branch

@brunopagno brunopagno merged commit b146420 into dev Nov 29, 2024
10 of 11 checks passed
@brunopagno brunopagno deleted the impl/59766-ordering-for-wp-hierarchy-item branch November 29, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants