Fix moving items down in the epic tree
What does this MR do?
The easiest way is to explain this problem and fix on an example:
We have following items in epic tree:
- 0 epic1
- 1 epic2
- 2 epic3
- 3 epic4
When we move epic4 before epic2, oldIndex
is 3, newIndex
is 1, current item on index 1 is epic2 and the epic2 will be AFTER the epic1. This was working fine.
When we move epic1 before epic4, oldIndex
is 0, newIndex
is 2, current item on index 2 is epic3 and the epic3 will be BEFORE the epic1.
We have to distinguish this case and set before
as relative position in this case.
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Closes #35532 (closed)