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

Fix for bulk editting work packages with hierarchy items #17287

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

Conversation

brunopagno
Copy link
Contributor

Ticket

The link to the ticket number 59734

What are you trying to accomplish?

Fix bulk edit for work packages that have custom fields with format hierarchy

@brunopagno brunopagno self-assigned this Nov 27, 2024
@brunopagno brunopagno force-pushed the fix/59734-bulk-edit-hierarchy-items branch 2 times, most recently from 2655933 to f004989 Compare November 27, 2024 10:11
@brunopagno brunopagno marked this pull request as ready for review November 27, 2024 10:11
@brunopagno brunopagno changed the title WIP implement fix for bulk editting hierarchy items Fix for bulk editting work packages with hierarchy items Nov 27, 2024
@brunopagno brunopagno force-pushed the fix/59734-bulk-edit-hierarchy-items branch from f004989 to 38ef4a7 Compare November 27, 2024 13:14
Copy link
Member

@Kharonus Kharonus left a comment

Choose a reason for hiding this comment

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

Nice, now using the persistence layer makes it more decoupled. 👍🏽

I have one issue regarding code style and excellence. Not a blocker for a merge, but as we still have some time, lets wrap our head shortly around this case.

when "hierarchy"
options = [[I18n.t(:label_no_change_option), ""]]
service = CustomFields::Hierarchy::HierarchicalItemService.new
options += service.get_descendants(item: custom_field.hierarchy_root, include_self: false).value!.map do |item|
Copy link
Member

Choose a reason for hiding this comment

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

🟡 This goes into a direction, we had already on some other places:

is .value! enough for the failure handling? it means: "Throw on failure". So, while the method currently cannot return a failure, this might change in future, the interface is a Result.

Should we have small .either handling here? Maybe raising (as it is now) or returning empty options together with an error log entry?

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 meant to do that when I refactored, but forgot. Adjusted it now.

@brunopagno brunopagno force-pushed the fix/59734-bulk-edit-hierarchy-items branch from 38ef4a7 to f9c9780 Compare November 27, 2024 15:33
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