@ikas/storefront 0.0.115 → 0.0.117
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/build/index.es.js +19 -10
- package/build/index.js +19 -10
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -25842,7 +25842,9 @@ function simpleToProduct(simple) {
|
|
|
25842
25842
|
? p.priceListId === IkasStorefrontConfig.priceListId
|
|
25843
25843
|
: p.priceListId === null;
|
|
25844
25844
|
})),
|
|
25845
|
-
stock: v.stocks
|
|
25845
|
+
stock: v.stocks
|
|
25846
|
+
.filter(function (s) { var _a; return (_a = IkasStorefrontConfig.stockLocationIds) === null || _a === void 0 ? void 0 : _a.includes(s.stockLocationId); })
|
|
25847
|
+
.reduce(function (total, current) { return current.stockCount + total; }, 0) || 0,
|
|
25846
25848
|
variantValues: (_d = v.variantValues) === null || _d === void 0 ? void 0 : _d.map(function (vv) {
|
|
25847
25849
|
var pvt = simple.productVariantTypes.find(function (pvt) { return pvt.variantType.id === vv.variantTypeId; });
|
|
25848
25850
|
var variantValue = pvt === null || pvt === void 0 ? void 0 : pvt.variantType.values.find(function (_vv) { return _vv.id === vv.variantValueId; });
|
|
@@ -29403,7 +29405,7 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29403
29405
|
}
|
|
29404
29406
|
IkasBaseStore.prototype.checkLocalization = function () {
|
|
29405
29407
|
return __awaiter(this, void 0, void 0, function () {
|
|
29406
|
-
var myCountryCode, currentRouting,
|
|
29408
|
+
var myCountryCode, currentRouting, isCorrectLocale, myCountryRouting, otherCountriesRouting, countries_1, localeOptions_1;
|
|
29407
29409
|
return __generator(this, function (_a) {
|
|
29408
29410
|
switch (_a.label) {
|
|
29409
29411
|
case 0:
|
|
@@ -29418,14 +29420,21 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29418
29420
|
myCountryCode = _a.sent();
|
|
29419
29421
|
currentRouting = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; });
|
|
29420
29422
|
if (!(currentRouting && myCountryCode)) return [3 /*break*/, 3];
|
|
29423
|
+
isCorrectLocale = true;
|
|
29424
|
+
myCountryRouting = IkasStorefrontConfig.routings.find(function (r) { var _a; return (_a = r.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(myCountryCode); });
|
|
29421
29425
|
otherCountriesRouting = IkasStorefrontConfig.routings.find(function (r) { var _a; return !((_a = r.countryCodes) === null || _a === void 0 ? void 0 : _a.length); });
|
|
29422
|
-
|
|
29423
|
-
|
|
29424
|
-
|
|
29425
|
-
|
|
29426
|
-
|
|
29427
|
-
|
|
29428
|
-
|
|
29426
|
+
// Current country has spefic routing
|
|
29427
|
+
if (myCountryRouting) {
|
|
29428
|
+
if (currentRouting.id !== myCountryRouting.id) {
|
|
29429
|
+
isCorrectLocale = false;
|
|
29430
|
+
}
|
|
29431
|
+
}
|
|
29432
|
+
// Current country does not have specific routing
|
|
29433
|
+
else {
|
|
29434
|
+
if (otherCountriesRouting &&
|
|
29435
|
+
currentRouting.id !== otherCountriesRouting.id) {
|
|
29436
|
+
isCorrectLocale = false;
|
|
29437
|
+
}
|
|
29429
29438
|
}
|
|
29430
29439
|
return [4 /*yield*/, IkasCountryAPI.listCountries()];
|
|
29431
29440
|
case 2:
|
|
@@ -29453,7 +29462,7 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29453
29462
|
});
|
|
29454
29463
|
}
|
|
29455
29464
|
});
|
|
29456
|
-
this.localeOptions = localeOptions_1;
|
|
29465
|
+
this.localeOptions = sortBy_1(localeOptions_1, "countryName");
|
|
29457
29466
|
if (!isCorrectLocale) {
|
|
29458
29467
|
this.showLocaleOptions = true;
|
|
29459
29468
|
}
|
package/build/index.js
CHANGED
|
@@ -25822,7 +25822,9 @@ function simpleToProduct(simple) {
|
|
|
25822
25822
|
? p.priceListId === IkasStorefrontConfig.priceListId
|
|
25823
25823
|
: p.priceListId === null;
|
|
25824
25824
|
})),
|
|
25825
|
-
stock: v.stocks
|
|
25825
|
+
stock: v.stocks
|
|
25826
|
+
.filter(function (s) { var _a; return (_a = IkasStorefrontConfig.stockLocationIds) === null || _a === void 0 ? void 0 : _a.includes(s.stockLocationId); })
|
|
25827
|
+
.reduce(function (total, current) { return current.stockCount + total; }, 0) || 0,
|
|
25826
25828
|
variantValues: (_d = v.variantValues) === null || _d === void 0 ? void 0 : _d.map(function (vv) {
|
|
25827
25829
|
var pvt = simple.productVariantTypes.find(function (pvt) { return pvt.variantType.id === vv.variantTypeId; });
|
|
25828
25830
|
var variantValue = pvt === null || pvt === void 0 ? void 0 : pvt.variantType.values.find(function (_vv) { return _vv.id === vv.variantValueId; });
|
|
@@ -29383,7 +29385,7 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29383
29385
|
}
|
|
29384
29386
|
IkasBaseStore.prototype.checkLocalization = function () {
|
|
29385
29387
|
return __awaiter(this, void 0, void 0, function () {
|
|
29386
|
-
var myCountryCode, currentRouting,
|
|
29388
|
+
var myCountryCode, currentRouting, isCorrectLocale, myCountryRouting, otherCountriesRouting, countries_1, localeOptions_1;
|
|
29387
29389
|
return __generator(this, function (_a) {
|
|
29388
29390
|
switch (_a.label) {
|
|
29389
29391
|
case 0:
|
|
@@ -29398,14 +29400,21 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29398
29400
|
myCountryCode = _a.sent();
|
|
29399
29401
|
currentRouting = IkasStorefrontConfig.routings.find(function (r) { return r.id === IkasStorefrontConfig.storefrontRoutingId; });
|
|
29400
29402
|
if (!(currentRouting && myCountryCode)) return [3 /*break*/, 3];
|
|
29403
|
+
isCorrectLocale = true;
|
|
29404
|
+
myCountryRouting = IkasStorefrontConfig.routings.find(function (r) { var _a; return (_a = r.countryCodes) === null || _a === void 0 ? void 0 : _a.includes(myCountryCode); });
|
|
29401
29405
|
otherCountriesRouting = IkasStorefrontConfig.routings.find(function (r) { var _a; return !((_a = r.countryCodes) === null || _a === void 0 ? void 0 : _a.length); });
|
|
29402
|
-
|
|
29403
|
-
|
|
29404
|
-
|
|
29405
|
-
|
|
29406
|
-
|
|
29407
|
-
|
|
29408
|
-
|
|
29406
|
+
// Current country has spefic routing
|
|
29407
|
+
if (myCountryRouting) {
|
|
29408
|
+
if (currentRouting.id !== myCountryRouting.id) {
|
|
29409
|
+
isCorrectLocale = false;
|
|
29410
|
+
}
|
|
29411
|
+
}
|
|
29412
|
+
// Current country does not have specific routing
|
|
29413
|
+
else {
|
|
29414
|
+
if (otherCountriesRouting &&
|
|
29415
|
+
currentRouting.id !== otherCountriesRouting.id) {
|
|
29416
|
+
isCorrectLocale = false;
|
|
29417
|
+
}
|
|
29409
29418
|
}
|
|
29410
29419
|
return [4 /*yield*/, IkasCountryAPI.listCountries()];
|
|
29411
29420
|
case 2:
|
|
@@ -29433,7 +29442,7 @@ var IkasBaseStore = /** @class */ (function () {
|
|
|
29433
29442
|
});
|
|
29434
29443
|
}
|
|
29435
29444
|
});
|
|
29436
|
-
this.localeOptions = localeOptions_1;
|
|
29445
|
+
this.localeOptions = sortBy_1(localeOptions_1, "countryName");
|
|
29437
29446
|
if (!isCorrectLocale) {
|
|
29438
29447
|
this.showLocaleOptions = true;
|
|
29439
29448
|
}
|