@ikas/storefront 4.0.0-alpha.35 → 4.0.0-alpha.36
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/package.json +11 -11
- package/src/analytics/ikas.ts +15 -5
- package/src/components/checkout/components/customer-addresses/index.tsx +6 -2
- package/src/components/checkout/components/offer-product/index.tsx +12 -16
- package/src/components/checkout/model.ts +86 -60
- package/src/components/checkout/steps/step-payment/payment-gateways/index.tsx +6 -1
- package/src/models/data/category/path-item/index.ts +4 -0
- package/src/models/data/product/filter/index.ts +2 -0
- package/src/utils/constants.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.36",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "Umut Ozan Yıldırım",
|
|
6
6
|
"license": "ISC",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"libphonenumber-js": "^1.10.6"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@ikas/storefront-api": "^4.0.0-alpha.
|
|
28
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
29
|
-
"@ikas/storefront-model-functions": "^4.0.0-alpha.
|
|
30
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
31
|
-
"@ikas/storefront-providers": "^4.0.0-alpha.
|
|
27
|
+
"@ikas/storefront-api": "^4.0.0-alpha.36",
|
|
28
|
+
"@ikas/storefront-config": "^4.0.0-alpha.36",
|
|
29
|
+
"@ikas/storefront-model-functions": "^4.0.0-alpha.36",
|
|
30
|
+
"@ikas/storefront-models": "^4.0.0-alpha.36",
|
|
31
|
+
"@ikas/storefront-providers": "^4.0.0-alpha.36",
|
|
32
32
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
33
33
|
"@rollup/plugin-json": "^4.1.0",
|
|
34
34
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"html-react-parser": "^1.4.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@ikas/storefront-api": "^4.0.0-alpha.
|
|
56
|
-
"@ikas/storefront-config": "^4.0.0-alpha.
|
|
57
|
-
"@ikas/storefront-model-functions": "^4.0.0-alpha.
|
|
58
|
-
"@ikas/storefront-models": "^4.0.0-alpha.
|
|
59
|
-
"@ikas/storefront-providers": "^4.0.0-alpha.
|
|
55
|
+
"@ikas/storefront-api": "^4.0.0-alpha.36",
|
|
56
|
+
"@ikas/storefront-config": "^4.0.0-alpha.36",
|
|
57
|
+
"@ikas/storefront-model-functions": "^4.0.0-alpha.36",
|
|
58
|
+
"@ikas/storefront-models": "^4.0.0-alpha.36",
|
|
59
|
+
"@ikas/storefront-providers": "^4.0.0-alpha.36",
|
|
60
60
|
"mobx": "^6.1.3",
|
|
61
61
|
"mobx-react-lite": "^3.1.5",
|
|
62
62
|
"next": "12.2.0",
|
package/src/analytics/ikas.ts
CHANGED
|
@@ -144,10 +144,18 @@ export default class IkasAnalytics {
|
|
|
144
144
|
static sessionId?: string | null;
|
|
145
145
|
static visitorId?: string | null;
|
|
146
146
|
|
|
147
|
+
static async createUUID() {
|
|
148
|
+
const response = await fetch(
|
|
149
|
+
`${process.env.NEXT_PUBLIC_BASE_URL}/generate-id/1`
|
|
150
|
+
);
|
|
151
|
+
const responseJson = await response.json();
|
|
152
|
+
return responseJson.data[0] as string;
|
|
153
|
+
}
|
|
154
|
+
|
|
147
155
|
static async createSessionId() {
|
|
148
156
|
try {
|
|
149
157
|
const idWithExpiry: IdWithExpiry = {
|
|
150
|
-
id:
|
|
158
|
+
id: await this.createUUID(),
|
|
151
159
|
expiry: Date.now() + this.EXPIRY_LENGTH,
|
|
152
160
|
};
|
|
153
161
|
|
|
@@ -167,7 +175,8 @@ export default class IkasAnalytics {
|
|
|
167
175
|
if (existingSessionIdData) {
|
|
168
176
|
const idWithExpiry = JSON.parse(existingSessionIdData) as IdWithExpiry;
|
|
169
177
|
|
|
170
|
-
|
|
178
|
+
// Remove old ids so that they can be replaced with UUIDs (length 13 check)
|
|
179
|
+
if (idWithExpiry.expiry < Date.now() || idWithExpiry.id.length <= 13) {
|
|
171
180
|
await this.createSessionId();
|
|
172
181
|
} else {
|
|
173
182
|
// Extend the duration of the sessionId
|
|
@@ -190,14 +199,15 @@ export default class IkasAnalytics {
|
|
|
190
199
|
}
|
|
191
200
|
}
|
|
192
201
|
|
|
193
|
-
static checkVisitorId() {
|
|
202
|
+
static async checkVisitorId() {
|
|
194
203
|
try {
|
|
195
204
|
const existingVisitorId = localStorage.getItem(this.VISITOR_ID_KEY);
|
|
196
205
|
|
|
197
|
-
|
|
206
|
+
// Remove old ids so that they can be replaced with UUIDs (length 13 check)
|
|
207
|
+
if (existingVisitorId && existingVisitorId.length > 13) {
|
|
198
208
|
this.visitorId = existingVisitorId;
|
|
199
209
|
} else {
|
|
200
|
-
this.visitorId =
|
|
210
|
+
this.visitorId = await this.createUUID();
|
|
201
211
|
localStorage.setItem(this.VISITOR_ID_KEY, this.visitorId);
|
|
202
212
|
}
|
|
203
213
|
|
|
@@ -143,7 +143,9 @@ const CustomerAddresses: React.FC<Props> = ({ vm }) => {
|
|
|
143
143
|
|
|
144
144
|
{!!vm.vm.store.customerStore.customer &&
|
|
145
145
|
!vm.editingCustomerAddress &&
|
|
146
|
-
vm.vm.deliveryMethod === "address"
|
|
146
|
+
(vm.vm.deliveryMethod === "address" ||
|
|
147
|
+
(vm.vm.step === CheckoutStep.PAYMENT &&
|
|
148
|
+
vm.vm.deliveryMethod === "in-store")) && (
|
|
147
149
|
<div className={checkoutStyles.RowPB}>
|
|
148
150
|
{vm.vm.store.customerStore.customer.addresses?.map((address) => (
|
|
149
151
|
<SelectBox
|
|
@@ -183,7 +185,9 @@ const CustomerAddresses: React.FC<Props> = ({ vm }) => {
|
|
|
183
185
|
vm.vm.step === CheckoutStep.INFO &&
|
|
184
186
|
vm.vm.deliveryMethod === "address"
|
|
185
187
|
? addressForm
|
|
186
|
-
: vm.vm.step === CheckoutStep.PAYMENT &&
|
|
188
|
+
: vm.vm.step === CheckoutStep.PAYMENT &&
|
|
189
|
+
!vm.vm.store.customerStore.customer &&
|
|
190
|
+
addressForm}
|
|
187
191
|
|
|
188
192
|
{vm.vm.deliveryMethod === "in-store" && (
|
|
189
193
|
<div className={checkoutStyles.RowPB}>
|
|
@@ -18,7 +18,7 @@ type Props = {
|
|
|
18
18
|
const OfferProduct: React.FC<Props> = ({ vm, campaignOffer }) => {
|
|
19
19
|
const { t } = useTranslation();
|
|
20
20
|
const [selectedVariant, setSelectedVariant] =
|
|
21
|
-
React.useState<IkasProductVariant>(campaignOffer
|
|
21
|
+
React.useState<IkasProductVariant>(campaignOffer.variants[0]);
|
|
22
22
|
|
|
23
23
|
const acceptOffer = () => {
|
|
24
24
|
vm.updateCartCampaignOffer({
|
|
@@ -43,7 +43,7 @@ const OfferProduct: React.FC<Props> = ({ vm, campaignOffer }) => {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
const onVariantChange = (value: string) => {
|
|
46
|
-
const variant = campaignOffer.
|
|
46
|
+
const variant = campaignOffer.variants.find((v) => v.id === value);
|
|
47
47
|
|
|
48
48
|
if (variant) {
|
|
49
49
|
setSelectedVariant(variant);
|
|
@@ -105,26 +105,22 @@ const OfferProduct: React.FC<Props> = ({ vm, campaignOffer }) => {
|
|
|
105
105
|
)}
|
|
106
106
|
</div>
|
|
107
107
|
<div className={styles.Actions}>
|
|
108
|
-
{campaignOffer.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}))}
|
|
119
|
-
/>
|
|
120
|
-
)}
|
|
108
|
+
{campaignOffer.variants.length > 1 && (
|
|
109
|
+
<Select
|
|
110
|
+
value={selectedVariant.id}
|
|
111
|
+
onSelectChange={onVariantChange}
|
|
112
|
+
options={campaignOffer.variants.map((v) => ({
|
|
113
|
+
label: v.variantValues.map((vv) => vv.name).join(", "),
|
|
114
|
+
value: v.id,
|
|
115
|
+
}))}
|
|
116
|
+
/>
|
|
117
|
+
)}
|
|
121
118
|
<Button
|
|
122
119
|
style={{
|
|
123
120
|
width: "100%",
|
|
124
121
|
height: 44,
|
|
125
122
|
fontSize: 14,
|
|
126
123
|
}}
|
|
127
|
-
isDisabled={!campaignOffer.product.hasStock}
|
|
128
124
|
text={t("checkout-page:actions.addToCart")}
|
|
129
125
|
onClick={acceptOffer}
|
|
130
126
|
/>
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
IkasOrderCustomer,
|
|
13
13
|
IkasCartCampaignOfferStatus,
|
|
14
14
|
IkasProduct,
|
|
15
|
+
IkasProductVariant,
|
|
15
16
|
IkasCartCampaignOffer,
|
|
16
17
|
IkasCheckout,
|
|
17
18
|
IkasStockLocation,
|
|
@@ -91,8 +92,8 @@ export default class CheckoutViewModel {
|
|
|
91
92
|
|
|
92
93
|
stripeResponse: CreateStripePaymentIntentResponse | null = null;
|
|
93
94
|
|
|
94
|
-
checkoutCampaignOffer
|
|
95
|
-
postCheckoutCampaignOffer
|
|
95
|
+
checkoutCampaignOffer?: CampaignOfferType;
|
|
96
|
+
postCheckoutCampaignOffer?: CampaignOfferType;
|
|
96
97
|
|
|
97
98
|
returnPolicy: string;
|
|
98
99
|
privacyPolicy: string;
|
|
@@ -252,6 +253,9 @@ export default class CheckoutViewModel {
|
|
|
252
253
|
if (this.step === CheckoutStep.PAYMENT) {
|
|
253
254
|
if (this.isInStoreDelivery) {
|
|
254
255
|
this.checkout.billingAddress = new IkasOrderAddress();
|
|
256
|
+
if (this.checkoutSettings) {
|
|
257
|
+
this.checkout.billingAddress.checkoutSettings = this.checkoutSettings;
|
|
258
|
+
}
|
|
255
259
|
}
|
|
256
260
|
}
|
|
257
261
|
|
|
@@ -737,7 +741,7 @@ export default class CheckoutViewModel {
|
|
|
737
741
|
this.checkout.billingAddress =
|
|
738
742
|
this.checkout.billingAddress || new IkasOrderAddress();
|
|
739
743
|
} else {
|
|
740
|
-
if (this.isInStoreDelivery) {
|
|
744
|
+
if (this.isInStoreDelivery || this.checkout.billingAddress) {
|
|
741
745
|
this.checkout.billingAddress = new IkasOrderAddress(
|
|
742
746
|
_cloneDeep(this.checkout.billingAddress) || {}
|
|
743
747
|
);
|
|
@@ -747,6 +751,7 @@ export default class CheckoutViewModel {
|
|
|
747
751
|
);
|
|
748
752
|
}
|
|
749
753
|
}
|
|
754
|
+
|
|
750
755
|
this.checkout.billingAddress.checkoutSettings = this.checkoutSettings;
|
|
751
756
|
}
|
|
752
757
|
};
|
|
@@ -1324,32 +1329,25 @@ export default class CheckoutViewModel {
|
|
|
1324
1329
|
this.isContactModalVisible = value;
|
|
1325
1330
|
};
|
|
1326
1331
|
|
|
1327
|
-
|
|
1332
|
+
getWaitingForActionCampaignOffers = (
|
|
1328
1333
|
targetPage: IkasCampaignOfferTargetPageType
|
|
1329
1334
|
) => {
|
|
1330
|
-
if (this.checkout.campaignOffers
|
|
1331
|
-
|
|
1332
|
-
(co) =>
|
|
1333
|
-
co.status === IkasCartCampaignOfferStatus.WAITING_FOR_ACTION &&
|
|
1334
|
-
co.campaignOffer?.targetPageTypes.some((tpt) => tpt === targetPage)
|
|
1335
|
-
);
|
|
1336
|
-
|
|
1337
|
-
if (filteredCampaignOffer.length) {
|
|
1338
|
-
return filteredCampaignOffer[0];
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1335
|
+
if (!this.checkout.campaignOffers || !this.checkout.campaignOffers.length)
|
|
1336
|
+
return;
|
|
1341
1337
|
|
|
1342
|
-
|
|
1338
|
+
const filteredCampaignOffers = this.checkout.campaignOffers.filter(
|
|
1339
|
+
(co) =>
|
|
1340
|
+
co.status === IkasCartCampaignOfferStatus.WAITING_FOR_ACTION &&
|
|
1341
|
+
co.campaignOffer?.targetPageTypes.some((tpt) => tpt === targetPage)
|
|
1342
|
+
);
|
|
1343
|
+
return filteredCampaignOffers;
|
|
1343
1344
|
};
|
|
1344
1345
|
|
|
1345
1346
|
getOffer = (waitingForActionCampaignOffer: IkasCartCampaignOffer) => {
|
|
1346
|
-
if (waitingForActionCampaignOffer.campaignOffer)
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
return null;
|
|
1347
|
+
if (!waitingForActionCampaignOffer.campaignOffer) return null;
|
|
1348
|
+
return waitingForActionCampaignOffer.campaignOffer.offers.find(
|
|
1349
|
+
(o) => o.id === waitingForActionCampaignOffer.campaignOfferProductId
|
|
1350
|
+
);
|
|
1353
1351
|
};
|
|
1354
1352
|
|
|
1355
1353
|
getProduct = async (productId: string) => {
|
|
@@ -1359,61 +1357,88 @@ export default class CheckoutViewModel {
|
|
|
1359
1357
|
},
|
|
1360
1358
|
});
|
|
1361
1359
|
|
|
1362
|
-
if (
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1360
|
+
if (!productsResponse.isSuccess || !productsResponse?.data?.data?.length)
|
|
1361
|
+
return null;
|
|
1362
|
+
|
|
1363
|
+
const product = productsResponse.data.data[0];
|
|
1364
|
+
const selectedVariant = product.variants.find((v) => v.isActive);
|
|
1365
|
+
const productDetail = new IkasProduct({
|
|
1366
|
+
...product,
|
|
1367
|
+
selectedVariantValues: (selectedVariant || product.variants[0])
|
|
1368
|
+
.variantValues,
|
|
1369
|
+
});
|
|
1370
|
+
|
|
1371
|
+
return productDetail;
|
|
1372
|
+
};
|
|
1373
|
+
|
|
1374
|
+
getOfferProductVariants = ({
|
|
1375
|
+
offer,
|
|
1376
|
+
product,
|
|
1377
|
+
}: {
|
|
1378
|
+
offer: IkasCampaignOfferProduct;
|
|
1379
|
+
product: IkasProduct;
|
|
1380
|
+
}) => {
|
|
1381
|
+
const variants: IkasProductVariant[] = [];
|
|
1382
|
+
|
|
1383
|
+
if (offer.excludedVariantIdList?.length) {
|
|
1384
|
+
product.variants.forEach((v) => {
|
|
1385
|
+
const isVariantExcluded = offer!.excludedVariantIdList?.some(
|
|
1386
|
+
(ev) => ev === v.id
|
|
1387
|
+
);
|
|
1388
|
+
if (!v.hasStock || isVariantExcluded) return;
|
|
1375
1389
|
|
|
1376
|
-
|
|
1390
|
+
variants.push(v);
|
|
1391
|
+
});
|
|
1392
|
+
} else {
|
|
1393
|
+
variants.push(...product.variants.filter((v) => v.hasStock));
|
|
1377
1394
|
}
|
|
1378
1395
|
|
|
1379
|
-
return
|
|
1396
|
+
return variants;
|
|
1380
1397
|
};
|
|
1381
1398
|
|
|
1382
1399
|
getCampaignOfferProducts = async (
|
|
1383
1400
|
targetPage: IkasCampaignOfferTargetPageType
|
|
1384
|
-
) => {
|
|
1385
|
-
const
|
|
1386
|
-
this.
|
|
1401
|
+
): Promise<CampaignOfferType | undefined> => {
|
|
1402
|
+
const waitingForActionCampaignOffers =
|
|
1403
|
+
this.getWaitingForActionCampaignOffers(targetPage);
|
|
1387
1404
|
|
|
1388
1405
|
if (
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
)
|
|
1406
|
+
!waitingForActionCampaignOffers ||
|
|
1407
|
+
!waitingForActionCampaignOffers.length
|
|
1408
|
+
)
|
|
1409
|
+
return;
|
|
1410
|
+
|
|
1411
|
+
for (let i = 0; i < waitingForActionCampaignOffers.length; i++) {
|
|
1412
|
+
const waitingForActionCampaignOffer = waitingForActionCampaignOffers[i];
|
|
1413
|
+
|
|
1392
1414
|
const offer = this.getOffer(waitingForActionCampaignOffer);
|
|
1415
|
+
if (!offer) continue;
|
|
1393
1416
|
|
|
1394
|
-
|
|
1395
|
-
|
|
1417
|
+
const product = await this.getProduct(offer.productId);
|
|
1418
|
+
if (!product) continue;
|
|
1396
1419
|
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
};
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
}
|
|
1420
|
+
const variants: IkasProductVariant[] = this.getOfferProductVariants({
|
|
1421
|
+
offer,
|
|
1422
|
+
product,
|
|
1423
|
+
});
|
|
1424
|
+
if (!variants.length) continue;
|
|
1406
1425
|
|
|
1407
|
-
|
|
1426
|
+
return {
|
|
1427
|
+
product,
|
|
1428
|
+
variants,
|
|
1429
|
+
campaignOffer: waitingForActionCampaignOffer,
|
|
1430
|
+
offer,
|
|
1431
|
+
};
|
|
1432
|
+
}
|
|
1408
1433
|
};
|
|
1409
1434
|
|
|
1410
1435
|
getCampaignOffer = async () => {
|
|
1411
|
-
this.checkoutCampaignOffer =
|
|
1436
|
+
this.checkoutCampaignOffer = await this.getCampaignOfferProducts(
|
|
1412
1437
|
IkasCampaignOfferTargetPageType.CHECKOUT
|
|
1413
|
-
)
|
|
1414
|
-
this.postCheckoutCampaignOffer =
|
|
1438
|
+
);
|
|
1439
|
+
this.postCheckoutCampaignOffer = await this.getCampaignOfferProducts(
|
|
1415
1440
|
IkasCampaignOfferTargetPageType.POST_CHECKOUT
|
|
1416
|
-
)
|
|
1441
|
+
);
|
|
1417
1442
|
};
|
|
1418
1443
|
|
|
1419
1444
|
updateCartCampaignOffer = async (props: UpdateCartCampaignOfferInput) => {
|
|
@@ -1469,6 +1494,7 @@ export type StockErrorData = {
|
|
|
1469
1494
|
|
|
1470
1495
|
export type CampaignOfferType = {
|
|
1471
1496
|
product: IkasProduct;
|
|
1497
|
+
variants: IkasProductVariant[];
|
|
1472
1498
|
campaignOffer: IkasCartCampaignOffer;
|
|
1473
1499
|
offer: IkasCampaignOfferProduct;
|
|
1474
1500
|
};
|
|
@@ -16,11 +16,16 @@ import { formatCurrency, useTranslation } from "../../../../../utils";
|
|
|
16
16
|
import SVGExternal from "../../../components/svg/external";
|
|
17
17
|
import SVGMasterCard from "../../../components/master-pass/payment-gateway/svg/master-card";
|
|
18
18
|
import { IkasPaymentGatewayAdditionalPrice } from "../../../../../models/data/payment-gateway/additional-price";
|
|
19
|
-
import
|
|
19
|
+
import dynamic from "next/dynamic";
|
|
20
20
|
import { Card as MasterPassCard } from "../../../modelMasterPass";
|
|
21
21
|
import CreditCardData from "../../../components/credit-card-form/model";
|
|
22
22
|
import CreditCardFormMasterPass from "../../../components/master-pass/credit-card-form";
|
|
23
23
|
|
|
24
|
+
//@ts-ignore
|
|
25
|
+
const StripeForm = dynamic(() =>
|
|
26
|
+
import("../../../components/stripe").then((mod) => mod.StripeForm)
|
|
27
|
+
);
|
|
28
|
+
|
|
24
29
|
type Props = {
|
|
25
30
|
vm: CheckoutViewModel;
|
|
26
31
|
};
|
|
@@ -3,6 +3,8 @@ import { IkasBaseModel } from "../../base";
|
|
|
3
3
|
import { IkasCategoryPathItem as ICategoryPathItem } from "@ikas/storefront-models";
|
|
4
4
|
import { computed, makeObservable, observable } from "mobx";
|
|
5
5
|
import { IkasCategoryPathItemFunctions } from "@ikas/storefront-model-functions";
|
|
6
|
+
import { IkasCategoryTranslation } from "../translations";
|
|
7
|
+
import { IkasStorefrontConfig } from "@ikas/storefront-config";
|
|
6
8
|
|
|
7
9
|
export class IkasCategoryPathItem
|
|
8
10
|
extends IkasBaseModel
|
|
@@ -12,6 +14,7 @@ export class IkasCategoryPathItem
|
|
|
12
14
|
description: string | null;
|
|
13
15
|
imageId: string | null;
|
|
14
16
|
name: string;
|
|
17
|
+
translations?: IkasCategoryTranslation[] | null = null;
|
|
15
18
|
|
|
16
19
|
constructor(data: ICategoryPathItem) {
|
|
17
20
|
super(data);
|
|
@@ -20,6 +23,7 @@ export class IkasCategoryPathItem
|
|
|
20
23
|
this.description = data.description || null;
|
|
21
24
|
this.imageId = data.imageId || null;
|
|
22
25
|
this.name = data.name;
|
|
26
|
+
this.translations = data.translations || null;
|
|
23
27
|
|
|
24
28
|
makeObservable(this, {
|
|
25
29
|
metaData: observable,
|
|
@@ -205,12 +205,14 @@ export class IkasProductFilterSettings implements IProductFilterSettings {
|
|
|
205
205
|
showCollapsedOnDesktop: boolean;
|
|
206
206
|
showCollapsedOnMobile: boolean;
|
|
207
207
|
sortType: IkasProductFilterSortType;
|
|
208
|
+
customSortedValues: string[] | null;
|
|
208
209
|
|
|
209
210
|
constructor(data: Partial<IkasProductFilterSettings>) {
|
|
210
211
|
this.useAndFilter = data.useAndFilter || false;
|
|
211
212
|
this.showCollapsedOnDesktop = data.showCollapsedOnDesktop || false;
|
|
212
213
|
this.showCollapsedOnMobile = data.showCollapsedOnMobile || false;
|
|
213
214
|
this.sortType = data.sortType || IkasProductFilterSortType.ALPHABETICAL_ASC;
|
|
215
|
+
this.customSortedValues = data.customSortedValues || null;
|
|
214
216
|
|
|
215
217
|
makeAutoObservable(this);
|
|
216
218
|
}
|
package/src/utils/constants.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const FREE_TEXT_CITY_COUNTRY_LIST = ["DE", "US"];
|
|
1
|
+
export const FREE_TEXT_CITY_COUNTRY_LIST = ["DE", "US", "AT"];
|
|
2
2
|
export const DISTRICT_HIDDEN_COUNTRY_LIST = ["US"];
|