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

fix(edit-content): Reset UI state when navigating between portlets #31410

Merged
merged 6 commits into from
Feb 20, 2025

Conversation

oidacra
Copy link
Member

@oidacra oidacra commented Feb 18, 2025

Introduced a utility function to initialize the content edit session storage with default values while preserving the sidebar open state. This ensures a clean UI state when switching between different portlets and prevents potential state-related issues.

This pull request introduces several changes aimed at improving the handling of UI state in the edit-content module by switching from localStorage to sessionStorage and adding a new utility function. The most important changes include importing and using the initContentEditSessionStorage function, modifying how the UI state is managed, and adding tests for the new functionality.

Improvements to UI state management:

Testing enhancements:

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 **

This PR fixes: #31232

Introduced a utility function to initialize the content edit session storage with default values while preserving the sidebar open state. This ensures a clean UI state when switching between different portlets and prevents potential state-related issues.
Copy link

Please use a Conventional Commit title format for this PR. For more information, see https://www.conventionalcommits.org/en/v1.0.0/

Move UI_STORAGE_KEY to dotcms-models and simplify content edit session storage initialization by directly removing the stored UI state when navigating between portlets
…rvices

- Updated unit tests for DotEditContentSidebarComponent to use fakeAsync
- Added comprehensive mocking of services for content initialization
- Modified test cases to simulate content loading and UI state changes
- Switched from localStorage to sessionStorage in function utility tests
@hmoreras hmoreras enabled auto-merge February 20, 2025 13:55
@hmoreras hmoreras added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit e754349 Feb 20, 2025
22 checks passed
@hmoreras hmoreras deleted the 31232-iqa-fix-comments branch February 20, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit Mode: Tab Selection Resets After Action, Does Not Persist Current Tab
3 participants