Conversation
… field Drag-and-drop reorder on paginated relationship fields was resetting to page 1 because onRowReorder called setData(), which unconditionally resets pagination. Added reorderData() store method that updates data without touching pagination state. Closes #35106
3 tasks
Contributor
|
Rollback Safety Analysis complete. Label AI: Safe To Rollback has been applied. This PR is frontend-only (Angular/TypeScript store method addition + component + tests) with no DB, ES, REST API, or backend changes. No unsafe categories match. |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes relationship-field row drag-and-drop reordering so pagination state (offset/currentPage) is preserved instead of resetting back to page 1, aligning reorder behavior with the existing paginated data rendering approach.
Changes:
- Added a
reorderData()store method to update the backing data array without resetting pagination. - Updated
onRowReorderto usereorderData()(instead ofsetData()), preserving the current page after a reorder. - Added/updated unit tests around
reorderData()and the reorder call site.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/store/relationship-field.store.ts | Adds reorderData() to patch data without touching pagination state. |
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/components/dot-relationship-field/dot-relationship-field.component.ts | Switches reorder persistence from setData() to reorderData() in onRowReorder. |
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/store/relationship-field.store.spec.ts | Adds unit coverage ensuring reorderData() preserves pagination state. |
| core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/dot-edit-content-relationship-field.component.spec.ts | Updates reorder-related expectations to reference reorderData(). |
Fix and re-enable the xdescribe'd component tests: - Add missing DotEditContentStore mock provider - Add async/await to showCreateNewContentDialog tests
adrianjm-dotCMS
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onRowReordercalledsetData()which unconditionally resets pagination offset and currentPage to 0/1reorderData()store method that updates the data array without touching pagination stateCloses #35106
Changes
core-web/.../store/relationship-field.store.tsreorderData()method that patches data without resetting paginationcore-web/.../dot-relationship-field.component.tsonRowReorderto callreorderData()instead ofsetData()core-web/.../store/relationship-field.store.spec.tsreorderData()preserving pagination on page 1 and page 2+core-web/.../dot-edit-content-relationship-field.component.spec.tsreorderData()is calledAcceptance Criteria
Test Plan
Visual Changes
CleanShot.2026-04-10.at.12.28.35.mp4
This PR fixes: #35106