ng-miam 9.1.2 → 9.1.4
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 +146 -53
- 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/_components/counter-input/counter-input.component.js +11 -5
- package/esm2015/lib/_services/analytics.service.js +11 -5
- package/esm2015/lib/_services/baskets.service.js +5 -5
- package/esm2015/lib/_services/context-registry.service.js +18 -0
- package/esm2015/lib/_services/context.service.js +12 -8
- package/esm2015/lib/_services/recipes.service.js +33 -6
- package/esm2015/lib/_services/store-locator.service.js +7 -2
- package/esm2015/lib/_web-components/basket-preview/basket-preview-line/basket-preview-line.component.js +2 -2
- package/esm2015/lib/_web-components/preferences/preferences-search/preferences-search.component.js +5 -4
- package/esm2015/lib/_web-components/preferences/preferences.component.js +17 -12
- package/esm2015/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.js +3 -6
- package/esm2015/lib/_web-components/recipe-catalog/recipe-catalog.component.js +4 -4
- package/esm2015/lib/_web-components/recipe-details/recipe-details.component.js +2 -2
- package/esm2015/lib/_web-components/recipe-details/store-locator-link/store-locator-link.component.js +28 -8
- package/esm2015/lib/_web-components/recipe-pricing/recipe-pricing.component.js +3 -4
- package/esm2015/lib/_web-components/warning-store-locator/warning-store-locator.component.js +4 -2
- package/esm2015/lib/environments/version.js +2 -2
- package/fesm2015/ng-miam.js +480 -396
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_components/counter-input/counter-input.component.d.ts +4 -4
- package/lib/_components/counter-input/counter-input.component.d.ts.map +1 -1
- package/lib/_services/analytics.service.d.ts +3 -0
- package/lib/_services/analytics.service.d.ts.map +1 -1
- package/lib/_services/baskets.service.d.ts +1 -1
- package/lib/_services/baskets.service.d.ts.map +1 -1
- package/lib/_services/context-registry.service.d.ts +8 -0
- package/lib/_services/context-registry.service.d.ts.map +1 -0
- package/lib/_services/context.service.d.ts +4 -2
- package/lib/_services/context.service.d.ts.map +1 -1
- package/lib/_services/recipes.service.d.ts +15 -4
- package/lib/_services/recipes.service.d.ts.map +1 -1
- package/lib/_services/store-locator.service.d.ts +2 -0
- package/lib/_services/store-locator.service.d.ts.map +1 -1
- package/lib/_web-components/preferences/preferences-search/preferences-search.component.d.ts.map +1 -1
- package/lib/_web-components/preferences/preferences.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts +0 -1
- package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-catalog/recipe-catalog.component.d.ts +1 -1
- package/lib/_web-components/recipe-catalog/recipe-catalog.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-details/store-locator-link/store-locator-link.component.d.ts +3 -0
- package/lib/_web-components/recipe-details/store-locator-link/store-locator-link.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-pricing/recipe-pricing.component.d.ts +1 -2
- package/lib/_web-components/recipe-pricing/recipe-pricing.component.d.ts.map +1 -1
- package/lib/_web-components/warning-store-locator/warning-store-locator.component.d.ts.map +1 -1
- package/lib/environments/version.d.ts +1 -1
- package/package.json +1 -1
package/bundles/ng-miam.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/http'), require('@angular/common/locales/fr'), require('@angular/core'), require('@angular/platform-browser/animations'), require('miam-jsonapi'), require('rxjs'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('ng-miam', ['exports', '@angular/common', '@angular/common/http', '@angular/common/locales/fr', '@angular/core', '@angular/platform-browser/animations', 'miam-jsonapi', 'rxjs', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-miam"] = {}, global.ng.common, global.ng.common.http, global.ng.common.locales.fr, global.ng.core, global.ng.platformBrowser.animations, global.i2$2, global.rxjs, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.
|
|
5
|
-
})(this, (function (exports, i2, i1, localeFr, i0, animations$1, i2$2, rxjs, i2$1, endOfWeek, isWithinInterval, startOfWeek, subDays,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/http'), require('@angular/common/locales/fr'), require('@angular/core'), require('@angular/platform-browser/animations'), require('miam-jsonapi'), require('rxjs'), require('rxjs/operators'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('duration-fns'), require('lodash-es'), require('mealz-shared-analytics'), require('lodash-es/pullAt'), require('@angular/cdk/layout'), require('uuid'), require('@angular/forms'), require('@angular/cdk/drag-drop'), require('@angular/cdk/text-field'), require('@angular/elements'), require('lodash-es/remove'), require('@angular/animations'), require('@angular/youtube-player'), require('lodash-es/groupBy')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('ng-miam', ['exports', '@angular/common', '@angular/common/http', '@angular/common/locales/fr', '@angular/core', '@angular/platform-browser/animations', 'miam-jsonapi', 'rxjs', 'rxjs/operators', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', 'duration-fns', 'lodash-es', 'mealz-shared-analytics', 'lodash-es/pullAt', '@angular/cdk/layout', 'uuid', '@angular/forms', '@angular/cdk/drag-drop', '@angular/cdk/text-field', '@angular/elements', 'lodash-es/remove', '@angular/animations', '@angular/youtube-player', 'lodash-es/groupBy'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-miam"] = {}, global.ng.common, global.ng.common.http, global.ng.common.locales.fr, global.ng.core, global.ng.platformBrowser.animations, global.i2$2, global.rxjs, global.rxjs.operators, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.duration, global.lodashEs, global.mealzSharedAnalytics, global.pullAt, global.ng.cdk.layout, global.uuid, global.ng.forms, global.ng.cdk.dragDrop, global.ng.cdk.textField, global.ng.elements, global.remove, global.ng.animations, global.ng.youtubePlayer, global.groupBy));
|
|
5
|
+
})(this, (function (exports, i2, i1, localeFr, i0, animations$1, i2$2, rxjs, operators, i2$1, endOfWeek, isWithinInterval, startOfWeek, subDays, duration, lodashEs, mealzSharedAnalytics, pullAt, i7, uuid, i3, dragDrop, textField, elements, remove, animations, i9, groupBy) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -1227,7 +1227,7 @@
|
|
|
1227
1227
|
if (this.valueSubject) {
|
|
1228
1228
|
return;
|
|
1229
1229
|
}
|
|
1230
|
-
this.valueSubject = new rxjs.
|
|
1230
|
+
this.valueSubject = new rxjs.BehaviorSubject(this.value);
|
|
1231
1231
|
this.lastValue = this.value;
|
|
1232
1232
|
this.subscriptions.push(this.valueSubject
|
|
1233
1233
|
.pipe(operators.debounceTime(this.debounceTime))
|
|
@@ -1239,7 +1239,13 @@
|
|
|
1239
1239
|
_this.lastValue = _this.value;
|
|
1240
1240
|
}));
|
|
1241
1241
|
};
|
|
1242
|
-
CounterInputComponent.prototype.ngOnChanges = function () {
|
|
1242
|
+
CounterInputComponent.prototype.ngOnChanges = function (changes) {
|
|
1243
|
+
var _a;
|
|
1244
|
+
if (!((_a = changes.value) === null || _a === void 0 ? void 0 : _a.isFirstChange())) {
|
|
1245
|
+
if (this.value !== this.valueSubject.value) {
|
|
1246
|
+
this.valueSubject.next(this.value);
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1243
1249
|
this.cdr.detectChanges();
|
|
1244
1250
|
};
|
|
1245
1251
|
CounterInputComponent.prototype.ngOnDestroy = function () {
|
|
@@ -3496,7 +3502,26 @@
|
|
|
3496
3502
|
return RecipeFilters;
|
|
3497
3503
|
}());
|
|
3498
3504
|
|
|
3499
|
-
var VERSION = '9.1.
|
|
3505
|
+
var VERSION = '9.1.4'; // TODO: replace by ##VERSION## and update it in the CI/CD
|
|
3506
|
+
|
|
3507
|
+
var ContextRegistryService = /** @class */ (function () {
|
|
3508
|
+
function ContextRegistryService() {
|
|
3509
|
+
// VARIABLES
|
|
3510
|
+
this.forbidProfiling = false;
|
|
3511
|
+
this.disabledAnalytics = false;
|
|
3512
|
+
}
|
|
3513
|
+
return ContextRegistryService;
|
|
3514
|
+
}());
|
|
3515
|
+
ContextRegistryService.ɵfac = function ContextRegistryService_Factory(t) { return new (t || ContextRegistryService)(); };
|
|
3516
|
+
ContextRegistryService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: ContextRegistryService, factory: ContextRegistryService.ɵfac, providedIn: 'root' });
|
|
3517
|
+
(function () {
|
|
3518
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(ContextRegistryService, [{
|
|
3519
|
+
type: i0.Injectable,
|
|
3520
|
+
args: [{
|
|
3521
|
+
providedIn: 'root'
|
|
3522
|
+
}]
|
|
3523
|
+
}], null, null);
|
|
3524
|
+
})();
|
|
3500
3525
|
|
|
3501
3526
|
/**
|
|
3502
3527
|
* Analytics library cannot refer to "this." so we use a global variable
|
|
@@ -3519,7 +3544,8 @@
|
|
|
3519
3544
|
}));
|
|
3520
3545
|
}
|
|
3521
3546
|
var AnalyticsService = /** @class */ (function () {
|
|
3522
|
-
function AnalyticsService() {
|
|
3547
|
+
function AnalyticsService(contextRegistryService) {
|
|
3548
|
+
this.contextRegistryService = contextRegistryService;
|
|
3523
3549
|
this.eventEmitter = _eventEmitter;
|
|
3524
3550
|
this.alreadyInitialized = false;
|
|
3525
3551
|
}
|
|
@@ -3547,6 +3573,9 @@
|
|
|
3547
3573
|
};
|
|
3548
3574
|
AnalyticsService.prototype.sendEvent = function (name, path, props, journey) {
|
|
3549
3575
|
if (journey === void 0) { journey = EventJourney.MEALZ; }
|
|
3576
|
+
if (this.contextRegistryService.disabledAnalytics && this.contextRegistryService.forbidProfiling) {
|
|
3577
|
+
return;
|
|
3578
|
+
}
|
|
3550
3579
|
mealzSharedAnalytics.sendEvent(name, url(path), journey, props);
|
|
3551
3580
|
};
|
|
3552
3581
|
/** ************************************************* SEND EVENT FOR BASKET ACTIONS ************************************************* **/
|
|
@@ -3615,7 +3644,7 @@
|
|
|
3615
3644
|
};
|
|
3616
3645
|
return AnalyticsService;
|
|
3617
3646
|
}());
|
|
3618
|
-
AnalyticsService.ɵfac = function AnalyticsService_Factory(t) { return new (t || AnalyticsService)(); };
|
|
3647
|
+
AnalyticsService.ɵfac = function AnalyticsService_Factory(t) { return new (t || AnalyticsService)(i0__namespace.ɵɵinject(ContextRegistryService)); };
|
|
3619
3648
|
AnalyticsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: AnalyticsService, factory: AnalyticsService.ɵfac, providedIn: 'root' });
|
|
3620
3649
|
(function () {
|
|
3621
3650
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(AnalyticsService, [{
|
|
@@ -3623,7 +3652,7 @@
|
|
|
3623
3652
|
args: [{
|
|
3624
3653
|
providedIn: 'root'
|
|
3625
3654
|
}]
|
|
3626
|
-
}],
|
|
3655
|
+
}], function () { return [{ type: ContextRegistryService }]; }, null);
|
|
3627
3656
|
})();
|
|
3628
3657
|
|
|
3629
3658
|
var RecipeProviderService = /** @class */ (function (_super) {
|
|
@@ -4866,6 +4895,7 @@
|
|
|
4866
4895
|
this.closeModalOnSelected = false;
|
|
4867
4896
|
this.showStoreLocatorWarning = new rxjs.BehaviorSubject(false);
|
|
4868
4897
|
this.showNoSupplierOnboarding = new rxjs.BehaviorSubject(false);
|
|
4898
|
+
this.changePosAfterWarnConfirm = true;
|
|
4869
4899
|
this.storeLocatorOpened$.subscribe(function (opened) {
|
|
4870
4900
|
if (opened && _this.storeLocatorOpenedTimestamp !== 0) {
|
|
4871
4901
|
_this.storeLocatorOpenedTimestamp = Date.now();
|
|
@@ -4882,7 +4912,8 @@
|
|
|
4882
4912
|
this.selectedSupplierName = e.detail.supplierName;
|
|
4883
4913
|
this.storeLocatorEventTrace = eventTrace;
|
|
4884
4914
|
// The following check is supposed to be temporary TODO remove
|
|
4885
|
-
if (
|
|
4915
|
+
if (this.isStoreLocatorWarningNeeded(e.detail.supplierId)) {
|
|
4916
|
+
this.changePosAfterWarnConfirm = true;
|
|
4886
4917
|
// Current device is a mobile device and the chosen supplier has not deactivated deep links
|
|
4887
4918
|
this.showStoreLocatorWarning.next(true);
|
|
4888
4919
|
}
|
|
@@ -4890,6 +4921,9 @@
|
|
|
4890
4921
|
this.changePos();
|
|
4891
4922
|
}
|
|
4892
4923
|
};
|
|
4924
|
+
StoreLocatorService.prototype.isStoreLocatorWarningNeeded = function (supplierId) {
|
|
4925
|
+
return /Mobi|Android|iPhone/i.test(navigator.userAgent) && supplierId === '7';
|
|
4926
|
+
};
|
|
4893
4927
|
StoreLocatorService.prototype.changePos = function () {
|
|
4894
4928
|
var _this = this;
|
|
4895
4929
|
this.subscriptions.push(this.posService.loadPos(this.selectedPosId).pipe(operators.skipWhile(function (pos) { return !pos || pos.id !== _this.selectedPosId; }), operators.switchMap(function (pos) {
|
|
@@ -5197,6 +5231,19 @@
|
|
|
5197
5231
|
return recipes.data;
|
|
5198
5232
|
}));
|
|
5199
5233
|
};
|
|
5234
|
+
RecipesService.prototype.searchRecipeByExtId = function (recipeExtId) {
|
|
5235
|
+
var _this = this;
|
|
5236
|
+
var url = MIAM_API_HOST$2 + "recipes/external/" + recipeExtId;
|
|
5237
|
+
return this.http.get(url).pipe(operators.map(function (response) {
|
|
5238
|
+
var _a;
|
|
5239
|
+
if (((_a = response.data) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === recipeExtId) {
|
|
5240
|
+
var recipe = _this.new();
|
|
5241
|
+
recipe.fill(response);
|
|
5242
|
+
return recipe;
|
|
5243
|
+
}
|
|
5244
|
+
return null;
|
|
5245
|
+
}));
|
|
5246
|
+
};
|
|
5200
5247
|
RecipesService.prototype.getPricing = function (recipeId, posId, pricebookKey, serves) {
|
|
5201
5248
|
if (serves === void 0) { serves = null; }
|
|
5202
5249
|
if (!recipeId) {
|
|
@@ -5318,6 +5365,22 @@
|
|
|
5318
5365
|
};
|
|
5319
5366
|
return this.get(recipeId, params);
|
|
5320
5367
|
};
|
|
5368
|
+
RecipesService.prototype.search = function (name, filters, page, include, sort) {
|
|
5369
|
+
var _this = this;
|
|
5370
|
+
var url = MIAM_API_HOST$2 + ("recipes/search?name=" + name);
|
|
5371
|
+
url += "&page[size]=" + (page.size || 20) + "&page[number]=" + (page.number || 1) + "&partner=" + filters.partner;
|
|
5372
|
+
filters.statuses.forEach(function (status) { return url += "&recipe_status_ids[]=" + status; });
|
|
5373
|
+
url += filters.types.length ? "&filter[recipe_type_id]=" + filters.types.join(',') : '';
|
|
5374
|
+
url += filters.providers.length ? "&filter[recipe_provider_id]=" + filters.providers.join(',') : '';
|
|
5375
|
+
url += filters.packages.length ? "&filter[packages]=" + filters.packages.join(',') : '';
|
|
5376
|
+
url += include.length ? "&include=" + include.join(',') : '';
|
|
5377
|
+
url += sort ? "&sort=" + sort : '';
|
|
5378
|
+
return this.http.get(url, {}).pipe(operators.map(function (returnedRecipes) {
|
|
5379
|
+
var recipes = _this.newCollection();
|
|
5380
|
+
recipes.fill(returnedRecipes);
|
|
5381
|
+
return recipes;
|
|
5382
|
+
}));
|
|
5383
|
+
};
|
|
5321
5384
|
// DEPRECATED / use TTL instead
|
|
5322
5385
|
RecipesService.prototype.getOrFetch = function (recipeId) {
|
|
5323
5386
|
var recipe = this.recipes.find(function (r) { return r.id === recipeId; });
|
|
@@ -5325,7 +5388,7 @@
|
|
|
5325
5388
|
return rxjs.of(recipe);
|
|
5326
5389
|
}
|
|
5327
5390
|
else {
|
|
5328
|
-
return this.get(recipeId, { fields: {
|
|
5391
|
+
return this.get(recipeId, { fields: { recipes: ['number-of-guests', 'media-url'] } }).pipe(operators.skipWhile(function (r) { return r.is_loading; }));
|
|
5329
5392
|
}
|
|
5330
5393
|
};
|
|
5331
5394
|
/**
|
|
@@ -7664,7 +7727,7 @@
|
|
|
7664
7727
|
var ContextService = /** @class */ (function () {
|
|
7665
7728
|
function ContextService(posService, basketsService, userService, preferencesService, analyticsService, recipesService, mediaMatcher, suppliersService, breakpointObserver,
|
|
7666
7729
|
// private basketHandler: LegacyBasketsSynchronizerService,
|
|
7667
|
-
basketHandler, storeLocatorService, recipeLikesService, fakeCartService, historyService) {
|
|
7730
|
+
basketHandler, storeLocatorService, recipeLikesService, fakeCartService, historyService, contextRegistryService) {
|
|
7668
7731
|
var _this = this;
|
|
7669
7732
|
this.posService = posService;
|
|
7670
7733
|
this.basketsService = basketsService;
|
|
@@ -7680,6 +7743,7 @@
|
|
|
7680
7743
|
this.recipeLikesService = recipeLikesService;
|
|
7681
7744
|
this.fakeCartService = fakeCartService;
|
|
7682
7745
|
this.historyService = historyService;
|
|
7746
|
+
this.contextRegistryService = contextRegistryService;
|
|
7683
7747
|
this.videoRecipesEnabled = false;
|
|
7684
7748
|
this.articlesInCatalogEnabled = false;
|
|
7685
7749
|
this.tagsOnRecipesEnabled = false;
|
|
@@ -7894,9 +7958,8 @@
|
|
|
7894
7958
|
throw new Error('the token does not have the correct format');
|
|
7895
7959
|
}
|
|
7896
7960
|
_this.mealz.supplier.setOrigin(parsedToken.origin);
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
}
|
|
7961
|
+
_this.mealz.analytics.init(parsedToken.domain);
|
|
7962
|
+
_this.contextRegistryService.disabledAnalytics = !!parsedToken.disableAnalytics;
|
|
7900
7963
|
if (parsedToken.orderHistory) {
|
|
7901
7964
|
_this.orderHistoryEnabled = parsedToken.orderHistory;
|
|
7902
7965
|
}
|
|
@@ -7921,12 +7984,14 @@
|
|
|
7921
7984
|
user: {
|
|
7922
7985
|
loadWithAuthlessId: function (id, forbidProfiling) {
|
|
7923
7986
|
if (forbidProfiling === void 0) { forbidProfiling = false; }
|
|
7987
|
+
_this.contextRegistryService.forbidProfiling = forbidProfiling;
|
|
7924
7988
|
localStorage.setItem('_miam/authlessId', id);
|
|
7925
7989
|
localStorage.setItem('_miam/authless-forbid-profiling', '' + forbidProfiling);
|
|
7926
7990
|
},
|
|
7927
7991
|
loadWithExternalId: function (id, forbidProfiling, initBasket) {
|
|
7928
7992
|
if (forbidProfiling === void 0) { forbidProfiling = false; }
|
|
7929
7993
|
if (initBasket === void 0) { initBasket = false; }
|
|
7994
|
+
_this.contextRegistryService.forbidProfiling = forbidProfiling;
|
|
7930
7995
|
_this.loggedOnSession = true;
|
|
7931
7996
|
localStorage.setItem('_miam/userId', id);
|
|
7932
7997
|
localStorage.removeItem('_miam/userToken');
|
|
@@ -8162,7 +8227,7 @@
|
|
|
8162
8227
|
};
|
|
8163
8228
|
return ContextService;
|
|
8164
8229
|
}());
|
|
8165
|
-
ContextService.ɵfac = function ContextService_Factory(t) { return new (t || ContextService)(i0__namespace.ɵɵinject(PointOfSalesService), i0__namespace.ɵɵinject(BasketsService), i0__namespace.ɵɵinject(UserService), i0__namespace.ɵɵinject(PreferencesService), i0__namespace.ɵɵinject(AnalyticsService), i0__namespace.ɵɵinject(RecipesService), i0__namespace.ɵɵinject(i7__namespace.MediaMatcher), i0__namespace.ɵɵinject(SuppliersService), i0__namespace.ɵɵinject(i7__namespace.BreakpointObserver), i0__namespace.ɵɵinject(BasketsSynchronizerService), i0__namespace.ɵɵinject(StoreLocatorService), i0__namespace.ɵɵinject(RecipeLikesService), i0__namespace.ɵɵinject(FakeRetailerCartService), i0__namespace.ɵɵinject(HistoryService)); };
|
|
8230
|
+
ContextService.ɵfac = function ContextService_Factory(t) { return new (t || ContextService)(i0__namespace.ɵɵinject(PointOfSalesService), i0__namespace.ɵɵinject(BasketsService), i0__namespace.ɵɵinject(UserService), i0__namespace.ɵɵinject(PreferencesService), i0__namespace.ɵɵinject(AnalyticsService), i0__namespace.ɵɵinject(RecipesService), i0__namespace.ɵɵinject(i7__namespace.MediaMatcher), i0__namespace.ɵɵinject(SuppliersService), i0__namespace.ɵɵinject(i7__namespace.BreakpointObserver), i0__namespace.ɵɵinject(BasketsSynchronizerService), i0__namespace.ɵɵinject(StoreLocatorService), i0__namespace.ɵɵinject(RecipeLikesService), i0__namespace.ɵɵinject(FakeRetailerCartService), i0__namespace.ɵɵinject(HistoryService), i0__namespace.ɵɵinject(ContextRegistryService)); };
|
|
8166
8231
|
ContextService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: ContextService, factory: ContextService.ɵfac, providedIn: 'root' });
|
|
8167
8232
|
(function () {
|
|
8168
8233
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(ContextService, [{
|
|
@@ -8170,7 +8235,7 @@
|
|
|
8170
8235
|
args: [{
|
|
8171
8236
|
providedIn: 'root'
|
|
8172
8237
|
}]
|
|
8173
|
-
}], function () { return [{ type: PointOfSalesService }, { type: BasketsService }, { type: UserService }, { type: PreferencesService }, { type: AnalyticsService }, { type: RecipesService }, { type: i7__namespace.MediaMatcher }, { type: SuppliersService }, { type: i7__namespace.BreakpointObserver }, { type: BasketsSynchronizerService }, { type: StoreLocatorService }, { type: RecipeLikesService }, { type: FakeRetailerCartService }, { type: HistoryService }]; }, null);
|
|
8238
|
+
}], function () { return [{ type: PointOfSalesService }, { type: BasketsService }, { type: UserService }, { type: PreferencesService }, { type: AnalyticsService }, { type: RecipesService }, { type: i7__namespace.MediaMatcher }, { type: SuppliersService }, { type: i7__namespace.BreakpointObserver }, { type: BasketsSynchronizerService }, { type: StoreLocatorService }, { type: RecipeLikesService }, { type: FakeRetailerCartService }, { type: HistoryService }, { type: ContextRegistryService }]; }, null);
|
|
8174
8239
|
})();
|
|
8175
8240
|
|
|
8176
8241
|
var _c0$p = function (a0, a1) { return { "width": a0, "height": a1 }; };
|
|
@@ -12697,9 +12762,8 @@
|
|
|
12697
12762
|
var _this = this;
|
|
12698
12763
|
var _a, _b;
|
|
12699
12764
|
if (!(((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) && ((_b = this.recipeExtId) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
12700
|
-
return this.recipesService.
|
|
12701
|
-
|
|
12702
|
-
_this.recipeId = ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === _this.recipeExtId ? response.data[0].id : null;
|
|
12765
|
+
return this.recipesService.searchRecipeByExtId(this.recipeExtId).pipe(operators.tap(function (response) {
|
|
12766
|
+
_this.recipeId = (response === null || response === void 0 ? void 0 : response.id) || null;
|
|
12703
12767
|
_this.cdr.detectChanges();
|
|
12704
12768
|
}));
|
|
12705
12769
|
}
|
|
@@ -16659,7 +16723,7 @@
|
|
|
16659
16723
|
}
|
|
16660
16724
|
return this.recipesService.get(this.line.id, {
|
|
16661
16725
|
include: ['ingredients'],
|
|
16662
|
-
fields: {
|
|
16726
|
+
fields: { recipes: ['number-of-guests'], ingredients: ['name', 'quantity', 'unit'] }
|
|
16663
16727
|
}).pipe(operators.switchMap(function (recipe) {
|
|
16664
16728
|
_this.legacyRecipe = recipe;
|
|
16665
16729
|
var requests = recipe.relationships.ingredients.data.map(function (ing) { return _this.basketsService.basketEntryFromIngredient(ing.id, _this.line.count).pipe(operators.map(function (entry) {
|
|
@@ -20234,7 +20298,7 @@
|
|
|
20234
20298
|
}));
|
|
20235
20299
|
}
|
|
20236
20300
|
else if (!this.recipe && this.recipeExtId) {
|
|
20237
|
-
this.subscriptions.push(this.searchRecipeByExtId().subscribe(function (result) {
|
|
20301
|
+
this.subscriptions.push(this.recipeService.searchRecipeByExtId(this.recipeExtId).subscribe(function (result) {
|
|
20238
20302
|
_this.recipe = result;
|
|
20239
20303
|
if (!result) {
|
|
20240
20304
|
_this.hidden.emit();
|
|
@@ -20277,10 +20341,6 @@
|
|
|
20277
20341
|
// Until supplier ids are the same as the provider ids we use the origin to determine the provider on which we filter
|
|
20278
20342
|
return this.contextService.origin.pipe(operators.skipWhile(function (origin) { return !origin; }), operators.take(1), operators.switchMap(function (origin) { return _this.recipeService.all({ remotefilter: { recipe_provider_id: origin, search: _this.recipeName } }).pipe(operators.map(function (response) { var _a; return ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes.title) === _this.recipeName ? response.data[0] : null; })); }));
|
|
20279
20343
|
};
|
|
20280
|
-
RecipeCardCtaComponent.prototype.searchRecipeByExtId = function () {
|
|
20281
|
-
var _this = this;
|
|
20282
|
-
return this.recipeService.all({ remotefilter: { 'ext-id': this.recipeExtId } }).pipe(operators.map(function (response) { var _a; return ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === _this.recipeExtId ? response.data[0] : null; }));
|
|
20283
|
-
};
|
|
20284
20344
|
RecipeCardCtaComponent.prototype.currentPath = function () {
|
|
20285
20345
|
return '';
|
|
20286
20346
|
};
|
|
@@ -20307,7 +20367,7 @@
|
|
|
20307
20367
|
return RecipeCardCtaComponent;
|
|
20308
20368
|
}(EventTracerComponent));
|
|
20309
20369
|
RecipeCardCtaComponent.ɵfac = function RecipeCardCtaComponent_Factory(t) { return new (t || RecipeCardCtaComponent)(i0__namespace.ɵɵdirectiveInject(AnalyticsService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(UserService), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(ToasterService)); };
|
|
20310
|
-
RecipeCardCtaComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: RecipeCardCtaComponent, selectors: [["ng-miam-recipe-card-cta"]], inputs: { recipeName: "recipeName", recipeExtId: "recipeExtId", recipe: "recipe", serves: "serves", previewAllowed: "previewAllowed", helpButtonAllowed: "helpButtonAllowed", displayGuests: "displayGuests" }, outputs: { displayed: "displayed", clicked: "clicked", hidden: "hidden" }, features: [i0__namespace.ɵɵInheritDefinitionFeature, i0__namespace.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["class", "miam-recipe-card-cta", 4, "ngIf"], [1, "miam-recipe-card-cta"], [1, "miam-ds-button", 3, "disabled", "ngClass", "click"], [4, "ngIf", "ngIfElse"], ["seeIngredients", ""], ["alt", "basket icon", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/InCart_primary.svg", "alt", "see ingredients"]], template: function RecipeCardCtaComponent_Template(rf, ctx) {
|
|
20370
|
+
RecipeCardCtaComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: RecipeCardCtaComponent, selectors: [["ng-miam-recipe-card-cta"]], inputs: { recipeName: "recipeName", recipeExtId: "recipeExtId", recipe: "recipe", serves: "serves", previewAllowed: "previewAllowed", helpButtonAllowed: "helpButtonAllowed", displayGuests: "displayGuests" }, outputs: { displayed: "displayed", clicked: "clicked", hidden: "hidden" }, features: [i0__namespace.ɵɵInheritDefinitionFeature, i0__namespace.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["class", "miam-recipe-card-cta", 4, "ngIf"], [1, "miam-recipe-card-cta"], [1, "miam-recipe-card-cta__button", "miam-ds-button", 3, "disabled", "ngClass", "click"], [4, "ngIf", "ngIfElse"], ["seeIngredients", ""], ["alt", "basket icon", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/InCart_primary.svg", "alt", "see ingredients"]], template: function RecipeCardCtaComponent_Template(rf, ctx) {
|
|
20311
20371
|
if (rf & 1) {
|
|
20312
20372
|
i0__namespace.ɵɵtemplate(0, RecipeCardCtaComponent_div_0_Template, 6, 10, "div", 0);
|
|
20313
20373
|
}
|
|
@@ -23965,9 +24025,10 @@
|
|
|
23965
24025
|
return rxjs.of([]);
|
|
23966
24026
|
}
|
|
23967
24027
|
})).subscribe(function (tags) {
|
|
23968
|
-
var _a;
|
|
23969
|
-
_this.suggestedTags = tags.data
|
|
23970
|
-
|
|
24028
|
+
var _a, _b;
|
|
24029
|
+
_this.suggestedTags = (_a = tags === null || tags === void 0 ? void 0 : tags.data) === null || _a === void 0 ? void 0 : _a.filter(function (tag) { return tag.attributes['tag-type-id'] === 'ingredient_category' ||
|
|
24030
|
+
tag.attributes['tag-type-id'] === 'ingredientsdefinition'; });
|
|
24031
|
+
_this.notFound = ((_b = _this.suggestedTags) === null || _b === void 0 ? void 0 : _b.length) === 0;
|
|
23971
24032
|
_this.cdr.detectChanges();
|
|
23972
24033
|
}));
|
|
23973
24034
|
};
|
|
@@ -24418,10 +24479,12 @@
|
|
|
24418
24479
|
this.preferencesService.updatePreferences();
|
|
24419
24480
|
this.preferencesChanged.emit();
|
|
24420
24481
|
if (this.contextService.isPreferencesSSR) {
|
|
24421
|
-
this.updateFiltersInCache();
|
|
24482
|
+
this.updateFiltersInCache(true);
|
|
24483
|
+
}
|
|
24484
|
+
else {
|
|
24485
|
+
this.contextService.preferencesChanged.emit();
|
|
24486
|
+
this.close();
|
|
24422
24487
|
}
|
|
24423
|
-
this.contextService.preferencesChanged.emit();
|
|
24424
|
-
this.close();
|
|
24425
24488
|
};
|
|
24426
24489
|
PreferencesComponent.prototype.close = function () {
|
|
24427
24490
|
this.isOpen = false;
|
|
@@ -24441,16 +24504,21 @@
|
|
|
24441
24504
|
PreferencesComponent.prototype.whitelistedTags = function (tags) {
|
|
24442
24505
|
return tags.filter(function (tag) { return environment$1.tagsWhitelist.includes(tag.id); });
|
|
24443
24506
|
};
|
|
24444
|
-
PreferencesComponent.prototype.updateFiltersInCache = function () {
|
|
24507
|
+
PreferencesComponent.prototype.updateFiltersInCache = function (closeModal) {
|
|
24508
|
+
var _this = this;
|
|
24509
|
+
if (closeModal === void 0) { closeModal = false; }
|
|
24445
24510
|
var filters = new RecipeFilters();
|
|
24446
24511
|
var allFilters = this.preferencesService.addPreferencesToRemoteFilters(filters, true);
|
|
24447
24512
|
var filtersToAdd = Object.assign({ exclude_tags: allFilters.exclude_tags, include_tags: allFilters.include_tags }, (this.preferencesService.guests !== 4 && { guests: this.preferencesService.guests }));
|
|
24448
|
-
|
|
24449
|
-
this.preferencesService.sendCacheRequest('set', 'preferences', filtersToAdd)
|
|
24450
|
-
|
|
24451
|
-
|
|
24452
|
-
|
|
24453
|
-
|
|
24513
|
+
var sendRequest = Object.keys(filtersToAdd).length > 0
|
|
24514
|
+
? this.preferencesService.sendCacheRequest('set', 'preferences', filtersToAdd)
|
|
24515
|
+
: this.preferencesService.sendCacheRequest('remove', 'preferences');
|
|
24516
|
+
sendRequest.subscribe(function () {
|
|
24517
|
+
if (closeModal) {
|
|
24518
|
+
_this.contextService.preferencesChanged.emit();
|
|
24519
|
+
_this.close();
|
|
24520
|
+
}
|
|
24521
|
+
});
|
|
24454
24522
|
};
|
|
24455
24523
|
return PreferencesComponent;
|
|
24456
24524
|
}(EventTracerComponent));
|
|
@@ -24528,7 +24596,7 @@
|
|
|
24528
24596
|
else {
|
|
24529
24597
|
i18n_16 = $localize(templateObject_9$3 || (templateObject_9$3 = __makeTemplateObject([":\u241Fd52eb7599c75829bf96401d33dfdad4f9857822b\u241F4160637687093543290:Appliquer"], [":\u241Fd52eb7599c75829bf96401d33dfdad4f9857822b\u241F4160637687093543290:Appliquer"])));
|
|
24530
24598
|
}
|
|
24531
|
-
return [["modalStyle", "right", 3, "noHeaderMode", "display", "close"], [1, "miam-preferences"], [1, "miam-preferences__header"], [4, "ngIf"], ["class", "miam-preferences_nav-and-title", 4, "ngIf"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__back-button", 3, "click"], ["alt", "go back", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg", 1, "miam-preferences__back-image"], [1, "miam-ds-text", "size-l", "weight-xxl", "miam-preferences__title"], i18n_0, [1, "miam-ds-button", "ghost", "square", "miam-preferences__close-button", 3, "click"], ["alt", "close modal", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg", 1, "miam-preferences__close-image"], [1, "miam-preferences_nav-and-title"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__search-back-button", 3, "click"], i18n_2, [1, "miam-preferences__guests"], [1, "miam-ds-text", "miam-preferences_guest-label"], i18n_4, [1, "miam-preferences_guest-counter", 3, "value", "valueChange"], [1, "miam-preferences__diet-section", 3, "isCollapsed", "isCollapsedChange"], [1, "miam-ds-text", "weight-xl"], i18n_6, [1, "miam-preferences__list"], ["class", "miam-preferences__list__item miam-ds-checkbox", 3, "click", 4, "ngFor", "ngForOf"], [1, "miam-preferences__dislikes-section", 3, "isCollapsed", "isCollapsedChange"], i18n_8, ["class", "miam-ds-badge miam-preferences__badge", 3, "ngClass", "click", 4, "ngFor", "ngForOf"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "click"], [1, "miam-preferences__badge_label"], i18n_10, ["alt", "add dislikes", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-neutral-black.svg"], [1, "miam-preferences__equipments-section", 3, "isCollapsed", "isCollapsedChange"], i18n_12, [1, "miam-preferences__footer"], [1, "miam-ds-button", "secondary", "miam-preferences__footer__reset", 3, "click"], i18n_14, [1, "miam-ds-button", "primary", "miam-preferences__footer__recipes", 3, "click"], i18n_16, [1, "miam-preferences__list__item", "miam-ds-checkbox", 3, "click"], [1, "miam-ds-text", "miam-preferences__list__item__name"], ["type", "checkbox", 3, "checked"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "ngClass", "click"], ["class", "miam-preferences__remove-tag", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 3, "alt", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 1, "miam-preferences__remove-tag", 3, "alt"], [1, "miam-preferences__list__item__name"], [3, "backAndReload"]];
|
|
24599
|
+
return [["modalStyle", "right", 1, "miam-preferences-modal", 3, "noHeaderMode", "display", "close"], [1, "miam-preferences"], [1, "miam-preferences__header"], [4, "ngIf"], ["class", "miam-preferences_nav-and-title", 4, "ngIf"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__back-button", 3, "click"], ["alt", "go back", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg", 1, "miam-preferences__back-image"], [1, "miam-ds-text", "size-l", "weight-xxl", "miam-preferences__title"], i18n_0, [1, "miam-ds-button", "ghost", "square", "miam-preferences__close-button", 3, "click"], ["alt", "close modal", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg", 1, "miam-preferences__close-image"], [1, "miam-preferences_nav-and-title"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__search-back-button", 3, "click"], i18n_2, [1, "miam-preferences__guests"], [1, "miam-ds-text", "miam-preferences_guest-label"], i18n_4, [1, "miam-preferences_guest-counter", 3, "value", "valueChange"], [1, "miam-preferences__diet-section", 3, "isCollapsed", "isCollapsedChange"], [1, "miam-ds-text", "weight-xl"], i18n_6, [1, "miam-preferences__list"], ["class", "miam-preferences__list__item miam-ds-checkbox", 3, "click", 4, "ngFor", "ngForOf"], [1, "miam-preferences__dislikes-section", 3, "isCollapsed", "isCollapsedChange"], i18n_8, ["class", "miam-ds-badge miam-preferences__badge", 3, "ngClass", "click", 4, "ngFor", "ngForOf"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "click"], [1, "miam-preferences__badge_label"], i18n_10, ["alt", "add dislikes", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-neutral-black.svg"], [1, "miam-preferences__equipments-section", 3, "isCollapsed", "isCollapsedChange"], i18n_12, [1, "miam-preferences__footer"], [1, "miam-ds-button", "secondary", "miam-preferences__footer__reset", 3, "click"], i18n_14, [1, "miam-ds-button", "primary", "miam-preferences__footer__recipes", 3, "click"], i18n_16, [1, "miam-preferences__list__item", "miam-ds-checkbox", 3, "click"], [1, "miam-ds-text", "miam-preferences__list__item__name"], ["type", "checkbox", 3, "checked"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "ngClass", "click"], ["class", "miam-preferences__remove-tag", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 3, "alt", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 1, "miam-preferences__remove-tag", 3, "alt"], [1, "miam-preferences__list__item__name"], [3, "backAndReload"]];
|
|
24532
24600
|
}, template: function PreferencesComponent_Template(rf, ctx) {
|
|
24533
24601
|
if (rf & 1) {
|
|
24534
24602
|
i0__namespace.ɵɵelementStart(0, "ng-miam-modal", 0);
|
|
@@ -24935,7 +25003,7 @@
|
|
|
24935
25003
|
i0__namespace.ɵɵlistener("filterChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_recipe_filters_filterChanged_8_listener($event) { i0__namespace.ɵɵrestoreView(_r61_1); var ctx_r62 = i0__namespace.ɵɵnextContext(); return ctx_r62.updateFilters($event); })("filterCollapsed", function RecipeCatalogComponent_div_2_Template_ng_miam_recipe_filters_filterCollapsed_8_listener() { i0__namespace.ɵɵrestoreView(_r61_1); var ctx_r63 = i0__namespace.ɵɵnextContext(); return ctx_r63.onFilterCollapsed(); })("preferencesChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_recipe_filters_preferencesChanged_8_listener() { i0__namespace.ɵɵrestoreView(_r61_1); var ctx_r64 = i0__namespace.ɵɵnextContext(); return ctx_r64.reloadPackages(); });
|
|
24936
25004
|
i0__namespace.ɵɵelementEnd();
|
|
24937
25005
|
i0__namespace.ɵɵelementStart(9, "ng-miam-preferences", 12);
|
|
24938
|
-
i0__namespace.ɵɵlistener("isOpenChange", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_isOpenChange_9_listener($event) { i0__namespace.ɵɵrestoreView(_r61_1); var ctx_r65 = i0__namespace.ɵɵnextContext(); return ctx_r65.isPreferenceModalOpen = $event; })("preferencesChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_preferencesChanged_9_listener() { i0__namespace.ɵɵrestoreView(_r61_1); var ctx_r66 = i0__namespace.ɵɵnextContext(); ctx_r66.updateFilters(ctx_r66.filters); return ctx_r66.reloadPackages(); });
|
|
25006
|
+
i0__namespace.ɵɵlistener("isOpenChange", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_isOpenChange_9_listener($event) { i0__namespace.ɵɵrestoreView(_r61_1); var ctx_r65 = i0__namespace.ɵɵnextContext(); return ctx_r65.isPreferenceModalOpen = $event; })("preferencesChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_preferencesChanged_9_listener() { i0__namespace.ɵɵrestoreView(_r61_1); var ctx_r66 = i0__namespace.ɵɵnextContext(); ctx_r66.updateFilters(ctx_r66.filters, false); return ctx_r66.reloadPackages(); });
|
|
24939
25007
|
i0__namespace.ɵɵelementEnd();
|
|
24940
25008
|
i0__namespace.ɵɵtemplate(10, RecipeCatalogComponent_div_2_ng_template_10_Template, 1, 1, "ng-template", null, 13, i0__namespace.ɵɵtemplateRefExtractor);
|
|
24941
25009
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -25115,9 +25183,10 @@
|
|
|
25115
25183
|
this.filters.search = '';
|
|
25116
25184
|
this.filters.additionalFilters = null;
|
|
25117
25185
|
};
|
|
25118
|
-
RecipeCatalogComponent.prototype.updateFilters = function (filters) {
|
|
25186
|
+
RecipeCatalogComponent.prototype.updateFilters = function (filters, forceListView) {
|
|
25187
|
+
if (forceListView === void 0) { forceListView = true; }
|
|
25119
25188
|
this.filters = filters.copy(); // necessary to trigger child component change
|
|
25120
|
-
this.forceListView =
|
|
25189
|
+
this.forceListView = forceListView;
|
|
25121
25190
|
this.filterToRemove = undefined;
|
|
25122
25191
|
this.cdr.detectChanges();
|
|
25123
25192
|
this.setStickyObserver();
|
|
@@ -26448,25 +26517,36 @@
|
|
|
26448
26517
|
})();
|
|
26449
26518
|
var templateObject_1$7, templateObject_2$5;
|
|
26450
26519
|
|
|
26520
|
+
function StoreLocatorLinkComponent_div_0_span_1_img_1_Template(rf, ctx) {
|
|
26521
|
+
if (rf & 1) {
|
|
26522
|
+
var _r4_1 = i0__namespace.ɵɵgetCurrentView();
|
|
26523
|
+
i0__namespace.ɵɵelementStart(0, "img", 8);
|
|
26524
|
+
i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_span_1_img_1_Template_img_click_0_listener() { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r3 = i0__namespace.ɵɵnextContext(3); return ctx_r3.showTooltip(); });
|
|
26525
|
+
i0__namespace.ɵɵelementEnd();
|
|
26526
|
+
}
|
|
26527
|
+
}
|
|
26451
26528
|
function StoreLocatorLinkComponent_div_0_span_1_Template(rf, ctx) {
|
|
26452
26529
|
if (rf & 1) {
|
|
26453
26530
|
i0__namespace.ɵɵelementStart(0, "span", 6);
|
|
26454
|
-
i0__namespace.ɵɵ
|
|
26531
|
+
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_img_1_Template, 1, 0, "img", 7);
|
|
26532
|
+
i0__namespace.ɵɵtext(2);
|
|
26455
26533
|
i0__namespace.ɵɵelementEnd();
|
|
26456
26534
|
}
|
|
26457
26535
|
if (rf & 2) {
|
|
26458
26536
|
var ctx_r1 = i0__namespace.ɵɵnextContext(2);
|
|
26459
26537
|
i0__namespace.ɵɵadvance(1);
|
|
26538
|
+
i0__namespace.ɵɵproperty("ngIf", ctx_r1.showIconTooltip);
|
|
26539
|
+
i0__namespace.ɵɵadvance(1);
|
|
26460
26540
|
i0__namespace.ɵɵtextInterpolate2(" ", ctx_r1.currentPos.relationships.supplier.data.attributes.name, " - ", ctx_r1.currentPos.attributes.name, " ");
|
|
26461
26541
|
}
|
|
26462
26542
|
}
|
|
26463
26543
|
function StoreLocatorLinkComponent_div_0_Template(rf, ctx) {
|
|
26464
26544
|
if (rf & 1) {
|
|
26465
|
-
var
|
|
26545
|
+
var _r6_1 = i0__namespace.ɵɵgetCurrentView();
|
|
26466
26546
|
i0__namespace.ɵɵelementStart(0, "div", 1);
|
|
26467
|
-
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template,
|
|
26547
|
+
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template, 3, 3, "span", 2);
|
|
26468
26548
|
i0__namespace.ɵɵelementStart(2, "button", 3);
|
|
26469
|
-
i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_Template_button_click_2_listener() { i0__namespace.ɵɵrestoreView(
|
|
26549
|
+
i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_Template_button_click_2_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.storeLocatorService.openStoreLocator(); });
|
|
26470
26550
|
i0__namespace.ɵɵelement(3, "img", 4);
|
|
26471
26551
|
i0__namespace.ɵɵelementStart(4, "span");
|
|
26472
26552
|
i0__namespace.ɵɵi18n(5, 5);
|
|
@@ -26487,11 +26567,13 @@
|
|
|
26487
26567
|
this.suppliersService = suppliersService;
|
|
26488
26568
|
this.cdr = cdr;
|
|
26489
26569
|
this.subscriptions = [];
|
|
26570
|
+
this.showIconTooltip = false;
|
|
26490
26571
|
}
|
|
26491
26572
|
StoreLocatorLinkComponent.prototype.ngOnInit = function () {
|
|
26492
26573
|
var _this = this;
|
|
26493
26574
|
this.subscriptions.push(this.posService.pos$.subscribe(function (pos) {
|
|
26494
26575
|
_this.currentPos = pos;
|
|
26576
|
+
_this.setTooltipVisibility();
|
|
26495
26577
|
_this.cdr.detectChanges();
|
|
26496
26578
|
}));
|
|
26497
26579
|
};
|
|
@@ -26499,6 +26581,15 @@
|
|
|
26499
26581
|
this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
|
|
26500
26582
|
this.storeLocatorService.unsubscribe();
|
|
26501
26583
|
};
|
|
26584
|
+
StoreLocatorLinkComponent.prototype.setTooltipVisibility = function () {
|
|
26585
|
+
var _a;
|
|
26586
|
+
this.showIconTooltip = this.storeLocatorService.isStoreLocatorWarningNeeded((_a = this.currentPos) === null || _a === void 0 ? void 0 : _a.relationships.supplier.data.id);
|
|
26587
|
+
};
|
|
26588
|
+
StoreLocatorLinkComponent.prototype.showTooltip = function () {
|
|
26589
|
+
this.storeLocatorService.changePosAfterWarnConfirm = false;
|
|
26590
|
+
this.storeLocatorService.showStoreLocatorWarning.next(true);
|
|
26591
|
+
this.cdr.detectChanges();
|
|
26592
|
+
};
|
|
26502
26593
|
return StoreLocatorLinkComponent;
|
|
26503
26594
|
}());
|
|
26504
26595
|
StoreLocatorLinkComponent.ɵfac = function StoreLocatorLinkComponent_Factory(t) { return new (t || StoreLocatorLinkComponent)(i0__namespace.ɵɵdirectiveInject(StoreLocatorService), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(SuppliersService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef)); };
|
|
@@ -26511,7 +26602,7 @@
|
|
|
26511
26602
|
else {
|
|
26512
26603
|
i18n_0 = $localize(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject([":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"], [":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"])));
|
|
26513
26604
|
}
|
|
26514
|
-
return [["class", "miam-store-locator-link", 4, "ngIf"], [1, "miam-store-locator-link"], ["class", "miam-store-locator-link__store-name miam-ds-text weight-xl size-s", 4, "ngIf"], [1, "miam-store-locator-link__swap-pos-button", "miam-ds-button", "primary", "reverse", "small", 3, "click"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Swap.svg", "alt", "swap point of sale", 1, "miam-store-locator-link__swap-pos-icon"], i18n_0, [1, "miam-store-locator-link__store-name", "miam-ds-text", "weight-xl", "size-s"]];
|
|
26605
|
+
return [["class", "miam-store-locator-link", 4, "ngIf"], [1, "miam-store-locator-link"], ["class", "miam-store-locator-link__store-name miam-ds-text weight-xl size-s", 4, "ngIf"], [1, "miam-store-locator-link__swap-pos-button", "miam-ds-button", "primary", "reverse", "small", 3, "click"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Swap.svg", "alt", "swap point of sale", 1, "miam-store-locator-link__swap-pos-icon"], i18n_0, [1, "miam-store-locator-link__store-name", "miam-ds-text", "weight-xl", "size-s"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Infos_Primary.svg", "alt", "Info", 3, "click", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Infos_Primary.svg", "alt", "Info", 3, "click"]];
|
|
26515
26606
|
}, template: function StoreLocatorLinkComponent_Template(rf, ctx) {
|
|
26516
26607
|
if (rf & 1) {
|
|
26517
26608
|
i0__namespace.ɵɵtemplate(0, StoreLocatorLinkComponent_div_0_Template, 6, 1, "div", 0);
|
|
@@ -26520,7 +26611,7 @@
|
|
|
26520
26611
|
if (rf & 2) {
|
|
26521
26612
|
i0__namespace.ɵɵproperty("ngIf", i0__namespace.ɵɵpipeBind1(1, 1, ctx.posService.waitForPos));
|
|
26522
26613
|
}
|
|
26523
|
-
}, directives: [i2__namespace.NgIf], pipes: [i2__namespace.AsyncPipe], styles: [".miam-store-locator-link{padding:8px 16px;display:flex;align-items:center;justify-content:space-between;background:var(--miam-ds-color-primary-100)}.miam-store-locator-link .miam-store-locator-link__swap-pos-button{border-radius:16px;display:flex;gap:8px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small{padding:8px 12px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small:hover{background-color:var(--miam-ds-color-primary-text);color:var(--miam-ds-color-primary)}"], encapsulation: 2, changeDetection: 0 });
|
|
26614
|
+
}, directives: [i2__namespace.NgIf], pipes: [i2__namespace.AsyncPipe], styles: [".miam-store-locator-link{padding:8px 16px;display:flex;align-items:center;justify-content:space-between;background:var(--miam-ds-color-primary-100)}.miam-store-locator-link .miam-store-locator-link__store-name{display:flex}.miam-store-locator-link .miam-store-locator-link__store-name img{margin-right:8px;cursor:pointer}.miam-store-locator-link .miam-store-locator-link__swap-pos-button{border-radius:16px;display:flex;gap:8px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small{padding:8px 12px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small:hover{background-color:var(--miam-ds-color-primary-text);color:var(--miam-ds-color-primary)}"], encapsulation: 2, changeDetection: 0 });
|
|
26524
26615
|
(function () {
|
|
26525
26616
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(StoreLocatorLinkComponent, [{
|
|
26526
26617
|
type: i0.Component,
|
|
@@ -27200,7 +27291,7 @@
|
|
|
27200
27291
|
};
|
|
27201
27292
|
RecipeDetailsComponent.prototype.ngOnChanges = function (changes) {
|
|
27202
27293
|
var _a;
|
|
27203
|
-
if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
27294
|
+
if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0 && !(!this.posService.pos$.getValue() && this.contextService.noSupplier)) {
|
|
27204
27295
|
this.recipeDetailsOpenTimestamp = Date.now();
|
|
27205
27296
|
this.fetchRecipe(this.recipeId);
|
|
27206
27297
|
this.cdr.detectChanges();
|
|
@@ -29242,7 +29333,9 @@
|
|
|
29242
29333
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
29243
29334
|
};
|
|
29244
29335
|
WarningStoreLocatorComponent.prototype.onConfirm = function () {
|
|
29245
|
-
this.storeLocatoreService.
|
|
29336
|
+
if (this.storeLocatoreService.changePosAfterWarnConfirm) {
|
|
29337
|
+
this.storeLocatoreService.changePos();
|
|
29338
|
+
}
|
|
29246
29339
|
this.storeLocatoreService.showStoreLocatorWarning.next(false);
|
|
29247
29340
|
};
|
|
29248
29341
|
return WarningStoreLocatorComponent;
|