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

Enable Drag and Drop to Reorder Items in the Relationship Field Table #31383

Closed
nicobytes opened this issue Feb 13, 2025 · 3 comments · Fixed by #31389
Closed

Enable Drag and Drop to Reorder Items in the Relationship Field Table #31383

nicobytes opened this issue Feb 13, 2025 · 3 comments · Fixed by #31389

Comments

@nicobytes
Copy link
Contributor

Parent Issue

#30495

User Story

As a content manager,
I want to reorder items in the Relationship Field table using drag-and-drop,
so that I can customize and save the order according to my preferences, ensuring it reflects correctly when the page is reloaded.

Image

Acceptance Criteria

  1. Users can drag and drop table rows to change their order.
  2. The new order is saved when the user clicks the “Save” button.
  3. The reordered list is displayed in the same order when the page is reloaded.
  4. Visual feedback is provided while dragging items to enhance the user experience.

Proposed Objective

Core Features

Proposed Priority

Priority 3 - Average

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

Copy link

@nicobytes
Copy link
Contributor Author

Notes QA:

darg-drop.mp4

github-merge-queue bot pushed a commit that referenced this issue Feb 15, 2025
### Parent Issue

#31383 

### Proposed Changes

This pull request includes several changes to the
`dot-edit-content-relationship-field` component and its associated store
and tests. The primary focus is on simplifying the data handling methods
and updating the UI for better consistency.

Changes to UI elements:

* Updated the drag handle icon in the template from a font-awesome icon
to a material icon for better visual consistency
(`dot-edit-content-relationship-field.component.html`).

Changes to data handling methods:

* Replaced the usage of `addData` and `reorderData` methods with
`setData` method to streamline data updates
(`dot-edit-content-relationship-field.component.ts`).
[[1]](diffhunk://#diff-5cb2225620beb3baaf219cbfa2241aa934812de8ece62e1d4f7e7747f5f15416L262-R262)
[[2]](diffhunk://#diff-5cb2225620beb3baaf219cbfa2241aa934812de8ece62e1d4f7e7747f5f15416L275-R275)
* Removed the `addData` and `reorderData` methods from the store,
consolidating data updates into the `setData` method
(`relationship-field.store.ts`).
[[1]](diffhunk://#diff-a2c980da63c75c9dc2cd899475beab89cb79492b1dc0819574fc380e856e7ed1L78-R77)
[[2]](diffhunk://#diff-a2c980da63c75c9dc2cd899475beab89cb79492b1dc0819574fc380e856e7ed1L101-L122)

Changes to tests:

* Removed tests related to the `addData` and `reorderData` methods since
these methods are no longer used (`relationship-field.store.spec.ts`).
[[1]](diffhunk://#diff-d2a9a6233c2b1ba38c683725d2e68092978e7023e9269dbabab2fcdfa47224e2L97-L103)
[[2]](diffhunk://#diff-d2a9a6233c2b1ba38c683725d2e68092978e7023e9269dbabab2fcdfa47224e2L133-L193)

### Checklist
- [ ] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **
@github-project-automation github-project-automation bot moved this from In Review to Done in dotCMS - Product Planning Feb 15, 2025
@nicobytes nicobytes moved this from Done to QA in dotCMS - Product Planning Feb 15, 2025
@hmoreras hmoreras self-assigned this Feb 18, 2025
@hmoreras
Copy link
Contributor

Pass QA relationships can be re-order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment