@sonic-equipment/ui 243.0.0 → 244.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/algolia/algolia-index-config.js +2 -6
- package/dist/config.js +18 -2
- package/dist/pages/checkout/shipping-page/components/readonly-address.js +2 -2
- package/dist/pages/components/page-meta-data/page-meta-data.js +1 -1
- package/dist/shared/utils/environment.d.ts +2 -2
- package/dist/shared/utils/environment.js +7 -2
- package/package.json +1 -1
|
@@ -55,18 +55,14 @@ const DEV_LIKE = new Set([
|
|
|
55
55
|
'sandbox',
|
|
56
56
|
'sandbox-reverse-proxy',
|
|
57
57
|
'storybook',
|
|
58
|
+
'next-development',
|
|
58
59
|
]);
|
|
59
60
|
const getAlgoliaIndex = (environment, languageCode) => {
|
|
60
|
-
let algoliaIndexEnv = '
|
|
61
|
+
let algoliaIndexEnv = 'production';
|
|
61
62
|
const language = getLanguageForAlgoliaIndex(languageCode).toLowerCase();
|
|
62
63
|
if (DEV_LIKE.has(environment)) {
|
|
63
64
|
algoliaIndexEnv = 'development';
|
|
64
65
|
}
|
|
65
|
-
else {
|
|
66
|
-
algoliaIndexEnv = process?.env.ALGOLIA_APP_ID?.includes('testing')
|
|
67
|
-
? 'development'
|
|
68
|
-
: 'production';
|
|
69
|
-
}
|
|
70
66
|
const environmentIndex = algoliaIndexesPerEnvironment[algoliaIndexEnv];
|
|
71
67
|
return {
|
|
72
68
|
default: environmentIndex.default.replace(/<languageCode>/, language),
|
package/dist/config.js
CHANGED
|
@@ -27,7 +27,22 @@ const configPerEnvironment = {
|
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
28
28
|
env?.VITE_SHOP_API_URL || 'https://localhost:8000',
|
|
29
29
|
}),
|
|
30
|
-
next: () => ({
|
|
30
|
+
'next-development': () => ({
|
|
31
|
+
// @ts-expect-error: process is not defined in the browser
|
|
32
|
+
ALGOLIA_API_KEY: process.env.ALGOLIA_API_KEY || '',
|
|
33
|
+
// @ts-expect-error: process is not defined in the browser
|
|
34
|
+
ALGOLIA_APP_ID: process.env.ALGOLIA_APP_ID || '',
|
|
35
|
+
// @ts-expect-error: process is not defined in the browser
|
|
36
|
+
ALGOLIA_HOST: process.env.ALGOLIA_HOST || '',
|
|
37
|
+
// @ts-expect-error: process is not defined in the browser
|
|
38
|
+
BFF_API_URL: process.env.BFF_API_URL || '',
|
|
39
|
+
// @ts-expect-error: process is not defined in the browser
|
|
40
|
+
COOKIE_DOMAIN: process.env.COOKIE_DOMAIN || '',
|
|
41
|
+
HOME_PAGE_URL: '/',
|
|
42
|
+
// @ts-expect-error: process is not defined in the browser
|
|
43
|
+
SHOP_API_URL: process.env.SHOP_API_URL || '',
|
|
44
|
+
}),
|
|
45
|
+
'next-production': () => ({
|
|
31
46
|
// @ts-expect-error: process is not defined in the browser
|
|
32
47
|
ALGOLIA_API_KEY: process.env.ALGOLIA_API_KEY || '',
|
|
33
48
|
// @ts-expect-error: process is not defined in the browser
|
|
@@ -91,6 +106,7 @@ const configPerEnvironment = {
|
|
|
91
106
|
env?.VITE_SHOP_API_URL || 'https://localhost:8000',
|
|
92
107
|
}),
|
|
93
108
|
};
|
|
94
|
-
const
|
|
109
|
+
const configFunction = configPerEnvironment[environment];
|
|
110
|
+
const config = configFunction();
|
|
95
111
|
|
|
96
112
|
export { config, configPerEnvironment };
|
|
@@ -24,10 +24,10 @@ function ReadOnlyAddresses({ billTo, isLoading, isPickup, notes, onSubmit, shipT
|
|
|
24
24
|
const href = `${pathname}${search}`;
|
|
25
25
|
const billToId = billTo?.id;
|
|
26
26
|
const shipToId = shipTo?.id;
|
|
27
|
-
const editBillToAddressUrl = environment
|
|
27
|
+
const editBillToAddressUrl = environment.includes('next')
|
|
28
28
|
? `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/${billToId}?returnUrl=${encodeURIComponent(href)}`
|
|
29
29
|
: paths.ACCOUNT_ADDRESSES;
|
|
30
|
-
const editShipToAddressUrl = environment
|
|
30
|
+
const editShipToAddressUrl = environment.includes('next')
|
|
31
31
|
? `${paths.ACCOUNT_EDIT_BILL_TO_ADDRESS}/${billToId}${paths.ACCOUNT_EDIT_SHIP_TO_ADDRESS}/${shipToId}?returnUrl=${encodeURIComponent(href)}`
|
|
32
32
|
: paths.ACCOUNT_ADDRESSES;
|
|
33
33
|
return (jsxs(Form, { id: EDIT_ADDRESS_FORM_ID, onSubmit: e => {
|
|
@@ -22,7 +22,7 @@ function removeElements(selector) {
|
|
|
22
22
|
document?.querySelectorAll(selector).forEach(element => element.remove());
|
|
23
23
|
}
|
|
24
24
|
function PageMetaData(props) {
|
|
25
|
-
if (environment
|
|
25
|
+
if (environment.includes('next'))
|
|
26
26
|
return null;
|
|
27
27
|
if (typeof document === 'undefined')
|
|
28
28
|
return null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const environments: readonly ["marketingLocal", "sandbox", "sandbox-reverse-proxy", "production", "local", "storybook", "next", "spire-production"];
|
|
1
|
+
export declare const environments: readonly ["marketingLocal", "sandbox", "sandbox-reverse-proxy", "production", "local", "storybook", "next-production", "next-development", "spire-production"];
|
|
2
2
|
export type Environment = (typeof environments)[number];
|
|
3
|
-
export declare const environment:
|
|
3
|
+
export declare const environment: "marketingLocal" | "sandbox" | "sandbox-reverse-proxy" | "production" | "local" | "storybook" | "next-production" | "next-development" | "spire-production";
|
|
@@ -7,7 +7,8 @@ const environments = [
|
|
|
7
7
|
'production',
|
|
8
8
|
'local',
|
|
9
9
|
'storybook',
|
|
10
|
-
'next',
|
|
10
|
+
'next-production',
|
|
11
|
+
'next-development',
|
|
11
12
|
'spire-production',
|
|
12
13
|
];
|
|
13
14
|
const marketingLocal = /marketing.local.com/i;
|
|
@@ -20,7 +21,11 @@ const spireProductionUrls = /spire.sonic-equipment.com/i;
|
|
|
20
21
|
let environmentUrl;
|
|
21
22
|
function getEnvironment() {
|
|
22
23
|
if (typeof process !== 'undefined' && process.env.IS_NEXT === 'true') {
|
|
23
|
-
|
|
24
|
+
if (process.env.ALGOLIA_APP_ID &&
|
|
25
|
+
process.env.ALGOLIA_APP_ID.includes('testing')) {
|
|
26
|
+
return 'next-development';
|
|
27
|
+
}
|
|
28
|
+
return 'next-production';
|
|
24
29
|
}
|
|
25
30
|
else if (typeof process !== 'undefined' && process.env.ISC_API_URL) {
|
|
26
31
|
environmentUrl = process.env.ISC_API_URL;
|