Adds RelativePositioning concern to WorkItems::ParentLink model
requested to merge 370401-be-work-items-ability-to-reorder-work-items-in-the-child-items-widget into master
What does this MR do and why?
Adds RelativePositioning
to WorkItems::ParentLink
. WorkItems::ParentLink
model already contains both relative_position
and work_item_parent_id
attributes.
This is the first part of MR series to enable the ability to manually reorder children in the Work Items Hierarchy Widget:
- No client-facing change to our REST and GraphQL APIs yet. Database queries introduced are not hitting production. Independent GraphQL mutation will be available soon, see #370401 Task
Implement GraphQL mutation to update the relative position field
for more details. - Makes positioning methods available for
WorkItems::ParentLink
. All of them are used nowhere except RSpec tests. - Extracts a magic number into
items_with_nil_position_sample_quantity
variable insidea class that supports relative positioning
shared examples set. We need to have it configurable becauseWorkItems::ParentLink
validates children quantity and 100 is the current maximum we allow. - No changelog entry, therefore.
In case this change looks too small from your perspective: feel free to close this MR so I can integrate this everything in my upcoming step towards #370401 Task Implement GraphQL mutation to update the relative position field
How to set up and validate locally
1. Local Test scenario
- Create a new Issue:
- Add five tasks to the issue named Task #1 (closed), Task #2 (closed) ... Task #5 (closed).
- Verify new tasks are added to the end of the list, which is consistent behavior.
- Verify nothing is broken.
- Add five tasks to the issue named Task #1 (closed), Task #2 (closed) ... Task #5 (closed).
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #370401 (closed)
Edited by Petro Koriakin