Skip to content

Conversation

@KevinDavilaDotCMS
Copy link
Contributor

@KevinDavilaDotCMS KevinDavilaDotCMS commented Jan 29, 2026

2026-01-29.13-16-07.mov

This PR fixes: #34425

This PR fixes: #34425

…nd movement

This commit enhances the EditEmaEditorComponent by adding functionality to check and reset the active contentlet when it is deleted or moved. Key changes include:

- Introduced a private method  to verify if the active contentlet still exists in the page containers.
- Updated the component's logic to call this method during contentlet deletion and movement operations.
- Enhanced unit tests to cover the new behavior, ensuring that the active contentlet is reset appropriately when it is no longer present.

This update improves the reliability of contentlet management within the editor, ensuring that the UI state remains consistent with the underlying data model.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #34425 where deleted contentlets would reappear in the UVE when the Style Editor form remained open. The solution adds logic to detect when the active contentlet being edited has been deleted or moved to a different container, and automatically resets the active contentlet state, which causes the Style Editor form to close/hide.

Changes:

  • Added resetActiveContentlet() method to the store to clear the active contentlet state
  • Implemented #checkAndResetActiveContentlet() helper method that verifies if the active contentlet still exists in its original container
  • Integrated the check into delete, move, and temp insert operations to ensure the Style Editor closes appropriately
  • Added comprehensive test coverage for delete and move scenarios

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
core-web/libs/portlets/edit-ema/portlet/src/lib/store/features/editor/withEditor.ts Adds resetActiveContentlet() method to reset the active contentlet state, and alphabetically reorders imports
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts Implements #checkAndResetActiveContentlet() method and calls it after delete/move/temp insert operations; alphabetically reorders imports
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.spec.ts Adds comprehensive tests covering delete and move scenarios for the active contentlet reset functionality; alphabetically reorders imports

@KevinDavilaDotCMS KevinDavilaDotCMS added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit 5bac61c Jan 29, 2026
24 of 25 checks passed
@KevinDavilaDotCMS KevinDavilaDotCMS deleted the 34425-defect-deleted-contentlet-reappears-in-uve-when-style-editor-form-remains-open branch January 29, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[DEFECT] Deleted Contentlet Reappears in UVE When Style Editor Form Remains Open

4 participants