-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#162176] Require user action for missing merge order info (#4229)
* Rename partial * More renaming * Rename block parameter for clarity * Pull table into a partial * Use the merge order table partial in the missing info reminder modal * Update reminder message * Update specs
- Loading branch information
1 parent
17222a5
commit cf71620
Showing
6 changed files
with
79 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,3 @@ | ||
- if @merge_orders.present? | ||
= render "merge_order_missing_form_reminder" | ||
.well | ||
%p.alert.alert-error | ||
= t("facility_orders.edit.attention_html") | ||
%table.table.table-striped.table-hover | ||
%thead | ||
%tr | ||
%th= t("facility_orders.edit.actions") | ||
%th= OrderDetail.human_attribute_name(:product) | ||
%th.centered= OrderDetail.human_attribute_name(:quantity) | ||
%th.currency= OrderDetail.human_attribute_name(:estimated_cost) | ||
- if @order.has_subsidies? | ||
%th.currency= OrderDetail.human_attribute_name(:estimated_subsidy) | ||
%th.currency= OrderDetail.human_attribute_name(:estimated_total) | ||
|
||
%tbody | ||
- @merge_orders.each do |order| | ||
- order.order_details.each do |order_detail| | ||
%tr | ||
%td.centered= link_to "Remove", facility_order_order_detail_path(order.facility, order, order_detail), method: :delete | ||
%td | ||
= render partial: "orders/#{order_detail.product.class.name.underscore}_desc", locals: { order_detail: order_detail } | ||
%td.centered | ||
= QuantityPresenter.new(order_detail.product, order_detail.quantity) | ||
- if order_detail.cost_estimated? | ||
%td.currency= show_estimated_cost(order_detail) | ||
- if @order.has_subsidies? | ||
%td.currency= show_estimated_subsidy(order_detail) | ||
%td.currency= show_estimated_total(order_detail) | ||
- else | ||
%td.currency Unassigned | ||
- if @order.has_subsidies? | ||
%td.currency Unassigned | ||
%td.currency Unassigned | ||
= render "merge_order_missing_order_info_reminder" | ||
= render partial: "merge_order_table" |
11 changes: 0 additions & 11 deletions
11
app/views/facility_orders/_merge_order_missing_form_reminder.html.haml
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
app/views/facility_orders/_merge_order_missing_order_info_reminder.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#merge-order-missing-order-info-reminder.modal.hide.fade{ data: { backdrop: "static" } } | ||
.modal-header | ||
- # We're skipping the modal_close_button here to force users to read the message and take action | ||
%h3= text("facility_orders.edit.missing_merge_order_info.header") | ||
.modal-body | ||
= render partial: "merge_order_table", locals: { modal: true } | ||
= javascript_tag "$('#merge-order-missing-order-info-reminder').modal('show');" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.well | ||
%p.alert.alert-error | ||
= t("facility_orders.edit.missing_merge_order_info.attention_html") | ||
%table.table.table-striped.table-hover | ||
%thead | ||
%tr | ||
%th= t("facility_orders.edit.actions") | ||
%th= OrderDetail.human_attribute_name(:product) | ||
- unless local_assigns.has_key?(:modal) | ||
%th.centered= OrderDetail.human_attribute_name(:quantity) | ||
%th.currency= OrderDetail.human_attribute_name(:estimated_cost) | ||
- if @order.has_subsidies? | ||
%th.currency= OrderDetail.human_attribute_name(:estimated_subsidy) | ||
%th.currency= OrderDetail.human_attribute_name(:estimated_total) | ||
|
||
%tbody | ||
- @merge_orders.each do |merge_order| | ||
- merge_order.order_details.each do |order_detail| | ||
%tr | ||
%td.centered= link_to "Remove", facility_order_order_detail_path(merge_order.facility, merge_order, order_detail), method: :delete | ||
%td | ||
= render partial: "orders/#{order_detail.product.class.name.underscore}_desc", locals: { order_detail: order_detail } | ||
- unless local_assigns.has_key?(:modal) | ||
%td.centered | ||
= QuantityPresenter.new(order_detail.product, order_detail.quantity) | ||
- if order_detail.cost_estimated? | ||
%td.currency= show_estimated_cost(order_detail) | ||
- if @order.has_subsidies? | ||
%td.currency= show_estimated_subsidy(order_detail) | ||
%td.currency= show_estimated_total(order_detail) | ||
- else | ||
%td.currency Unassigned | ||
- if @order.has_subsidies? | ||
%td.currency Unassigned | ||
%td.currency Unassigned |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters