fix(SW-2887): don't disable the booking button
The complete button shouldn’t be disabled based on validation. This was already correct in desktop, but now it’s also correct in mobile.
* fix(SW-2887): don't disable the booking button
Approved-by: Tobias Johansson
Approved-by: Christian Andolf
fix(SW-2625): set correct submitting status when validation fails
* fix(SW-2625): set correct submitting status when validation fails
Approved-by: Bianca Widstam
fix(SW-2501): validation trigger
* fix(SW-2501): validation trigger
On enter details, when submitting we want to trigger the validation for
the details forms for each room. This will display error messages for
the form fields with errors if they are not already displayed, so the
user knows which fields has errors.
Approved-by: Tobias Johansson
Fix/SW-2462 room availability error
* fix: added toast error when availability fails and you get redirect to select-rate
* fix: added support for showing alert when availability error happens
* fix: rename PaymentAlert -> BookingAlert
Approved-by: Erik Tiekstra
fix(sw-2501): remove the continue buttons on enter details
This removes the continue buttons on the enter details page.
This is only that, not the refactoring of the whole enter details page with changing to one form etc. Since I just didn’t complete that refactor today I decided to do this light variant for now.
A quick explanation is that the continue buttons are removed and instead the form is submitted (meaning saving the form data to the store) on blur on the input elements IF the form is valid. If it’s invalid we change the isComplete flag in the store to false. This will hopefully also fix a bug where you were able to submit old data if the new data is invalid.
When clicking the submit button and a room is incomplete/invalid the browser scrolls to the first invalid room.
Approved-by: Erik Tiekstra
Refactor(SW-2177): Use react aria RadioGroup & Radio for payment options
* fix(SW-SW-2177): enhance accessibility for payment options
* Added keyboard navigation support to payment options.
* Updated CSS to improve focus styles for payment option labels.
* refactor: use RadioGroup & Radio from react aria for payment options
* refactor(SW-2177): replace setValue and watch with useController for payment method handling
* fix(SW-2177): remove comment and use cx for styles on PaymentOption
* fix(SW-2177): Add keyboard focus indicator to payment option
Approved-by: Michael Zetterberg
Approved-by: Erik Tiekstra
fix: small design fix, fix bug that redirects to planet, add translations
* fix: small design fix, fix bug that redirects to planet, add translations
* fix: if user does not have enough points, default quantitywithcard to 1
* fix: fix pr comment
Approved-by: Linus Flood
Approved-by: Matilda Landström
Feat/SW-1149 handle status polling
* feat(SW-1149): move terms and conditions sections to separate component and added copy
* feat(SW-1149): Added client component to handle success callback for payment flow
* fix: check for bookingCompleted status as well
* feat(SW-1587): use alert instead of toast for showing payment errors
* fix: added enum for payment callback status
* fix: proper way of checking for multiple statuses
* fix: update schema type
* fix: use localised link to customer service
* fix: update to use enum for status strings
Approved-by: Arvid Norlin
feat(SW-1078): mixed rate scenario
* feat(SW-1078): mixed rate scenario
* fix: change from css string modification to array join
* refactor: split out big reduce function into smaller parts
* fix: minor fixes and improvments
* fix: added room index map to localization string
Approved-by: Christian Andolf
Feat/SW-1076 no room availability
* fix: update booking error codes
* feat(SW-1076): handle no room availabilty on enter-details
* fix: parse to json in api mutation instead of expecting json
* fix: remove 'isComplete' state from sectionAccordion because it was not needed
Approved-by: Simon.Emanuelsson
fix: allow rates that only have either of member or public to be selectable
* fix: allow rates that only have either of member or public to be selectable
Approved-by: Michael Zetterberg
Migrate to a monorepo setup - step 1
* Move web to subfolder /apps/scandic-web
* Yarn + transitive deps
- Move to yarn
- design-system package removed for now since yarn doesn't
support the parameter for token (ie project currently broken)
- Add missing transitive dependencies as Yarn otherwise
prevents these imports
- VS Code doesn't pick up TS path aliases unless you open
/apps/scandic-web instead of root (will be fixed with monorepo)
* Pin framer-motion to temporarily fix typing issue
https://github.com/adobe/react-spectrum/issues/7494
* Pin zod to avoid typ error
There seems to have been a breaking change in the types
returned by zod where error is now returned as undefined
instead of missing in the type. We should just handle this
but to avoid merge conflicts just pin the dependency for
now.
* Pin react-intl version
Pin version of react-intl to avoid tiny type issue where formatMessage
does not accept a generic any more. This will be fixed in a future
commit, but to avoid merge conflicts just pin for now.
* Pin typescript version
Temporarily pin version as newer versions as stricter and results in
a type error. Will be fixed in future commit after merge.
* Setup workspaces
* Add design-system as a monorepo package
* Remove unused env var DESIGN_SYSTEM_ACCESS_TOKEN
* Fix husky for monorepo setup
* Update netlify.toml
* Add lint script to root package.json
* Add stub readme
* Fix react-intl formatMessage types
* Test netlify.toml in root
* Remove root toml
* Update netlify.toml publish path
* Remove package-lock.json
* Update build for branch/preview builds
Approved-by: Linus Flood