Commit Graph

40 Commits

Author SHA1 Message Date
Anton Gunnarsson
4e1cb01b84 Merged in chore/cleanup-after-trpc-migration (pull request #2457)
Chore/cleanup after trpc migration

* Clean up TODOs

* Rename REDEMPTION constant to SEARCH_TYPE_REDEMPTION

* Update dependencies

Remove unused deps from scandic-web
Add missing deps to trpc package

* Update self-referencing imports

* Remove unused variables from scandic-web env

* Fix missing graphql-tag package

* Actually fix

* Remove unused env var


Approved-by: Christian Andolf
Approved-by: Linus Flood
2025-06-30 12:08:19 +00:00
Anton Gunnarsson
bbcabfa0ba Merged in feat/sw-2864-move-hotels-router-to-trpc-package (pull request #2410)
feat (SW-2864): Move booking router to trpc package

* Add env to trpc package

* Add eslint to trpc package

* Apply lint rules

* Use direct imports from trpc package

* Add lint-staged config to trpc

* Move lang enum to common

* Restructure trpc package folder structure

* WIP first step

* update internal imports in trpc

* Fix most errors in scandic-web

Just 100 left...

* Move Props type out of trpc

* Fix CategorizedFilters types

* Move more schemas in hotel router

* Fix deps

* fix getNonContentstackUrls

* Fix import error

* Fix entry error handling

* Fix generateMetadata metrics

* Fix alertType enum

* Fix duplicated types

* lint:fix

* Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package

* Fix broken imports

* Move booking router to trpc package

* Merge branch 'master' into feat/sw-2864-move-hotels-router-to-trpc-package


Approved-by: Linus Flood
2025-06-26 09:02:59 +00:00
Anton Gunnarsson
002d093af4 Merged in feat/sw-2863-move-contentstack-router-to-trpc-package (pull request #2389)
feat(SW-2863): Move contentstack router to trpc package

* Add exports to packages and lint rule to prevent relative imports

* Add env to trpc package

* Add eslint to trpc package

* Apply lint rules

* Use direct imports from trpc package

* Add lint-staged config to trpc

* Move lang enum to common

* Restructure trpc package folder structure

* WIP first step

* update internal imports in trpc

* Fix most errors in scandic-web

Just 100 left...

* Move Props type out of trpc

* Fix CategorizedFilters types

* Move more schemas in hotel router

* Fix deps

* fix getNonContentstackUrls

* Fix import error

* Fix entry error handling

* Fix generateMetadata metrics

* Fix alertType enum

* Fix duplicated types

* lint:fix

* Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package

* Fix broken imports

* Merge branch 'master' into feat/sw-2863-move-contentstack-router-to-trpc-package


Approved-by: Linus Flood
2025-06-26 07:53:01 +00:00
Tobias Johansson
8272327993 Merged in fix/SW-2801-correct-date-formats (pull request #2400)
fix(SW-2801): Added lang specific date formats

* fix(SW-2801): Added lang specific date formats

* fix: wrong type import


Approved-by: Michael Zetterberg
2025-06-25 11:12:28 +00:00
Christian Andolf
c545ed2fe2 Merged in refactor/design-system-divider (pull request #2354)
refactor: move divider to design system

Approved-by: Arvid Norlin
2025-06-13 09:38:10 +00:00
Christian Andolf
9551a629fa refactor: move divider to design system
remove not used variants and duplicate colors
2025-06-13 11:27:50 +02:00
Joakim Jäderberg
180a100140 Merged in fix/SW-2964-hide-booking-code-switcher (pull request #2345)
fix: as a temporary fix hide booking code switcher and add a way to do a search without bookingcode

* fix: as a temporary fix hide booking code switcher and add a way to do a search without bookingcode


Approved-by: Linus Flood
2025-06-13 07:07:22 +00:00
Anton Gunnarsson
03468ad824 Merged in fix/refactor-booking-flow-search-params (pull request #2148)
Fix: refactor booking flow search params

* wip: apply codemod and upgrade swc plugin

* wip: design-system to react 19, fix issues from async (search)params

* Prepare new parse function for booking flow search params

* Prepare serialize function for booking flow search params

* Improve handling of comma separated arrays

* Slightly refactor for readability

* Next abstracts URLSearchParams so handle the abstraction instead

* Refactor booking widget to use new search params parsing

* Rename search param functions

* Refactor select-hotel to use new search param parser

* Use new search params parser in select-rate and details

* Fix hotelId type

* Avoid passing down search params into BookingWidget components

* More updates to use new types instead of SearchParams<T>

* Remove types SelectHotelSearchParams and AlternativeSelectHotelSearchParams

* Fix parseBookingWidgetSearchParams return type

* Add error handling to booking search param parsers

* Fix modifyRateIndex handling in details page

* Clean up

* Refactor booking widget search param serializing to util function

* Move start page booking widget search param parsing to page

* Use new search param serializer in HandleErrorCallback

* Delete convertSearchParamsToObj & convertObjToSearchParams


Approved-by: Michael Zetterberg
2025-06-02 13:38:01 +00:00
Anton Gunnarsson
f46bc8f920 Update @hookform/resolvers
In v5 the zod resolver will automatically infer the type for `useForm`.
It's not recommended to manually specify types.
See https://github.com/react-hook-form/resolvers/releases/tag/v5.0.0
2025-05-22 14:00:39 +02:00
Erik Tiekstra
7becc47fa8 fix(SW-2820): Removed overflow:hidden as it blocks booking widget dropdowns
Approved-by: Linus Flood
2025-05-20 12:38:21 +00:00
Erik Tiekstra
6d8beebaca fix(SW-2820): full width booking widget on startpage when scrolled down
Approved-by: Linus Flood
2025-05-20 08:02:39 +00:00
Michael Zetterberg
fb29df206b feat(SW-2806): booking widget should not be blocked by sitewide alert 2025-05-19 10:07:12 +00:00
Linus Flood
97964408ab Merged in fix/bookingwidget-fixes (pull request #2135)
Fix: (#SW-2663) bookingwidget mobile - Space around, border-radius and correct color on date field

* fix: booking widget mobile - padding around booking widget and date color

* Fixed rounded corners

* Reduced minimum size of column


Approved-by: Joakim Jäderberg
2025-05-16 19:29:44 +00:00
Simon Emanuelsson
0b960200b9 fix: make sure ancillaries also listen to invalidate requests 2025-05-15 07:49:28 +00:00
Erik Tiekstra
211cd5270b Fix/SW-2682 map fixes
* fix(SW-2682): Added overflow-y: hidden to body on destination and hotel map pages
* fix(SW-2682): Added scroll to top functionality on map components with reason why

Approved-by: Matilda Landström
2025-05-14 12:06:41 +00:00
Simon Emanuelsson
c5d4895b6d feat: trigger loading states immediately upon navigation 2025-05-08 15:10:43 +02:00
Christian Andolf
f681fa7675 Merged in chore/replace-corner-radius-variable-with-new (pull request #1943)
chore: replace old border-radius variables with new tokens

Approved-by: Erik Tiekstra
2025-05-05 11:24:48 +00:00
Joakim Jäderberg
5784822a1e Merged in feature/SW-2320-languagebased-hide-for-next-release (pull request #1937)
Language based alternative to HIDE_FOR_NEXT_RELEASE

Approved-by: Anton Gunnarsson
2025-05-05 10:53:28 +00:00
Christian Andolf
d6b70edfa3 chore: replace old border-radius variables with new tokens 2025-05-05 11:11:37 +02:00
Joakim Jäderberg
52c99e8767 Merged in fix/SW-2457-destination-page-search-for-countries (pull request #1873)
* fix: able to search for countries on destinationpage
* fix: filter out only desired types when using autocomplete

Approved-by: Linus Flood
2025-04-29 06:19:25 +00:00
Joakim Jäderberg
213bd2c561 Merged in fix/SW-2427-floating-booking-widget-fullwidth (pull request #1826)
fix: when floating booking widget is sticky let it have white background all the way out. SW-2427

* fix: when floating booking widget is sticky let it have white background all the way out.
Resolves SW-2427

* pr: move styling variants to it's own file


Approved-by: Christian Andolf
2025-04-17 08:56:24 +00:00
Joakim Jäderberg
4e17bf1391 Merged in fix/SW-2314-search-modal-shifting (pull request #1831)
fix: search modal shifted to the right on mobile

Approved-by: Linus Flood
2025-04-17 08:56:02 +00:00
Michael Zetterberg
440e1f92df feat(SW-706): make eslint rule 'formatjs/no-literal-string-in-jsx' pass 2025-04-14 11:30:06 +00:00
Joakim Jäderberg
da07e8a458 Merged in feature/autocomplete-search (pull request #1725)
Feature/autocomplete search

* wip autocomplete search

* add skeletons to loading

* Using aumlauts/accents when searching will still give results
remove unused reducer
sort autocomplete results

* remove testcode

* Add tests for autocomplete

* cleanup tests

* use node@20

* use node 22

* use node22

* merge
fix: search button outside of viewport

* merge

* remove more unused code

* fix: error message when empty search field in booking widget

* fix: don't display empty white box when search field is empty and no searchHistory is present

* merge

* fix: set height of shimmer for search skeleton

* rename autocomplete trpc -> destinationsAutocomplete

* more accute cache key naming

* fix: able to control wether bookingwidget is visible on startPage
fix: sticky booking widget under alert

* remove unused code

* fix: skeletons
fix: error overlay on search startpage

* remove extra .nvmrc

* merge


Approved-by: Linus Flood
2025-04-09 10:43:08 +00:00
Arvid Norlin
39059eb8b2 Merged in fix/SW-2121 (pull request #1747)
SW-2121: Fix issue where closing SidePeeks would trigger other click events

* fix: replace div with Button in BookingWidget to align press events

* fix: replace div with Button in ImageGallery to align press events


Approved-by: Michael Zetterberg
2025-04-07 10:28:51 +00:00
Matilda Landström
1239f0c662 Merged in feat/SW-1711-SW-2077-icons (pull request #1709)
Fix(SW-1711)/(SW-2077): Export icons individually

* fix(SW-1711): export icons individually


Approved-by: Michael Zetterberg
Approved-by: Erik Tiekstra
2025-04-07 07:25:25 +00:00
Arvid Norlin
b8a976db22 Merged in fix/bookingwidget-children-array (pull request #1738)
fix: add default childrenInRoom [] to fix Booking Widget

* fix: add default childrenInRoom [] to fix Booking Widget


Approved-by: Simon.Emanuelsson
2025-04-04 08:32:59 +00:00
Christian Andolf
14f9b68365 chore: Cleanup booking widget with types and other minor issues 2025-04-04 09:06:42 +02:00
Joakim Jäderberg
3c810d67a2 Merged in feature/SW-1736-foating-booking-widget (pull request #1696)
Feature/SW-1736 floating booking widget

* feature: Add floating booking widget on start page SW-1736

* fix: Make sure we don't try to use IntersectionObserver on the server

* fix: make sure that we disconnect the intersectionobserver when dismounting

* fix: pass searchparams to floating bookingwidget


Approved-by: Michael Zetterberg
2025-04-04 06:52:37 +00:00
Matilda Landström
5de2a993a7 Merged in feat/SW-1711-switch-icons (pull request #1558)
Switches out all the old icons to new ones, and moves them to the design system. The new icons are of three different types: Materialise Symbol, Nucleo, and Customized. Also adds further mapping between facilities/amenities and icons.

Approved-by: Michael Zetterberg
Approved-by: Erik Tiekstra
2025-03-27 09:42:52 +00:00
Erik Tiekstra
2c08b141b2 feat(SW-1534): Added booking code functionality from either searchParams or pageSettings
Approved-by: Christian Andolf
2025-03-25 07:36:43 +00:00
Joakim Jäderberg
fa63b20ed0 Merged in feature/redis (pull request #1478)
Distributed cache

* cache deleteKey now uses an options object instead of a lonely argument variable fuzzy

* merge

* remove debug logs and cleanup

* cleanup

* add fault handling

* add fault handling

* add pid when logging redis client creation

* add identifier when logging redis client creation

* cleanup

* feat: add redis-api as it's own app

* feature: use http wrapper for redis

* feat: add the possibility to fallback to unstable_cache

* Add error handling if redis cache is unresponsive

* add logging for unstable_cache

* merge

* don't cache errors

* fix: metadatabase on branchdeploys

* Handle when /en/destinations throws
add ErrorBoundary

* Add sentry-logging when ErrorBoundary catches exception

* Fix error handling for distributed cache

* cleanup code

* Added Application Insights back

* Update generateApiKeys script and remove duplicate

* Merge branch 'feature/redis' of bitbucket.org:scandic-swap/web into feature/redis

* merge


Approved-by: Linus Flood
2025-03-14 07:54:21 +00:00
Linus Flood
7563db9dbc Merged in fix/intl-global-error (pull request #1510)
Fix: Error message when copy fail. Null check on localstorage. Removed Intl from global-error.tsx

* Error message if failed to copy

* Use try/catch instead


Approved-by: Joakim Jäderberg
2025-03-11 10:49:56 +00:00
Joakim Jäderberg
2c7d72c540 Merged in fix/switch-to-useQuery-over-useSuspenseQuery (pull request #1495)
fix: switch to using useQuery over useSuspenseQuery for booking widget

* fix: switch to using useQuery over useSuspenseQuery for booking widget


Approved-by: Linus Flood
2025-03-07 13:37:15 +00:00
Hrishikesh Vaipurkar
24bf96df41 feat: SW-1583 Used constants for strings 2025-03-07 09:08:19 +00:00
Hrishikesh Vaipurkar
f6db5f2732 feat: SW-1583 Fixed rebase issue 2025-03-07 09:08:18 +00:00
Hrishikesh Vaipurkar
51b70f3032 feat: SW-1583 Enabled reward night in booking widget 2025-03-07 09:08:18 +00:00
Joakim Jäderberg
f36b90e474 Merged in feature/bookingwidget-client-side (pull request #1481)
Move more of BookingWidget to client SW-1639

* feat: move getLocations in booking widget to client side so that it's also cached on the client reducing the blinking when switching urls (and reducing duplicate calls)


Approved-by: Linus Flood
2025-03-05 13:37:33 +00:00
Michael Zetterberg
43c25aea95 fix: improve handling of booking widget params from search params
now we are defensive in parsing the location
if parsing fails the not found is now displayed
2025-02-26 13:55:30 +01:00
Anton Gunnarsson
80100e7631 Merged in monorepo-step-1 (pull request #1080)
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
2025-02-26 10:36:17 +00:00