From 8db2445203d5d24fd36528bfd0d7f992aa06c855 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Tue, 4 Feb 2025 15:16:43 +1100 Subject: [PATCH] Add comment to make sure both out of stock modal get updated. There is no easy way to share template between AngularJS and Rails. The modal in `edit.html.haml` is a copy of app/assets/javascripts/templates/out_of_stock.html.haml, so we need to update both if either of them is updated. --- app/assets/javascripts/templates/out_of_stock.html.haml | 1 + app/views/checkout/edit.html.haml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/templates/out_of_stock.html.haml b/app/assets/javascripts/templates/out_of_stock.html.haml index 4ee27e7aa1..a6b6dd8810 100644 --- a/app/assets/javascripts/templates/out_of_stock.html.haml +++ b/app/assets/javascripts/templates/out_of_stock.html.haml @@ -1,3 +1,4 @@ +// please update the modal html in app/view/checkout/edit.html.haml if updating this template %a.close-reveal-modal{"ng-click" => "$close()"} %i.ofn-i_009-close diff --git a/app/views/checkout/edit.html.haml b/app/views/checkout/edit.html.haml index d3e9d09afd..d94e06957a 100644 --- a/app/views/checkout/edit.html.haml +++ b/app/views/checkout/edit.html.haml @@ -20,9 +20,9 @@ = render partial: "shopping_shared/order_cycles" %div{ "data-controller": "guest-checkout", "data-guest-checkout-distributor-value": @order.distributor.id } - = #TODO create new component ? reuse out_of_stock.html.haml template - if @any_out_of_stock = render ModalComponent.new(id: "out-of-stock-items", modal_class: "medium" ,instant: true, close_button: false) do + - # please update app/assets/javascripts/templates/out_of_stock.html.haml if updating the modal html %a.close-reveal-modal{"data-action": "click->modal#close" } %i.ofn-i_009-close %h3