https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41129

--- Comment #50 from Paul Derscheid <[email protected]> ---
Created attachment 200582
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200582&action=edit
Bug 41129: Add BookingFlatpickr wrapper and booking calendar composable

- Add BookingFlatpickr.vue, a Vue 3 flatpickr wrapper
  that handles single/range/end-date-only modes, soft and hard
  severity disabling, range preview, viewport tracking, Koha-
  configured display format detection, and dynamic l10n bundle
  loading for the current HTML lang; exposes clear, setDate,
  instance, and inputElement via defineExpose
- Do not reuse the existing components/FlatPickrWrapper.vue: it is a
  thin shell over the global flatpickr_defaults (calendar.inc) wired
  in dynamically by the form framework (base-element.js) and offers
  no hook for per-day disabling/markers, range preview, or viewport
  tracking, plus a string (not Date) value model; extending it would
  couple that shared form-widget to booking concerns
- Add useBookingCalendarMaps composable that translates booking-
  domain refs (bookings, checkouts, item, period, rules) into the
  disabledFn / disabledByDate / markersByDate / classByDate /
  rangePreviewFn / loanBoundaryTimes maps the wrapper consumes,
  clamping the constrained range with findFirstBlockingDate
- Add the BookingFlatpickr component spec covering single, range,
  end-date-only, hover preview, anchor-aware highlighting, hard
  and soft disabling, markers and custom markerRenderer,
  classByDate, external value, viewport, ready-event payload,
  and the exposed surface
- Add the useBookingCalendarMaps component spec using a renderless
  ComposableHost that exposes the composable's outputs for direct
  inspection of disabledByDate / markersByDate / classByDate /
  rangePreviewFn / loanBoundaryTimes / end-date-only behavior,
  plus three DOM smoke tests against BookingFlatpickr confirming the
  outputs still slot into the picker's prop contract
- Add Cypress support helpers: component.ts (dayjs global, String
  format shim, console-hooks wiring), console-hooks.js (shared
  console.warn-throws guard preserving Error stack/message across
  the cross-realm boundary), vue-select.js (component test helpers)

Test plan:
1. Run the component suites added here:
   npx cypress run --component --browser electron \
     --spec
't/cypress/component/BookingFlatpickr_spec.ts,t/cypress/component/useBookingCalendarMaps_spec.ts'
2. The wrapper is not mounted on any staff page until the booking
   modal patch; manual calendar coverage is part of that patch's
   test plan (steps 14-20 and 39-41)

Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Assisted-by: Opus 4.8 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to