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

Merged
merged 1 commit into from
Nov 28, 2024

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.

Copy link
Member

Choose a reason for hiding this comment

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

yep, makes sense now. Also this code will eventually get replaced by the specific hierarchy selector (hopefully)

@brunopagno brunopagno force-pushed the fix/59734-bulk-edit-hierarchy-items branch from 38ef4a7 to f9c9780 Compare November 27, 2024 15:33
@brunopagno brunopagno requested a review from Kharonus November 27, 2024 15:34
@brunopagno brunopagno changed the base branch from dev to release/15.1 November 28, 2024 09:09
@brunopagno brunopagno force-pushed the fix/59734-bulk-edit-hierarchy-items branch from 6e19cc4 to 1963d24 Compare November 28, 2024 10:20
@brunopagno
Copy link
Contributor Author

image

I ran the failed test on CI locally and it worked. I'll assume this is fine

@brunopagno brunopagno merged commit 8a16a68 into release/15.1 Nov 28, 2024
10 of 11 checks passed
@brunopagno brunopagno deleted the fix/59734-bulk-edit-hierarchy-items branch November 28, 2024 10:58
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