From 422a68630f1f47ba7a680237b29b80c2b7b361e9 Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Tue, 30 Oct 2018 14:03:51 +0100 Subject: [PATCH] Remove data-hook tags --- .../spree/admin/orders/_add_product.html.haml | 8 ++++---- app/views/spree/admin/orders/_form.html.haml | 16 ++++++++-------- .../spree/admin/orders/_line_item.html.haml | 4 ++-- app/views/spree/admin/orders/edit.html.haml | 6 +++--- .../spree/admin/shared/_order_tabs.html.haml | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/views/spree/admin/orders/_add_product.html.haml b/app/views/spree/admin/orders/_add_product.html.haml index ab807961f7..eecc678521 100644 --- a/app/views/spree/admin/orders/_add_product.html.haml +++ b/app/views/spree/admin/orders/_add_product.html.haml @@ -1,15 +1,15 @@ = render partial: "spree/admin/variants/autocomplete", formats: :js -#add-line-item{"data-hook" => ""} +#add-line-item %fieldset %legend{align: "center"} = t(:add_product) - .field.eight.columns.alpha{"data-hook" => "add_product_name"} + .field.eight.columns.alpha = label_tag :add_product_name, t(:name_or_sku) = hidden_field_tag :add_variant_id, "", class: "variant_autocomplete fullwidth" - .field.two.columns{"data-hook" => "add_quantity"} + .field.two.columns = label_tag :add_quantity, t(:qty) = number_field_tag :add_quantity, 1, min: 0 - .actions.two.columns.omega{"data-hook" => "add_button"} + .actions.two.columns.omega = link_to_with_icon 'icon-plus', t(:add), admin_order_line_items_url(@order), method: :post, id: 'add_line_item_to_order', diff --git a/app/views/spree/admin/orders/_form.html.haml b/app/views/spree/admin/orders/_form.html.haml index 07a41cb7e4..8564ae04f5 100644 --- a/app/views/spree/admin/orders/_form.html.haml +++ b/app/views/spree/admin/orders/_form.html.haml @@ -1,4 +1,4 @@ -%div{"data-hook" => "admin_order_form_fields"} +%div - if @line_item.try(:errors).present? = render partial: 'spree/shared/error_messages', locals: { target: @line_item } = form_for @order, url: admin_order_url(@order), method: :put do |f| @@ -12,7 +12,7 @@ %col{style: "width: 14%;"}/ %col{style: "width: 8%;"}/ %thead#line-items - %tr{"data-hook" => "admin_order_form_line_items_headers"} + %tr %th = t(:item_description) %th.price @@ -22,11 +22,11 @@ %th.total %span = t(:total) - %th.orders-actions.actions{"data-hook" => "admin_order_form_line_items_header_actions"} - %tbody{"data-hook" => "admin_order_form_line_items"} + %th.orders-actions.actions + %tbody = f.fields_for :line_items do |li_form| = render partial: 'spree/admin/orders/line_item', locals: { f: li_form } - %tbody#subtotal.no-border-top{"data-hook" => "admin_order_form_subtotal"} + %tbody#subtotal.no-border-top %tr#subtotal-row %td{colspan: "3"} %b @@ -36,7 +36,7 @@ %span = @order.display_item_total.to_html %td.actions - %tbody#order-charges.no-border-top{"data-hook" => "admin_order_form_adjustments"} + %tbody#order-charges.no-border-top - @order.adjustments.eligible.each do |adjustment| %tr %td{colspan: "3"} @@ -46,7 +46,7 @@ %td.total.align-center %span= adjustment.display_amount.to_html %td.actions - %tbody#order-total.grand-total.no-border-top{"data-hook" => "admin_order_form_total"} + %tbody#order-total.grand-total.no-border-top %tr %td{colspan: "3"} %b @@ -59,7 +59,7 @@ = render partial: 'spree/admin/orders/_form/distribution_fields' - .filter-actions.actions{"data-hook" => "admin_order_form_buttons", "ng-show" => "distributionChosen()"} + .filter-actions.actions{"ng-show" => "distributionChosen()"} = button t(:update_and_recalculate_fees), 'icon-refresh' %span.or = t(:or) diff --git a/app/views/spree/admin/orders/_line_item.html.haml b/app/views/spree/admin/orders/_line_item.html.haml index 4bcc30fae0..9afed0e2ec 100644 --- a/app/views/spree/admin/orders/_line_item.html.haml +++ b/app/views/spree/admin/orders/_line_item.html.haml @@ -1,4 +1,4 @@ -%tr{"data-hook" => "admin_order_form_line_item_row", id: "#{spree_dom_id(f.object)}", class: "#{cycle('odd', 'even')}"} +%tr{id: "#{spree_dom_id(f.object)}", class: "#{cycle('odd', 'even')}"} %td = f.object.variant.product.name = "(#{f.object.full_name})" unless f.object.variant.option_values.empty? @@ -8,5 +8,5 @@ = f.number_field :quantity, min: 0, class: "qty" %td.total.align-center = f.object.single_money - %td.actions{"data-hook" => "admin_order_form_line_item_actions"} + %td.actions = link_to_delete f.object, {url: admin_order_line_item_url(@order.number, f.object), no_text: true} diff --git a/app/views/spree/admin/orders/edit.html.haml b/app/views/spree/admin/orders/edit.html.haml index 82d5507ec1..015e9234e8 100644 --- a/app/views/spree/admin/orders/edit.html.haml +++ b/app/views/spree/admin/orders/edit.html.haml @@ -12,19 +12,19 @@ = render 'spree/admin/shared/order_tabs', current: 'Order Details' -%div{"data-hook" => "admin_order_edit_header"} +%div - unless params["suppress_error_msg"] = render partial: "spree/shared/error_messages", :locals => { :target => @order } %div{"ng-app" => "admin.orders", "ng-controller" => "orderCtrl", "ofn-distributor-id" => @order.distributor_id, "ofn-order-cycle-id" => @order.order_cycle_id} = render 'add_product' - %div{"data-hook" => "admin_order_edit_form"} + %div #order-form-wrapper = render 'form', order: @order - content_for :head do = javascript_tag 'var expand_variants = true;' - + :coffee angular.bootstrap(document.getElementById("links-dropdown"),['admin.dropdown']) diff --git a/app/views/spree/admin/shared/_order_tabs.html.haml b/app/views/spree/admin/shared/_order_tabs.html.haml index 17ebf435bb..af04fe676e 100644 --- a/app/views/spree/admin/shared/_order_tabs.html.haml +++ b/app/views/spree/admin/shared/_order_tabs.html.haml @@ -45,7 +45,7 @@ = pretty_time(@order.completed_at) %nav.menu - %ul{"data-hook" => "admin_order_tabs"} + %ul %li{ class: "#{'active' if true}" } = link_to_with_icon 'icon-edit', t(:order_details), edit_admin_order_url(@order) %li{"#{'class=active' if current == 'Customer Details'}"}