Commit Graph

107 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
Christian Andolf
ff40ef72c4 chore: fix and migrate unit tests to vitest 2025-06-30 09:49:30 +02:00
Anton Gunnarsson
f0def99425 Merged in chore/remove-unused-env-vars (pull request #2463)
chore: Remove unused env vars and feature toggles

* Remove unused env vars and feature toggles


Approved-by: Joakim Jäderberg
2025-06-30 07:48:05 +00:00
Erik Tiekstra
36d010a0a4 feat(SW-2957): Added suffix to meta title on specific page types
Approved-by: Matilda Landström
2025-06-30 06:08:17 +00:00
Anton Gunnarsson
01ca2b4897 Merged in feat/sw-2867-move-user-router-to-trpc-package (pull request #2428)
Move user router to trpc package

* 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

* Move partners router to trpc package

* Move autocomplete router to trpc package

* Move booking router to trpc package

* Remove translations from My Pages navigation trpc procedure

* Move navigation router to trpc package

* Move user router to trpc package

* Merge branch 'master' into feat/sw-2862-move-booking-router-to-trpc-package

* Merge branch 'feat/sw-2862-move-booking-router-to-trpc-package' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'feat/sw-2865-move-navigation-router-to-trpc-package' into feat/sw-2867-move-user-router-to-trpc-package

* Merge branch 'master' into feat/sw-2867-move-user-router-to-trpc-package


Approved-by: Linus Flood
2025-06-27 07:07:49 +00:00
Anton Gunnarsson
00bcdaaa28 Merged in feat/sw-2865-move-navigation-router-to-trpc-package (pull request #2427)
feat(SW-2862): Move navigation router to trpc package

* 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

* Move partners router to trpc package

* Move autocomplete router to trpc package

* Move booking router to trpc package

* Remove translations from My Pages navigation trpc procedure

* Move navigation router to trpc package

* Merge branch 'master' into feat/sw-2862-move-booking-router-to-trpc-package

* Merge branch 'feat/sw-2862-move-booking-router-to-trpc-package' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package

* Merge branch 'master' into feat/sw-2865-move-navigation-router-to-trpc-package


Approved-by: Linus Flood
2025-06-27 06:54:49 +00:00
Michael Zetterberg
5736c437b6 fix: Remove metadata for ratings subpage, it no longer exists 2025-06-27 06:37:27 +00:00
Anton Gunnarsson
e572d9e7e9 Merged in feat/sw-2862-move-booking-router-to-trpc-package (pull request #2421)
feat(SW-2861): Move booking router to trpc package

* 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

* Move partners router to trpc package

* Move autocomplete router to trpc package

* Move booking router to trpc package

* Merge branch 'master' into feat/sw-2862-move-booking-router-to-trpc-package


Approved-by: Linus Flood
2025-06-26 13:21:16 +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
Joakim Jäderberg
9b491c5364 Merged in fix/resolve-entry-clearing-cache (pull request #2445)
fix: use shared cache key when revalidating urls

* fix: use shared cache key when revalidating urls


Approved-by: Linus Flood
2025-06-26 06:23:03 +00:00
Bianca Widstam
5c3b30ea93 Merged in fix/SW-3020-paymentInfo-tracking (pull request #2403)
fix(SW-3020): add correct paymentInfo in booking flow and ancillary flow

* fix(SW-3020): add correct paymentInfo in booking flow and ancillary flow

* fix(SW-3020): fix pr comments


Approved-by: Tobias Johansson
2025-06-24 13:38:30 +00:00
Linus Flood
3c4ff0a792 Merged in fix/LOY-280-phone (pull request #2393)
fix(LOY-280): phone number validation

* fix(LOY-280): phone number validation

* Return formatted phonenumber even though its not valid


Approved-by: Christian Andolf
2025-06-19 12:24:33 +00:00
Bianca Widstam
46e7f33ab6 Merged in fix/SW-3083-alternative-hotels-page-not-found (pull request #2396)
fix(SW-3083): alternative hotels compare locations with cityIdentifier

* fix(SW-3083): alternative hotels compare locations with cityIdentifier

* fix(SW-3083): rename cityName

* fix(SW-3083): rename to cityIdentifier


Approved-by: Anton Gunnarsson
2025-06-19 08:08:33 +00:00
Anton Gunnarsson
846fd904a6 Merged in feat/sw-2859-set-up-shared-trpc-package (pull request #2319)
feat(SW-2859): Create trpc package

* Add isEdge, safeTry and dataCache to new common package

* Add eslint and move prettier config

* Clean up tests

* Create trpc package and move initialization

* Move errors and a few procedures

* Move telemetry to common package

* Move tokenManager to common package

* Add Sentry to procedures

* Clean up procedures

* Fix self-referencing imports

* 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

* Fix lang imports


Approved-by: Linus Flood
2025-06-18 12:14:20 +00:00
Erik Tiekstra
2f38bdf0b1 fix(SW-3075): Fixed issue where URLs rendered differently in source HTML in compared to client
Approved-by: Matilda Landström
2025-06-18 12:07:32 +00:00
Tobias Johansson
002d5f9c68 Merged in fix/SW-3078-wrong-dates-time-zones (pull request #2388)
fix(SW-3078): change to string instead of Date in Zod schema

* fix(SW-3078): change to string instead of Date in Zod schema


Approved-by: Michael Zetterberg
Approved-by: Linus Flood
2025-06-18 10:55:05 +00:00
Linus Flood
a29f2b94a7 Merged in fix/signup-phone-validation (pull request #2378)
fix/editprofile-phonenumber-validation

* fix/editprofile-phonenumber-validation


Approved-by: Christian Andolf
2025-06-17 11:56:58 +00:00
Christian Andolf
0b8e3edc15 fix: now parses phone number before submitting on edit profile and signup 2025-06-17 10:48:19 +02:00
Christian Andolf
9da986f554 fix: extrapolate phone number parsing for re-usage in edit profile
move error messages to message handler
2025-06-13 10:46:15 +02:00
Hrishikesh Vaipurkar
26a289b037 Merged in feat/SW-2993-aa-tracking-remove-pagename- (pull request #2325)
feat: SW-2993 Removed pagename and pagetype from bed & breakfast selection tracking

* feat: SW-2993 Removed pagename and pagetype from bed & breakfast selection tracking


Approved-by: Tobias Johansson
2025-06-12 09:05:22 +00:00
Anton Gunnarsson
048a477e52 Merged in feat/common-package (pull request #2333)
feat: Add common package

* Add isEdge, safeTry and dataCache to new common package

* Add eslint and move prettier config

* Fix yarn lock

* Clean up tests

* Add lint-staged config to common

* Add missing dependencies


Approved-by: Joakim Jäderberg
2025-06-11 13:08:39 +00:00
Tobias Johansson
ead822fa62 Merged in fix/SW-2679-tracking-signup-details-forms (pull request #2236)
feat(SW-2679): Added form tracking for checkout and signup

* feat(SW-2679): Added form tracking for checkout and signup

* fix(SW-2679): fixes from review


Approved-by: Michael Zetterberg
2025-06-10 06:35:13 +00:00
Anton Gunnarsson
bff34b034e Merged in feat/sw-2857-refactor-booking-flow-url-updates (pull request #2302)
feat(SW-2857): Refactor booking flow url updates

* Add support for removing parameters when using initial values in serializeSearchParams

* Don't manually write search params in rate store

* Booking is already from live search params so no need

* Fix input type in serializeBookingSearchParams


Approved-by: Linus Flood
2025-06-09 09:16:22 +00:00
Anton Gunnarsson
879a383b61 Merged in fix/make-city-optional-in-parseSelectHotelSearchParams (pull request #2309)
fix: Make city optional in parseSelectHotelSearchParams

* Make city optional in parseSelectHotelSearchParams


Approved-by: Linus Flood
2025-06-09 09:06:26 +00:00
Hrishikesh Vaipurkar
d626e0f7ae Merged in feat/SW-2653-aa-tracking-click-tracking-on-se (pull request #2301)
feat: SW-2653 Implemented click tracking on Search btn and lang switch

* feat: SW-2653 Implemented click tracking on Search btn and lang switch


Approved-by: Erik Tiekstra
2025-06-09 08:49:39 +00:00
Anton Gunnarsson
4831982e14 Merged in fix/correct-booking-url-array-syntax (pull request #2294)
Fix correct array types in booking flow urls

* Fix correct array types in booking flow urls


Approved-by: Joakim Jäderberg
2025-06-05 07:50:01 +00:00
Simon Emanuelsson
9580281421 fix: allow any type of phone number 2025-06-03 11:54:05 +00:00
Erik Tiekstra
be98c2faf6 feat(SW-1409): Synced tabnavigation headings and section headings on hotel pages
* feat(SW-2409): Added same headings to relevant sidepeeks


Approved-by: Christian Andolf
Approved-by: Matilda Landström
2025-06-03 09:22:28 +00:00
Hrishikesh Vaipurkar
f9e838e77a Merged in fix/SW-2838-in-select-hotel-lang-switch- (pull request #2261)
fix: SW-2838 Use of city identifier instead of city name

* fix: SW-2838 Updated selection to city identifier instead of city name


Approved-by: Christian Andolf
Approved-by: Linus Flood
2025-06-03 07:58:00 +00:00
Joakim Jäderberg
a95ef65d02 Merged in feat/use-hash-for-graphql-cache (pull request #2251)
Feature: Use hash of query+variables for graphql cache instead of gitsha

* feature: use a hash of query+variables as part of the cache key instead of gitsha

* .

* Merge branch 'master' of bitbucket.org:scandic-swap/web into feat/use-hash-for-graphql-cache

* use correct json stringify

* merge

* remove edgeRequest in favor of request

* add more indicative logging


Approved-by: Linus Flood
2025-06-03 06:39:04 +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
cbf9e7b7c2 Merged in chore/next15 (pull request #1999)
chore (SW-834): Upgrade to Next 15

* wip: apply codemod and upgrade swc plugin

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

* wip: fix remaining issues from codemod

serverClient is now async because context use headers()
getLang is now async because it uses headers()

* Minor cleanup

* Inline react-material-symbols package

Package is seemingly not maintained any more and doesn't support
React 19. This copies the package source into `design-system`,
makes the necessary changes for 19 and export it for others to use.

* Fix missing awaits

* Disable modal exit animations

Enabling modal exit animations via isExiting prop is causing
modals to be rendered in "hidden" state and never unmount.
Seems to be an issue with react-aria-components,
see https://github.com/adobe/react-spectrum/issues/7563.
Can probably be fixed by rewriting to a solution similar to
https://react-spectrum.adobe.com/react-aria/examples/framer-modal-sheet.html

* Remove unstable cache implementation and use in memory cache locally

* Fix ref type in SelectFilter

* Use cloneElement to add key prop to element


Approved-by: Linus Flood
2025-06-02 11:11:50 +00:00
Anton Gunnarsson
7e97b74c18 Merged in chore/remove-unused-code (pull request #2229)
Remove unused code

* Remove unused scandic-web files

* Remove unused exports


Approved-by: Joakim Jäderberg
2025-05-30 12:41:18 +00:00
Joakim Jäderberg
b20c8ce42b Merged in fix/warmup-autocomplete-data-2 (pull request #2218)
fix: chunked data overwrote it self

* fix: chunked data overwrote it self


Approved-by: Linus Flood
2025-05-26 09:39:48 +00:00
Erik Tiekstra
c963891ca7 fix(SW-2758): Using ?s queryparameter again to handle sidepeeks on hotel pages
Approved-by: Matilda Landström
2025-05-26 09:09:52 +00:00
Joakim Jäderberg
196ea2994f Merged in fix/warmup-autocomplete-data (pull request #2212)
warmup autocomplete data

* warmup autocomplete data


Approved-by: Anton Gunnarsson
2025-05-26 08:23:20 +00:00
Anton Gunnarsson
41aa4f26ad Update libphonenumber-js 2025-05-22 14:00:38 +02:00
Joakim Jäderberg
cc34cdcf74 Merged in fix/SW-2848-RTE-with-copied-divs (pull request #2173)
fix: handle when content has copied divs from episervers RTE

* fix: handle when content has copied divs from episervers RTE


Approved-by: Matilda Landström
2025-05-22 11:03:29 +00:00
Bianca Widstam
c4229c2dd2 Merged in fix/SW-2853-tracking-breakfast-ancillaries (pull request #2188)
fix(SW-2853): tracking for breakfast ancillaries

* fix(SW-2853): tracking for breakfast ancillaries

* fix(SW-2853): viewAncillary event fix for breakfast

* fix(SW-2853): pr comment spread room facilities


Approved-by: Tobias Johansson
2025-05-22 10:05:54 +00:00
Linus Flood
2ec309354e Merged in fix/my-stay-webview-2 (pull request #2191)
fix: webview - mystay - check if we have webviewToken

* fix: webview - mystay - check if we have webviewToken

* Cleanup


Approved-by: Joakim Jäderberg
2025-05-22 08:38:20 +00:00
Simon Emanuelsson
1f1bcd480b feat: prevent users from selecting the same room when there is no vacancy for it 2025-05-16 13:04:45 +00:00
Bianca Widstam
24e7ab4b71 Merged in fix/SW-2764-remove-ancillaries-breakfast-selection (pull request #2122)
fix(SW-2764): Tracking - remove ancillaries array if no breakfast selected

* fix(SW-2764): remove ancillaries array if no breakfast selected


Approved-by: Tobias Johansson
Approved-by: Joakim Jäderberg
2025-05-16 11:42:56 +00:00
Erik Tiekstra
2401615caa fix(SW-2754): Fixed issue where server rendered html included faulty links
Approved-by: Matilda Landström
2025-05-16 06:21:09 +00:00
Simon Emanuelsson
e082bf2e50 feat: make sure correct data is sent to tracking 2025-05-14 15:10:18 +00:00
Linus Flood
d5b77ae61f Merged in hotfix/gtm (pull request #2070)
Hotfix/gtm

* hotfix: gtm

* wip


Approved-by: Joakim Jäderberg
2025-05-14 05:53:48 +00:00
Joakim Jäderberg
aceb88cb1a Merged in fix/seo-whitelist-scandic-friends (pull request #2071)
fix: SEO whitelist /scandic-friends

* fix: SEO whitelist /scandic-friends

* fix: SEO whitelist /scandic-friends


Approved-by: Linus Flood
2025-05-13 09:35:28 +00:00
Joakim Jäderberg
45d474385c Merged in fix/noindex-contentpages (pull request #2066)
fix: add noindex+nofollow to contentpages

* fix: add noindex+nofollow to contentpages

* fix: move no-index/no-follow to the shared generateMetadata function instead

* remove comment


Approved-by: Erik Tiekstra
2025-05-13 08:29:49 +00:00
Anton Gunnarsson
60af31762b Merged in fix/make-user-loyalty-optional (pull request #2044)
fix: Make loyalty optional on user

* Optional user loyalty

* merge


Approved-by: Joakim Jäderberg
Approved-by: Linus Flood
2025-05-12 09:00:11 +00:00
Michael Zetterberg
8cb63c4947 fix(SW-2116): add compatibility with RefId from Current Web 2025-05-08 11:52:31 +00:00