Skip to content

Fix unload resources at logout#11480

Merged
allyoucanmap merged 2 commits intogeosolutions-it:masterfrom
stefanocudini:11459-fix-unload-resources-on-logout
Sep 16, 2025
Merged

Fix unload resources at logout#11480
allyoucanmap merged 2 commits intogeosolutions-it:masterfrom
stefanocudini:11459-fix-unload-resources-on-logout

Conversation

@stefanocudini
Copy link
Member

@stefanocudini stefanocudini commented Sep 15, 2025

fix issue #11459

Define new actions, reducers, epic in the plugin ResourcesCatalog.
around the action LOGOUT, introduce new action UNLOAD_RESOURCES triggered to clear the state section that refers to the selected resource for unlogged users, clear this state sections:
resources.initialSelectedResource
resources.selectedResource
This new feature fixes some issues related to inconsistency state for non-logged in users.

Includes also a patch that hides the edit/save button in the info panel for non-logged users (this is based on the user's logged condition because the canEdit field is not enough to hide the button, the resource canCopy field for public resources override the canEdit condition (see details in the linked issues)
(previous exposed here: #11459 (comment))

  • added new epic unloadResources in ResourcesCatalog
  • added unit test for resources epic
  • hide save button in infopanel for no-logged users

Description

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?
#11459

What is the new behavior?

Hides the correct items after on logout.

pixes.mp4

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@stefanocudini stefanocudini self-assigned this Sep 15, 2025
@stefanocudini stefanocudini linked an issue Sep 15, 2025 that may be closed by this pull request
1 task
@stefanocudini stefanocudini added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Sep 15, 2025
@stefanocudini stefanocudini added this to the 2025.01.02 milestone Sep 15, 2025
@stefanocudini stefanocudini force-pushed the 11459-fix-unload-resources-on-logout branch 3 times, most recently from e0b654a to 9e39759 Compare September 15, 2025 14:58
@stefanocudini stefanocudini marked this pull request as draft September 15, 2025 15:13
@stefanocudini stefanocudini force-pushed the 11459-fix-unload-resources-on-logout branch from 9e39759 to eb35417 Compare September 15, 2025 15:54
added new epic unloadresources in ResourcesCatalog

added unit test for resources epic

hide save button in infopanel for no-logged users
@stefanocudini stefanocudini force-pushed the 11459-fix-unload-resources-on-logout branch from eb35417 to bc3d1b8 Compare September 15, 2025 15:56
@stefanocudini stefanocudini marked this pull request as ready for review September 15, 2025 16:05
Copy link
Contributor

@allyoucanmap allyoucanmap left a comment

Choose a reason for hiding this comment

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

There are few issues already solved in this commit dfe2022 . I'm including description for future testing:

  • if the details panel is open on logout the content will be empty. The proposed solution is to close the panel on logout.
logout-empty-panel.mp4
  • the details panel does not update on login (in the video we expect also permissions and details for admin user). The proposed solutions is to apply same workflow as we added for logout to login success process
login-no-permissions.mp4

@allyoucanmap allyoucanmap merged commit 3b0dffd into geosolutions-it:master Sep 16, 2025
6 checks passed
@allyoucanmap
Copy link
Contributor

@ElenaGallo please test this fix on dev and let us know if we can backport to 2025.01.xx, thanks

@ElenaGallo
Copy link
Contributor

Test passed, @stefanocudini please backport to 2025.01.xx. Thanks

allyoucanmap added a commit to allyoucanmap/MapStore2 that referenced this pull request Sep 17, 2025
---------

Co-authored-by: allyoucanmap <stefano.bovio@geosolutionsgroup.com>
@allyoucanmap allyoucanmap removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Sep 17, 2025
allyoucanmap added a commit that referenced this pull request Sep 17, 2025
---------

Co-authored-by: Stefano Cudini <stefano.cudini@gmail.com>
@stefanocudini
Copy link
Member Author

@ElenaGallo please test this fix on dev and let us know if we can backport to 2025.01.xx, thanks

@ElenaGallo during my absence, it was backported here: #11491

@tdipisa tdipisa added the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Sep 22, 2025
@tdipisa tdipisa removed the BackportNeeded Commits provided for an issue need to be backported to the milestone's stable branch label Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue on top bar and Permission panel for anonymous user and normal user

4 participants