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

Avoid reservation if the User is not logged. #105

Merged
merged 8 commits into from
Aug 15, 2024

Conversation

Diegogagan2587
Copy link
Owner

@Diegogagan2587 Diegogagan2587 commented Aug 12, 2024

implement suggested changes in #60

Implemented Changes:

  • Reserve button redirects to the login page if the user is not logged in and updates user message to Please login before reserve
  • userSlice.js
    • uses the optional chaining operator in the selectUserID selector to avoid problems if a given property is not found on the state object.
    • include the setUserMessage reducer
  • Login Page shows the alert suggesting the user to log in before creating a reservation.
    • To See de alert:
      1. Open the project in your browser
      2. Click on any Concert
      3. Click on the reserve button, this action will redirect you to the Login page.
      4. Now you should be able to see the Please login to reserve a concert alert.
  • Update tests.
    • Update ItemDatePanel test to match new functionality
    • Add a new test for log in to verify that the Please login to reserve a concert Alert is being rendered.

@Diegogagan2587 Diegogagan2587 linked an issue Aug 12, 2024 that may be closed by this pull request
@Diegogagan2587 Diegogagan2587 marked this pull request as draft August 12, 2024 02:37
@Diegogagan2587 Diegogagan2587 self-assigned this Aug 12, 2024
@Diegogagan2587 Diegogagan2587 added bug Something isn't working enhancement New feature or request labels Aug 12, 2024
@Diegogagan2587 Diegogagan2587 changed the title Avoid Reservatin if use is not logged. Avoid reservation if use is not logged. Aug 12, 2024
@Diegogagan2587 Diegogagan2587 changed the title Avoid reservation if use is not logged. Avoid reservation if the User is not logged. Aug 12, 2024
@Diegogagan2587 Diegogagan2587 marked this pull request as ready for review August 15, 2024 01:13
Copy link
Collaborator

@danifromecuador danifromecuador left a comment

Choose a reason for hiding this comment

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

Hi @Diegogagan2587

Your project is complete! There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉

Highlights

  • Your implemented changes will contribute to improving the UX by automatically redirecting to the login page
  • All tests are passing
  • Descriptive PR
    8yZuEb7q6dlyP3L3cL_1_1

Optional suggestions

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you take them into account as they can make your code better.

You can also consider:

  • [OPTIONAL] None

Cheers, and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification @danifromecuador

@Diegogagan2587 Diegogagan2587 merged commit 2083a2d into development Aug 15, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reserve Should not allow user to reserve without login.
2 participants