@infrab4a/connect-angular 3.2.0 → 3.2.2-beta.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/bundles/infrab4a-connect-angular.umd.js +26 -23
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/services/home-shop.service.js +25 -22
- package/fesm2015/infrab4a-connect-angular.js +23 -20
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +2 -2
|
@@ -1097,25 +1097,28 @@
|
|
|
1097
1097
|
this.homeRepository = homeRepository;
|
|
1098
1098
|
this.productRepository = productRepository;
|
|
1099
1099
|
this.defaultShop = defaultShop;
|
|
1100
|
-
this.buildCategoryGroupWithRequiredData = function (group) {
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
'id',
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1100
|
+
this.buildCategoryGroupWithRequiredData = function (group) {
|
|
1101
|
+
var _a, _b;
|
|
1102
|
+
return ({
|
|
1103
|
+
category: i2.Category.toInstance(i2.pick(((_a = group === null || group === void 0 ? void 0 : group.category) === null || _a === void 0 ? void 0 : _a.toPlain()) || {}, ['id', 'name', 'slug', 'conditions'])),
|
|
1104
|
+
products: ((_b = group === null || group === void 0 ? void 0 : group.products) === null || _b === void 0 ? void 0 : _b.map(function (product) { return i2.Product.toInstance(i2.pick((product === null || product === void 0 ? void 0 : product.toPlain()) || {}, [
|
|
1105
|
+
'id',
|
|
1106
|
+
'price',
|
|
1107
|
+
'reviews',
|
|
1108
|
+
'hasVariants',
|
|
1109
|
+
'slug',
|
|
1110
|
+
'sku',
|
|
1111
|
+
'stock',
|
|
1112
|
+
'costPrice',
|
|
1113
|
+
'images',
|
|
1114
|
+
'miniatures',
|
|
1115
|
+
'name',
|
|
1116
|
+
'weight',
|
|
1117
|
+
'rate',
|
|
1118
|
+
'type',
|
|
1119
|
+
])); })) || [],
|
|
1120
|
+
});
|
|
1121
|
+
};
|
|
1119
1122
|
}
|
|
1120
1123
|
Object.defineProperty(HomeShopService.prototype, "homeId", {
|
|
1121
1124
|
get: function () {
|
|
@@ -1132,8 +1135,8 @@
|
|
|
1132
1135
|
var _this = this;
|
|
1133
1136
|
return this.getHomeConfiguration().pipe(operators.map(function (home) { var _a; return (((_a = home === null || home === void 0 ? void 0 : home.data) === null || _a === void 0 ? void 0 : _a.expiresAt) > new Date() ? home : null); }), operators.concatMap(function (home) { return home
|
|
1134
1137
|
? rxjs.of(home)
|
|
1135
|
-
: rxjs.forkJoin([_this.getDiscoverProducts(), _this.getFeaturedProducts(), _this.getVerticalProducts()]).pipe(operators.map(function (
|
|
1136
|
-
var
|
|
1138
|
+
: rxjs.forkJoin([_this.getDiscoverProducts(), _this.getFeaturedProducts(), _this.getVerticalProducts()]).pipe(operators.map(function (_c) {
|
|
1139
|
+
var _d = __read(_c, 3), discoverProducts = _d[0], featuredProducts = _d[1], verticalProducts = _d[2];
|
|
1137
1140
|
return ({
|
|
1138
1141
|
discoverProducts: discoverProducts,
|
|
1139
1142
|
featuredProducts: featuredProducts,
|
|
@@ -1169,8 +1172,8 @@
|
|
|
1169
1172
|
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.forkJoin(home.verticalCarousels.filter(Boolean).map(function (id) { return rxjs.from(_this.categoryRepository.get({ id: id })).pipe(operators.concatMap(function (category) { return rxjs.from(_this.productRepository.find({
|
|
1170
1173
|
filters: { categories: { operator: i2.Where.IN, value: [category.id] } },
|
|
1171
1174
|
limits: { limit: 12 },
|
|
1172
|
-
})).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (
|
|
1173
|
-
var category =
|
|
1175
|
+
})).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (_c) {
|
|
1176
|
+
var category = _c.category, products = _c.products;
|
|
1174
1177
|
return ({ category: category, products: products.data });
|
|
1175
1178
|
}), operators.map(_this.buildCategoryGroupWithRequiredData)); })); }));
|
|
1176
1179
|
};
|