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

Seats: availability management, booking flow, search filter #502

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

Gnito
Copy link
Contributor

@Gnito Gnito commented Nov 12, 2024

This PR adds possibility to use multiple seats.
It also changes the UI for weekly calendar on EditListingAvailabilityManagement.

Note: we won't merge this before holiday season is over.

Availability management

The design of the Availability management tab on EditListingWizard is going to change a bit:

Default schedule ("oneSeat"):
Screenshot 2024-11-15 at 13 18 05

Default schedule ("multipleSeats"):
Screenshot 2024-11-15 at 13 19 01

Weekly calendar has a bigger change, we moved towards a single flow of availability slots. I.e. AvailabilityExceptions are shown in the location where they belong to, when compared to plan (default schedule).

Weekly calendar ("oneSeat"):
Screenshot 2024-11-15 at 13 17 08

Weekly calendar ("multipleSeats"):
Screenshot 2024-11-15 at 13 13 32

Booking with seats

If seats are enabled via assets, users can input a number of seats they want to book in transaction processes using the default-booking process.

This introduces major changes to:

  • BookingDatesForm
  • BookingTimeForm

In addition, smaller changes are introduced to the InboxPage, CheckoutPage and how line items are calculated server side.

image

If the seatsEnabled parameter evaluates to true, line-item calculations will default to 1 seat (even if no seat value is passed). seatsEnabled evaluates to true if:

const seatsEnabled = [AVAILABILITY_MULTIPLE_SEATS].includes(listingTypeConfig?.availabilityType);

Seats filter

This PR adds new components. There is a new FieldNumberInput component, as well as a new SeatsFilter component that uses FieldNumberInput. The SeatsFilter component has been implemented on both search pages:

  • SearchPageWithGrid uses SeatsFilter as a plain component
seats-filter-plain
  • SearchPageWithMap uses SeatsFilter as a popup component
seats-filter-popup

This PR also prepares the codebase to use a hosted configuration for seats filtering, once the feature is released in Console.

Translations

New translation keys

  "BookingDatesForm.seatsPlaceholder": "Select...",
  "BookingDatesForm.seatsTitle": "Number of seats",
  "BookingTimeForm.seatsPlaceholder": "Select...",
  "BookingTimeForm.seatsTitle": "Number of seats",
  "EditListingAvailabilityPanel.WeeklyCalendar.exception": "Exception: {exception}",
  "EditListingAvailabilityPanel.WeeklyCalendar.seats": "{seats, plural, one {{seats} seat} other {{seats} seats}}",
  "EditListingAvailabilityPlanForm.selectTime": "Select time",
  "FieldSeatsInput.numberTooBig": "The number must be less than or equal to {max}",
  "FieldSeatsInput.numberTooSmall": "The number must be greater than or equal to {min}",
  "FieldSeatsInput.seatsError": "This field is required",
  "FieldSeatsInput.seatsLabel": "Seats",
  "FieldSeatsInput.seatsPlaceholder": "Seats",
  "FilterComponent.seatsLabel": "Seats",
  "InboxPage.seats": "Number of seats: {seats}",
  "NumberInput.decrementButton": "Decrement the value by one",
  "NumberInput.incrementButton": "Increment the value by one",
  "OrderBreakdown.baseUnitDaySeats": "{unitPrice} x {quantity, number} {quantity, plural, one {day} other {days}} x { seats, number } { seats, plural, one {seat} other {seats} }",
  "OrderBreakdown.baseUnitNightSeats": "{unitPrice} x {quantity, number} {quantity, plural, one {night} other {nights}} x { seats, number } { seats, plural, one {seat} other {seats} }",
  "OrderBreakdown.baseUnitHourSeats": "{unitPrice} x {quantity, number} {quantity, plural, one {hour} other {hours}} x { seats, number } { seats, plural, one {seat} other {seats} }",
  "SeatsFilter.labelSelected":"Seats: {seatCount}",

Note: FieldSeatsInput: min = 0, max is 9007199254740991 aka Number.MAX_SAFE_INTEGER

Deleted translation keys

  "EditListingAvailabilityPanel.WeeklyCalendar.exceptions": "Exceptions",

@Gnito Gnito force-pushed the seats branch 3 times, most recently from 53948b8 to 12b4c06 Compare November 13, 2024 19:27
@Gnito Gnito force-pushed the seats branch 2 times, most recently from e6a3d5a to 0c4fcec Compare November 14, 2024 16:33
@Gnito Gnito changed the title Seats: work-in-progress Seats: work-in-progress (availability management) Nov 28, 2024
@Gnito Gnito changed the title Seats: work-in-progress (availability management) Seats: (wip) availability management Dec 4, 2024
@Gnito Gnito changed the title Seats: (wip) availability management Seats: availability management Dec 5, 2024
@Gnito Gnito changed the title Seats: availability management Seats: availability management, booking flow Dec 20, 2024
@Gnito Gnito changed the title Seats: availability management, booking flow Seats: availability management, booking flow, search filter Dec 20, 2024
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