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

DDFLSBP-621 - Make sure to only show blocked modal when logging in #1354

Merged
merged 7 commits into from
Aug 28, 2024

Conversation

Dresse
Copy link
Contributor

@Dresse Dresse commented Jul 30, 2024

Link to issue

https://reload.atlassian.net/browse/DDFLSBP-621

Description

To avoid spamming the user with a popup modal informing the user that they have unpaid fees and are therefore "blocked" on all pages, we add a check to see if the user has just logged in or not.

This way we only show the modal once, and the user can then navigate freely afterwards.

If was suggested that the modal should also be shown whenever the user is trying to reserve a book, but as the button for reserving is "disabled" when a user is blocked, this is already taken care of.

Update 18 Aug

We decided to rewrite the blocked modal functionality because the code was unclear and difficult to maintain.
Furthermore we added that the persisted redux store is cleared upon logout, to make sure that data is not surviving between sessions. In that way other user will not be able to see previous users state. By clearing the persisted data upon logout we also make sure that the same user will be presented with the blocked modal again when logging out and in again.

@spaceo
Copy link
Contributor

spaceo commented Aug 7, 2024

We have decided to implement this differently. That is why I am closing this.

@spaceo spaceo closed this Aug 7, 2024
@spaceo spaceo reopened this Aug 17, 2024
@spaceo spaceo force-pushed the DDFLSBP-621-only-show-blocked-modal-when-reserving branch from 7cf7ea1 to b9d07e3 Compare August 17, 2024 22:48
spaceo added 2 commits August 18, 2024 00:49
Since the cms is handling those cases we do not need to take them into
consideration
Otherwise we will get a missing text error when developing
@spaceo spaceo force-pushed the DDFLSBP-621-only-show-blocked-modal-when-reserving branch 2 times, most recently from f50c504 to 6ea9924 Compare August 17, 2024 22:59
spaceo added 4 commits August 18, 2024 01:23
The initial implementation was unclear and buggy. So we reduced the
amount of states and cleaned up the code.
Make sure that it is remembered across page loads
This has been used in a previous version of the apps but are not in use
anymore.
Make sure that the persisted redux states are cleared before logging
out.
@spaceo spaceo force-pushed the DDFLSBP-621-only-show-blocked-modal-when-reserving branch from 6ea9924 to 89742de Compare August 17, 2024 23:24
@Adamik10 Adamik10 self-requested a review August 19, 2024 09:47
Copy link
Contributor

@Adamik10 Adamik10 left a comment

Choose a reason for hiding this comment

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

We have 1 question in regards to some deleted lines, but otherwise looks gucci.
Also - Cypress tests 🥲

BlockedTypes.automatonBlocked,
BlockedTypes.extendedExclusion,
BlockedTypes.stolen
BlockedTypes.extendedSuspension
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you delete the previous lines?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because the cms is taking care of handling that type of blocked users

@spaceo spaceo requested review from spaceo and removed request for spaceo August 19, 2024 11:51
Since the behaviour has changed we need to update the tests accordingly.
@spaceo spaceo force-pushed the DDFLSBP-621-only-show-blocked-modal-when-reserving branch from 32c8811 to 0fdcae9 Compare August 19, 2024 12:17
@spaceo spaceo merged commit f140c26 into develop Aug 28, 2024
20 checks passed
@spaceo spaceo deleted the DDFLSBP-621-only-show-blocked-modal-when-reserving branch August 28, 2024 07:18
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.

5 participants