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

Allow reservation time to be extended #77

Merged
merged 3 commits into from
Feb 18, 2024

Conversation

starcraft66
Copy link
Member

Sometimes, we want to give gamers additional time on their reservation to finish a match for example. This PR adds a (pretty terrible) user interface to the "Cancellation" page that allows an operator to extend a session by a set amount of minutes as well as cancelling it. The cancellation page should probably be renamed to something more generic like "station management" to reflect this change in functionality.

The new cancellation modal with these changes:
Screenshot 2024-01-24 at 01 23 53

@@ -43,7 +43,8 @@ defmodule Lanpartyseating.ReservationLogic do
"new_reservation",
%{
station_number: station_number,
Copy link
Member Author

Choose a reason for hiding this comment

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

Sneaking in a little change unrelated to the PR to the non-finalized contract between the server and the desktop client. We will tell the client the start and end times of the reservation to allow it to keep track of session expiry internally to make it more robust against lag switching.

Endpoint.broadcast!(
"desktop:all",
"extend_reservation",
%{
Copy link
Member Author

Choose a reason for hiding this comment

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

Same contract as above to notify the desktop client that the session has been extended.

@@ -74,11 +74,29 @@ defmodule CancellationModalComponent do
"%H:%M"
) %> *REPLACE WITH COUNTDOWN*</b>
</p>
<p class="py-4">Enter a reason for canceling the reservation</p>
<form method="dialog">
<button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button>
</form>

Copy link
Member Author

Choose a reason for hiding this comment

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

Really not my proudest UI work but it's good enough to get this feature started. I'm hoping @luxor37 will have the willpower to redesign this into something nicer :trollface:

@starcraft66 starcraft66 marked this pull request as ready for review January 24, 2024 06:38
@starcraft66 starcraft66 merged commit d91efb3 into master Feb 18, 2024
1 check passed
@berbiche berbiche deleted the feature/tgh/extend-reservations branch February 18, 2024 23:43
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.

3 participants