fix: Enhance state management with reset methods and logout functionality improvements (#7234)

* feat: add resetStore method to foldersStore for state management

✨ (foldersStore.tsx): Implement resetStore function to clear folders and reset related state variables, enhancing state management capabilities.

* feat: add resetStore method to flowsManagerStore for improved state management

✨ (flowsManagerStore.ts): Implement resetStore function to clear flows and reset related state variables, enhancing the store's state management capabilities.

* feat: add resetFlowState method to flowStore for enhanced state management

✨ (flowStore.ts): Implement resetFlowState function to clear and reset the flow-related state variables, improving the management of flow state in the application.

* feat: enhance logout functionality with state resets and query invalidation

✨ (use-post-logout.ts): Update the useLogout function to reset flow, flows manager, and folder states upon successful logout. Additionally, invalidate and remove related queries to ensure data consistency in the application.

* test: add user flow state cleanup test for session management

✨ (user-flow-state-cleanup.spec.ts): Implement a comprehensive test to verify that user flow states are properly cleaned up between sessions. The test includes user creation, flow management, and ensures that the admin cannot see user-specific flows after logout, enhancing the robustness of session handling in the application.

* refactor: streamline logout query management in useLogout function

🔧 (use-post-logout.ts): Remove redundant query removal calls in the useLogout function, focusing on invalidating queries to maintain data consistency post-logout. This change simplifies the logout process and enhances code clarity.

* 🔧 (user-flow-state-cleanup.spec.ts): remove unnecessary verification step for admin empty state to improve test readability and efficiency

* ✨ (user-flow-state-cleanup.spec.ts): improve user flow state cleanup test by adding error handling for clicking on new project button and new flow button to ensure test stability and reliability

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
This commit is contained in:
Gabriel Luiz Freitas Almeida 2025-03-24 11:33:08 -03:00 • committed by GitHub
commit a19ea7b5c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 214 additions and 2 deletions

View file

@ -706,7 +706,6 @@
},
"node_modules/@clack/prompts/node_modules/is-unicode-supported": {
"version": "1.3.0",
"extraneous": true,
"inBundle": true,
"license": "MIT",
"engines": {