ng-miam 3.3.1 → 3.3.2
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/ng-miam.umd.js +24 -5
- package/bundles/ng-miam.umd.js.map +1 -1
- package/bundles/ng-miam.umd.min.js +1 -1
- package/bundles/ng-miam.umd.min.js.map +1 -1
- package/esm2015/lib/_services/analytics.service.js +7 -1
- package/esm2015/lib/_services/baskets.service.js +6 -2
- package/esm2015/lib/_web-components/recipe-card/recipe-card.component.js +1 -1
- package/esm2015/lib/_web-components/recipe-catalog/recipe-catalog.component.js +1 -1
- package/esm2015/lib/environment.js +15 -5
- package/fesm2015/ng-miam.js +28 -9
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/environment.d.ts +3 -3
- package/miam-style.css +1 -1
- package/package.json +1 -1
package/bundles/ng-miam.umd.js
CHANGED
|
@@ -428,11 +428,21 @@
|
|
|
428
428
|
}(i1.Resource));
|
|
429
429
|
|
|
430
430
|
// Change to true to enable dev mode
|
|
431
|
-
var
|
|
431
|
+
var env = 'prod';
|
|
432
|
+
var urls = {
|
|
433
|
+
'prod': 'https://api.miam.tech',
|
|
434
|
+
'uat': 'https://api-uat.miam.tech',
|
|
435
|
+
'dev': 'http://localhost:3000'
|
|
436
|
+
};
|
|
437
|
+
var webUrls = {
|
|
438
|
+
'prod': 'https://miam.tech',
|
|
439
|
+
'uat': 'https://uat.miam.tech',
|
|
440
|
+
'dev': 'http://localhost:4200'
|
|
441
|
+
};
|
|
432
442
|
var environment = {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
443
|
+
miamAPI: urls[env],
|
|
444
|
+
miamWeb: webUrls[env],
|
|
445
|
+
isProd: function () { return env === 'prod'; }
|
|
436
446
|
};
|
|
437
447
|
|
|
438
448
|
var Supplier = /** @class */ (function (_super) {
|
|
@@ -628,6 +638,11 @@
|
|
|
628
638
|
// Load Google analytics & optimize scripts into host page DOM & create tracker
|
|
629
639
|
AnalyticsService.prototype.init = function (gaKey, optimizeKey) {
|
|
630
640
|
if (optimizeKey === void 0) { optimizeKey = null; }
|
|
641
|
+
// we do not have uat or local analytical service, guard it if you are using a non prod script
|
|
642
|
+
if (!environment.isProd()) {
|
|
643
|
+
console.info('[Miam] you are not in prod, do not initialize analytical service');
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
631
646
|
if (!gaKey || gaKey.length < 0) {
|
|
632
647
|
console.error('[Miam] Cannot initialize analytics : invalid key', gaKey);
|
|
633
648
|
return;
|
|
@@ -2527,8 +2542,12 @@
|
|
|
2527
2542
|
// Send total in cents
|
|
2528
2543
|
_this.analyticsService.sendEvent('push-basket', null, (total * 100));
|
|
2529
2544
|
}
|
|
2545
|
+
// set basket as undefined as it because inconsistent while we reset the list. then wait for new one
|
|
2546
|
+
_this.basket$.next(undefined);
|
|
2530
2547
|
return _this.listsService.resetList();
|
|
2531
|
-
}), operators.
|
|
2548
|
+
}), operators.switchMap(function () {
|
|
2549
|
+
return _this.basket$;
|
|
2550
|
+
}), operators.skipWhile(function (b) { return !b; }), operators.map(function () { return confirmedBasket; }));
|
|
2532
2551
|
};
|
|
2533
2552
|
BasketsService.prototype.basketEntries = function () {
|
|
2534
2553
|
return this._entries$;
|