aem-core-wcm-components
aem-core-wcm-components copied to clipboard
[Accordion] Deleting items resets all changes to dialog
Bug Report
Current Behavior When an item is deleted from the Accordion dialog (and likely other panel containers), the entire dialog is reset to the state of the JCR. This means that all other edits that have been made in the dialog are undone. This also happens if the user cancels the delete when prompted with the "You are going to delete the selected component(s)" warning. If multiple panels have been added, they are all removed.
A secondary, but likely related, issue is that if an author deletes an existing item, but then subsequently cancels the entire edit dialog, the removal of the item is made in the JCR but the component does not refresh. This leads to a mismatch where the author can continue to interact with the deleted panel in the authoring interface until page refresh, but the underlying JCR nodes are already gone.
Expected behavior/code
- Deleting a panel from the Accordion dialog should not reset the rest of the dialog
- Canceling the deletion of a panel from the Accordion dialog should have no effect on the dialog at all
- If an author has deleted a panel but subsequently cancels the entire edit dialog there should be no changes to the component or it's underlying JCR nodes - Authors expect that canceling an edit dialog cancels any edits they may have made.
Environment
- AEM 6.5.14
- Core Components 2.21.0
- JRE version 11
Possible Solution
Not sure, but looking in the childreneditor.js might be a place to start.
Additional context / Screenshots
Reset on panel deletion This video shows the entire Accordion dialog being reset when a panel is deleted.
https://user-images.githubusercontent.com/19987287/190663892-527a79e8-96b5-4c3b-ae2d-fde324d741a1.mp4
Reset on panel deletion cancelled This video shows the entire Accordion dialog being reset when a panel deletion is cancelled.
https://user-images.githubusercontent.com/19987287/190664216-14325f7e-a95d-4e32-b945-11f0bcedaebe.mp4
Panel deleted but dialog cancelled This video shows the mismatch that occurs when a panel is deleted but then the dialog is cancelled.
https://user-images.githubusercontent.com/19987287/190664660-2d115b17-cb10-4f5b-a993-111906a0b9dc.mp4
HI @ky940819, I agree on the items 1 and 2 of your findings. Regarding 3, we recently added the immediate delete action after the confirmation dialog to get https://github.com/adobe/aem-core-wcm-components/issues/2240 fixed. The solution is more a compromise because you need the new ghost placeholder if you want to reorder the child items in the same step.
@adobe export issue to Jira project SITES as Bug
:white_check_mark: Jira issue SITES-9945 is successfully created for this GitHub issue.
:x: Cannot export the issue. This GitHub issue is already linked to Jira issue(s): SITES-9945