Skip to content

Commit a7f7e09

Browse files
committed
fix: avoid start rendering thankyou page if there is a custom one
1 parent ef92dd4 commit a7f7e09

9 files changed

Lines changed: 202 additions & 201 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ orbs:
77
jobs:
88
test: # this can be any name you choose
99
docker:
10-
- image: mcr.microsoft.com/playwright:v1.52.0-noble
10+
- image: mcr.microsoft.com/playwright:v1.53.0-noble
1111
resource_class: medium+
1212
parallelism: 10
1313

@@ -50,7 +50,7 @@ jobs:
5050
no_output_timeout: 15m
5151
command: |
5252
mkdir test-results
53-
pnpm run serve &
53+
pnpm run serve --no-request-logging &
5454
TESTFILES=$(circleci tests glob "specs/e2e/**/*.spec.ts")
5555
echo $TESTFILES | circleci tests run --command="xargs pnpm playwright test --config=playwright.config.ci.ts --reporter=list" --verbose --split-by=timings
5656
- store_test_results:

components/composite/Checkout/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ interface Props {
4141
companyName: string
4242
supportEmail: NullableType<string>
4343
supportPhone: NullableType<string>
44+
thankyouPageUrl: NullableType<string>
4445
termsUrl: NullableType<string>
4546
privacyUrl: NullableType<string>
4647
gtmId: NullableType<string>
@@ -53,6 +54,7 @@ const Checkout: React.FC<Props> = ({
5354
companyName,
5455
supportEmail,
5556
supportPhone,
57+
thankyouPageUrl,
5658
termsUrl,
5759
privacyUrl,
5860
gtmId,
@@ -110,6 +112,7 @@ const Checkout: React.FC<Props> = ({
110112
supportEmail={supportEmail}
111113
supportPhone={supportPhone}
112114
orderNumber={orderNumber}
115+
thankyouPageUrl={thankyouPageUrl}
113116
/>
114117
)
115118
}

components/composite/StepComplete/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import PaymentSource from "@commercelayer/react-components/payment_source/Paymen
22
import PaymentSourceBrandIcon from "@commercelayer/react-components/payment_source/PaymentSourceBrandIcon"
33
import PaymentSourceBrandName from "@commercelayer/react-components/payment_source/PaymentSourceBrandName"
44
import PaymentSourceDetail from "@commercelayer/react-components/payment_source/PaymentSourceDetail"
5-
import { useContext, useEffect } from "react"
5+
import { useContext, useEffect, useState } from "react"
66
import { Trans, useTranslation } from "react-i18next"
77

88
import { OrderSummary } from "components/composite/OrderSummary"
@@ -44,6 +44,7 @@ interface Props {
4444
companyName: string
4545
supportEmail: NullableType<string>
4646
supportPhone: NullableType<string>
47+
thankyouPageUrl: NullableType<string>
4748
orderNumber: string
4849
}
4950

@@ -53,13 +54,10 @@ export const StepComplete: React.FC<Props> = ({
5354
supportEmail,
5455
supportPhone,
5556
orderNumber,
57+
thankyouPageUrl = null,
5658
}) => {
5759
const { t } = useTranslation()
5860

59-
const { settings } = useSettingsOrInvalid()
60-
61-
const thankyouPageUrl = settings?.config?.checkout?.thankyou_page
62-
6361
const ctx = useContext(AppContext)
6462

6563
useEffect(() => {

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"@commercelayer/js-auth": "^6.7.2",
7777
"@commercelayer/organization-config": "^2.3.0",
7878
"@commercelayer/react-components": "4.23.4",
79-
"@commercelayer/sdk": "^6.42.0",
79+
"@commercelayer/sdk": "^6.43.0",
8080
"@faker-js/faker": "^9.8.0",
8181
"@headlessui/react": "^2.2.4",
8282
"@next/bundle-analyzer": "^15.3.3",
@@ -112,7 +112,7 @@
112112
},
113113
"devDependencies": {
114114
"@biomejs/biome": "^1.9.4",
115-
"@playwright/test": "1.52.0",
115+
"@playwright/test": "1.53.0",
116116
"@semantic-release/changelog": "^6.0.3",
117117
"@semantic-release/commit-analyzer": "^13.0.1",
118118
"@semantic-release/git": "^10.0.1",
@@ -142,13 +142,12 @@
142142
"preset": "styled-components"
143143
}
144144
},
145-
"cacheDirectories": [
146-
".next/cache"
147-
],
145+
"cacheDirectories": [".next/cache"],
148146
"pnpm": {
149147
"overrides": {
150148
"micromatch@<4.0.8": ">=4.0.8",
151-
"path-to-regexp@>=2.0.0 <3.3.0": "=3.3.0"
149+
"path-to-regexp@>=2.0.0 <3.3.0": "=3.3.0",
150+
"brace-expansion": ">=1.1.12"
152151
},
153152
"onlyBuiltDependencies": [
154153
"@biomejs/biome",

pages/Order.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const Order: NextPage = () => {
4242
companyName={settings.companyName}
4343
supportEmail={settings.supportEmail}
4444
supportPhone={settings.supportPhone}
45+
thankyouPageUrl={settings.config?.checkout?.thankyou_page}
4546
termsUrl={settings.termsUrl}
4647
privacyUrl={settings.privacyUrl}
4748
gtmId={settings.gtmId}

pnpm-lock.yaml

Lines changed: 38 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)