Move the offer card to yoyaku_presentation

Moves the offer card out of yoyaku_calendar and into yoyaku_presentation, and answers the class-name question the issue said had to be settled first.

The call, and why

The picker is not converted. The map's selection panel offers areas by quantity too, but it builds its list in the browser, in a column of a few hundred pixels beside a plan, and a block there carries one area's name over several tariff rows where a card is one offer entire. Dressing those blocks as cards would make the panel a different thing; giving them the card's class names and then overriding every rule in the card's stylesheet would put a lie in it. What the two surfaces really share is the stepper, the queue and the notice, and all three are already named as such. That reasoning is recorded where a reader will next ask it: in venue-map.css, next to the panel's own rules, and in docs/steppers.md.

So the CSS moves as it stands, with its class names unchanged. Nothing a site has already styled stops being styled.

What moved

  • yoyaku_slot_offer becomes yoyaku_offer, in yoyaku_presentation: the theme hook, yoyaku-offer.html.twig, the preprocess and css/offer.css, behind a new yoyaku_presentation/offer library that pulls the stepper in with it. The hook is renamed because the card is not about a slot.
  • The seven #offer_* properties are documented as the card's surface, and they are the whole of it. #offer_show_count is called out in the calendar as the page's own note on the element rather than a card variable.
  • yoyaku_calendar/slot_offer keeps js/offers.js and now depends on yoyaku_presentation/offer, so the behavior can never load without the markup it drives.
  • yoyaku_slot_booking stays in the calendar, as the issue said. Its heading line is dressed by a new css/slot-booking.css attached to the form, which also fixes a latent gap: a slot with nothing on offer draws no card, so it used to be the one thing on the page wearing no styles.

The boundary this closes

yoyaku_booking_fee declares yoyaku_presentation and preprocesses a hook that module owns. Its test now installs no calendar at all, which is the regression guard: against the unfixed code the same test fails four assertions with an empty card, because the mention had nowhere to be printed.

Pre-1.0, so this is a rename with no update path to keep: no shim, and the old library and hook names go in the same commit as the new ones.

Docs and translation

docs/calendar.md gains the card's home, docs/steppers.md gains the card and the decision above, docs/architecture.md and docs/booking-fees.md follow. yoyaku_presentation's description changed with it, so its French was reworded in the same commit rather than being left orphaned.

Verified locally

  • phpcs Drupal and DrupalPractice over the module root: clean, exit 0.
  • phpstan level 1: no errors.
  • stylelint on the moved and new CSS: clean. venue-map.css carries nine pre-existing findings, identical before and after this branch.
  • cspell: nothing outside .cspell-project-words.txt.
  • Kernel, one class per process against a root pointing at this branch: the whole of yoyaku_booking_fee, yoyaku_calendar (including yoyaku_calendar_interaction) and yoyaku_presentation, plus SlotBookingPlacementTest. All green.
  • The reworked FeeOfferMentionTest was seen to fail against the unfixed tree.

The FunctionalJavascript classes that drive the card (OfferStepperTest, SlotBookingPerformanceTest) select on class names this branch does not change; they run here in CI.

Merge request reports

Loading
Loading