ng-miam 4.6.8 → 4.6.10

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.
@@ -3837,7 +3837,7 @@
3837
3837
  _this.displayHelper$ = new rxjs.BehaviorSubject(false);
3838
3838
  _this.displayedRecipeChanged = new i0.EventEmitter();
3839
3839
  _this.hidden = new i0.EventEmitter();
3840
- _this.suggestionsPrimaryButtonActions = { display: true, addToBasket: true };
3840
+ _this.recipesPrimaryButtonActions = { display: true, addToBasket: true };
3841
3841
  _this.difficultyLevels = [
3842
3842
  { value: 1, label: 'Chef débutant' },
3843
3843
  { value: 2, label: 'Chef intermédiaire' },
@@ -4478,10 +4478,10 @@
4478
4478
  setDefaultIngredientPicture: function (url) {
4479
4479
  _this.defaultIngredientPicture = url;
4480
4480
  },
4481
- setSuggestionsPrimaryButtonActions: function (display, addToBasket) {
4481
+ setRecipesPrimaryButtonActions: function (display, addToBasket) {
4482
4482
  if (display === void 0) { display = true; }
4483
4483
  if (addToBasket === void 0) { addToBasket = true; }
4484
- _this.recipesService.suggestionsPrimaryButtonActions = { display: display, addToBasket: addToBasket };
4484
+ _this.recipesService.recipesPrimaryButtonActions = { display: display, addToBasket: addToBasket };
4485
4485
  },
4486
4486
  setDifficultyLevels: function (levels) {
4487
4487
  _this.recipesService.difficultyLevels = levels;
@@ -11497,18 +11497,13 @@
11497
11497
  if (!this.addButtonLoading) {
11498
11498
  this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(function (recipeIsInList) {
11499
11499
  var wasAdded = !recipeIsInList;
11500
- if (_this.cardType !== 'suggestion-card') {
11501
- _this.addRecipe();
11500
+ if (_this.recipeService.recipesPrimaryButtonActions.addToBasket) {
11501
+ // If recipe is added we still want to diplay details
11502
+ _this.addRecipe(_this.recipeService.recipesPrimaryButtonActions.display || !wasAdded);
11502
11503
  }
11503
- else { // customizable actions for suggestions
11504
- if (_this.recipeService.suggestionsPrimaryButtonActions.addToBasket) {
11505
- // If recipe is added we still want to diplay details
11506
- _this.addRecipe(_this.recipeService.suggestionsPrimaryButtonActions.display || !wasAdded);
11507
- }
11508
- else {
11509
- if (_this.recipeService.suggestionsPrimaryButtonActions.display) {
11510
- _this.openRecipe();
11511
- }
11504
+ else {
11505
+ if (_this.recipeService.recipesPrimaryButtonActions.display) {
11506
+ _this.openRecipe();
11512
11507
  }
11513
11508
  }
11514
11509
  _this.primaryButtonClicked$.emit(!recipeIsInList); // !recipeIsInList = add action, so we emit true
@@ -11599,7 +11594,7 @@
11599
11594
  i0.ɵɵproperty("src", ctx_r15.recipe.filigraneLogoUrl, i0.ɵɵsanitizeUrl);
11600
11595
  }
11601
11596
  }
11602
- function CatalogRecipeCardComponent_div_4_div_5_Template(rf, ctx) {
11597
+ function CatalogRecipeCardComponent_div_4_div_4_Template(rf, ctx) {
11603
11598
  if (rf & 1) {
11604
11599
  i0.ɵɵelementStart(0, "div", 30);
11605
11600
  i0.ɵɵelement(1, "ng-miam-icon", 31);
@@ -11611,17 +11606,17 @@
11611
11606
  i0.ɵɵproperty("iconName", ctx_r16.icon.Video)("width", 80)("height", 80);
11612
11607
  }
11613
11608
  }
11614
- function CatalogRecipeCardComponent_div_4_ng_container_6_div_1_Template(rf, ctx) {
11609
+ function CatalogRecipeCardComponent_div_4_ng_container_5_div_1_Template(rf, ctx) {
11615
11610
  if (rf & 1) {
11616
11611
  i0.ɵɵelementStart(0, "div", 33);
11617
11612
  i0.ɵɵtext(1, " D\u00E9j\u00E0 ajout\u00E9e ");
11618
11613
  i0.ɵɵelementEnd();
11619
11614
  }
11620
11615
  }
11621
- function CatalogRecipeCardComponent_div_4_ng_container_6_Template(rf, ctx) {
11616
+ function CatalogRecipeCardComponent_div_4_ng_container_5_Template(rf, ctx) {
11622
11617
  if (rf & 1) {
11623
11618
  i0.ɵɵelementContainerStart(0);
11624
- i0.ɵɵtemplate(1, CatalogRecipeCardComponent_div_4_ng_container_6_div_1_Template, 2, 0, "div", 32);
11619
+ i0.ɵɵtemplate(1, CatalogRecipeCardComponent_div_4_ng_container_5_div_1_Template, 2, 0, "div", 32);
11625
11620
  i0.ɵɵpipe(2, "async");
11626
11621
  i0.ɵɵelementContainerEnd();
11627
11622
  }
@@ -11631,12 +11626,12 @@
11631
11626
  i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 1, ctx_r17.groceriesListsService.recipeIsInList(ctx_r17.recipe == null ? null : ctx_r17.recipe.id)));
11632
11627
  }
11633
11628
  }
11634
- function CatalogRecipeCardComponent_div_4_ng_container_7_Template(rf, ctx) {
11629
+ function CatalogRecipeCardComponent_div_4_ng_container_6_Template(rf, ctx) {
11635
11630
  if (rf & 1) {
11636
11631
  var _r25_1 = i0.ɵɵgetCurrentView();
11637
11632
  i0.ɵɵelementContainerStart(0);
11638
11633
  i0.ɵɵelementStart(1, "div", 34);
11639
- i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_ng_container_7_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r25_1); var ctx_r24 = i0.ɵɵnextContext(2); return ctx_r24.openRecipe(); });
11634
+ i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_ng_container_6_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r25_1); var ctx_r24 = i0.ɵɵnextContext(2); return ctx_r24.openRecipe(); });
11640
11635
  i0.ɵɵtext(2);
11641
11636
  i0.ɵɵelementEnd();
11642
11637
  i0.ɵɵelementContainerEnd();
@@ -11647,7 +11642,7 @@
11647
11642
  i0.ɵɵtextInterpolate1(" ", ctx_r18.recipe == null ? null : ctx_r18.recipe.attributes["title"], " ");
11648
11643
  }
11649
11644
  }
11650
- function CatalogRecipeCardComponent_div_4_ng_template_8_Template(rf, ctx) {
11645
+ function CatalogRecipeCardComponent_div_4_ng_template_7_Template(rf, ctx) {
11651
11646
  if (rf & 1) {
11652
11647
  i0.ɵɵelement(0, "ng-miam-skeleton", 35);
11653
11648
  }
@@ -11656,7 +11651,7 @@
11656
11651
  i0.ɵɵproperty("type", ctx_r20.skeleton.Text);
11657
11652
  }
11658
11653
  }
11659
- function CatalogRecipeCardComponent_div_4_ng_miam_like_button_11_Template(rf, ctx) {
11654
+ function CatalogRecipeCardComponent_div_4_ng_miam_like_button_10_Template(rf, ctx) {
11660
11655
  if (rf & 1) {
11661
11656
  i0.ɵɵelement(0, "ng-miam-like-button", 36);
11662
11657
  }
@@ -11673,37 +11668,36 @@
11673
11668
  i0.ɵɵelementStart(1, "div", 18);
11674
11669
  i0.ɵɵelement(2, "img", 19);
11675
11670
  i0.ɵɵtemplate(3, CatalogRecipeCardComponent_div_4_div_3_Template, 2, 1, "div", 20);
11676
- i0.ɵɵpipe(4, "async");
11677
11671
  i0.ɵɵelementEnd();
11678
- i0.ɵɵtemplate(5, CatalogRecipeCardComponent_div_4_div_5_Template, 2, 3, "div", 21);
11679
- i0.ɵɵtemplate(6, CatalogRecipeCardComponent_div_4_ng_container_6_Template, 3, 3, "ng-container", 20);
11680
- i0.ɵɵtemplate(7, CatalogRecipeCardComponent_div_4_ng_container_7_Template, 3, 1, "ng-container", 22);
11681
- i0.ɵɵtemplate(8, CatalogRecipeCardComponent_div_4_ng_template_8_Template, 1, 1, "ng-template", null, 23, i0.ɵɵtemplateRefExtractor);
11682
- i0.ɵɵelementStart(10, "div", 24);
11683
- i0.ɵɵtemplate(11, CatalogRecipeCardComponent_div_4_ng_miam_like_button_11_Template, 1, 2, "ng-miam-like-button", 25);
11684
- i0.ɵɵpipe(12, "async");
11685
- i0.ɵɵelementStart(13, "div", 26, 27);
11686
- i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_Template_div_click_13_listener($event) { i0.ɵɵrestoreView(_r27_1); var ctx_r28 = i0.ɵɵnextContext(); return ctx_r28.toggleMoreActions($event); });
11687
- i0.ɵɵelement(15, "ng-miam-icon", 28);
11672
+ i0.ɵɵtemplate(4, CatalogRecipeCardComponent_div_4_div_4_Template, 2, 3, "div", 21);
11673
+ i0.ɵɵtemplate(5, CatalogRecipeCardComponent_div_4_ng_container_5_Template, 3, 3, "ng-container", 20);
11674
+ i0.ɵɵtemplate(6, CatalogRecipeCardComponent_div_4_ng_container_6_Template, 3, 1, "ng-container", 22);
11675
+ i0.ɵɵtemplate(7, CatalogRecipeCardComponent_div_4_ng_template_7_Template, 1, 1, "ng-template", null, 23, i0.ɵɵtemplateRefExtractor);
11676
+ i0.ɵɵelementStart(9, "div", 24);
11677
+ i0.ɵɵtemplate(10, CatalogRecipeCardComponent_div_4_ng_miam_like_button_10_Template, 1, 2, "ng-miam-like-button", 25);
11678
+ i0.ɵɵpipe(11, "async");
11679
+ i0.ɵɵelementStart(12, "div", 26, 27);
11680
+ i0.ɵɵlistener("click", function CatalogRecipeCardComponent_div_4_Template_div_click_12_listener($event) { i0.ɵɵrestoreView(_r27_1); var ctx_r28 = i0.ɵɵnextContext(); return ctx_r28.toggleMoreActions($event); });
11681
+ i0.ɵɵelement(14, "ng-miam-icon", 28);
11688
11682
  i0.ɵɵelementEnd();
11689
11683
  i0.ɵɵelementEnd();
11690
11684
  i0.ɵɵelementEnd();
11691
11685
  }
11692
11686
  if (rf & 2) {
11693
- var _r19 = i0.ɵɵreference(9);
11687
+ var _r19 = i0.ɵɵreference(8);
11694
11688
  var ctx_r0 = i0.ɵɵnextContext();
11695
11689
  i0.ɵɵadvance(2);
11696
11690
  i0.ɵɵproperty("src", ctx_r0.recipe.attributes["media-url"], i0.ɵɵsanitizeUrl);
11697
11691
  i0.ɵɵadvance(1);
11698
- i0.ɵɵproperty("ngIf", !i0.ɵɵpipeBind1(4, 8, ctx_r0.groceriesListsService.recipeIsInList(ctx_r0.recipe == null ? null : ctx_r0.recipe.id)) && ctx_r0.recipe.filigraneLogoUrl);
11699
- i0.ɵɵadvance(2);
11692
+ i0.ɵɵproperty("ngIf", ctx_r0.recipe.filigraneLogoUrl);
11693
+ i0.ɵɵadvance(1);
11700
11694
  i0.ɵɵproperty("ngIf", ctx_r0.contextService.videoRecipesEnabled && (ctx_r0.recipe == null ? null : ctx_r0.recipe.videoId));
11701
11695
  i0.ɵɵadvance(1);
11702
11696
  i0.ɵɵproperty("ngIf", ctx_r0.recipe && ctx_r0.displayAddedOnPicture);
11703
11697
  i0.ɵɵadvance(1);
11704
11698
  i0.ɵɵproperty("ngIf", ctx_r0.recipe)("ngIfElse", _r19);
11705
11699
  i0.ɵɵadvance(4);
11706
- i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(12, 10, ctx_r0.userService.isLogged$));
11700
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(11, 8, ctx_r0.userService.isLogged$));
11707
11701
  i0.ɵɵadvance(4);
11708
11702
  i0.ɵɵproperty("iconName", ctx_r0.actionsOpened ? ctx_r0.icon.Clear : ctx_r0.icon.HorizontalDots);
11709
11703
  }
@@ -11999,7 +11993,7 @@
11999
11993
  i0.ɵɵtext(3);
12000
11994
  i0.ɵɵelementEnd();
12001
11995
  i0.ɵɵelementEnd();
12002
- i0.ɵɵtemplate(4, CatalogRecipeCardComponent_div_4_Template, 16, 12, "div", 2);
11996
+ i0.ɵɵtemplate(4, CatalogRecipeCardComponent_div_4_Template, 15, 10, "div", 2);
12003
11997
  i0.ɵɵtemplate(5, CatalogRecipeCardComponent_ng_template_5_Template, 1, 1, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
12004
11998
  i0.ɵɵelementStart(7, "div", 4);
12005
11999
  i0.ɵɵelementStart(8, "div", 5);