From b9431cd121422824c85883dadd5d49f496671474 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 28 Apr 2023 12:35:51 +0100 Subject: [PATCH] Remove data-hook attributes --- .../admin/spree/orders/shipments.js.erb | 12 ++++----- app/views/admin/contents/edit.html.haml | 2 +- .../admin/enterprises/_admin_index.html.haml | 4 +-- .../admin/invoice_settings/edit.html.haml | 2 +- .../admin/matomo_settings/edit.html.haml | 2 +- .../admin/producer_properties/_form.html.haml | 8 +++--- .../_producer_property_fields.html.haml | 2 +- .../shared/_enterprises_sub_menu.html.haml | 2 +- .../admin/shared/_users_sub_menu.html.haml | 2 +- .../stripe_connect_settings/edit.html.haml | 2 +- .../admin/subscriptions/_review.html.haml | 4 +-- .../_subscription_line_items.html.haml | 4 +-- .../adjustments/_adjustments_table.html.haml | 6 ++--- .../spree/admin/adjustments/_form.html.haml | 2 +- .../spree/admin/adjustments/edit.html.haml | 2 +- .../spree/admin/adjustments/new.html.haml | 2 +- .../admin/general_settings/edit.html.haml | 4 +-- .../spree/admin/orders/_add_product.html.haml | 4 +-- .../spree/admin/orders/_filters.html.haml | 2 +- app/views/spree/admin/orders/_form.html.haml | 4 +-- .../spree/admin/orders/_shipment.html.haml | 6 ++--- .../admin/orders/_shipment_manifest.html.haml | 2 +- .../orders/customer_details/_form.html.haml | 12 ++++----- .../orders/customer_details/edit.html.haml | 2 +- app/views/spree/admin/orders/edit.html.haml | 4 +-- .../_product_property_fields.html.haml | 2 +- .../spree/admin/products/_form.html.haml | 2 +- .../spree/admin/products/_seo_form.html.haml | 2 +- .../admin/products/index/_header.html.haml | 2 +- .../admin/shipping_categories/_form.html.haml | 6 ++--- .../admin/shipping_categories/index.html.haml | 4 +-- .../admin/tax_categories/index.html.haml | 2 +- .../spree/admin/tax_settings/edit.html.haml | 4 +-- app/views/spree/admin/users/edit.html.haml | 8 +++--- .../spree/admin/variants/_autocomplete.js.erb | 2 +- app/views/spree/admin/variants/new.html.haml | 2 +- app/views/spree/layouts/_admin_body.html.haml | 26 +++++++++---------- app/views/spree/layouts/admin.html.haml | 2 +- .../spree/layouts/admin/_login_nav.html.haml | 8 +++--- app/views/spree/layouts/bare_admin.html.haml | 14 +++++----- app/views/spree/orders/_form.html.haml | 6 ++--- app/views/spree/orders/_line_item.html.haml | 12 ++++----- app/views/spree/orders/_summary.html.haml | 21 +++++++-------- .../spree/orders/_totals_footer.html.haml | 8 +++--- app/views/spree/orders/edit.html.haml | 8 +++--- .../orders/form/_cart_actions_row.html.haml | 2 +- .../spree/orders/form/_cart_links.html.haml | 2 +- app/views/spree/orders/show.html.haml | 4 +-- app/views/spree/users/show.html.haml | 2 +- .../css/admin/components/navigation.scss | 4 +-- app/webpacker/css/admin/sections/orders.scss | 6 ++--- .../css/admin/sections/products.scss | 2 +- app/webpacker/css/admin/shared/layout.scss | 2 -- spec/system/admin/order_spec.rb | 12 +++------ spec/system/admin/variants_spec.rb | 3 --- 55 files changed, 133 insertions(+), 145 deletions(-) diff --git a/app/assets/javascripts/admin/spree/orders/shipments.js.erb b/app/assets/javascripts/admin/spree/orders/shipments.js.erb index 4a62d94375a..322a6486835 100644 --- a/app/assets/javascripts/admin/spree/orders/shipments.js.erb +++ b/app/assets/javascripts/admin/spree/orders/shipments.js.erb @@ -15,7 +15,7 @@ $(document).ready(function() { console.log(msg); }); } - $('[data-hook=admin_order_edit_form] a.ship').click(handle_ship_click); + $('.admin-order-edit-form a.ship').click(handle_ship_click); //handle shipping method edit click $('a.edit-method').click(toggleMethodEdit); @@ -37,7 +37,7 @@ $(document).ready(function() { console.log(msg); }); } - $('[data-hook=admin_order_edit_form] a.save-method').click(handle_shipping_method_save); + $('.admin-order-edit-form a.save-method').click(handle_shipping_method_save); //handle tracking info edit/delete @@ -64,8 +64,8 @@ $(document).ready(function() { return Spree.url( Spree.routes.orders_api + "/" + order_number + "/shipments/" + shipmentNumber + ".json"); } - $('[data-hook=admin_order_edit_form] a.save-tracking').click(saveTrackingInfo); - $('[data-hook=admin_order_edit_form] a.delete-tracking').click(deleteTrackingInfo); + $('.admin-order-edit-form a.save-tracking').click(saveTrackingInfo); + $('.admin-order-edit-form a.delete-tracking').click(deleteTrackingInfo); // handle note edit/delete @@ -96,8 +96,8 @@ $(document).ready(function() { }); } - $('[data-hook=admin_order_edit_form] a.save-note').click(saveNote); - $('[data-hook=admin_order_edit_form] a.delete-note').click(deleteNote); + $('.admin-order-edit-form a.save-note').click(saveNote); + $('.admin-order-edit-form a.delete-note').click(deleteNote); // Makes API call for notes/tracking info makeApiCall = function(url, params) { diff --git a/app/views/admin/contents/edit.html.haml b/app/views/admin/contents/edit.html.haml index 0486990c185..08b37f0414a 100644 --- a/app/views/admin/contents/edit.html.haml +++ b/app/views/admin/contents/edit.html.haml @@ -8,6 +8,6 @@ - @preference_sections.each do |preference_section| = render 'fieldset', name: preference_section[:name], preferences: preference_section[:preferences] - .form-buttons.filter-actions.actions{"data-hook" => "buttons"} + .form-buttons.filter-actions.actions = button t(:update), 'icon-refresh' = link_to_with_icon 'icon-remove', t(:cancel), main_app.edit_admin_contents_path, class: 'button' diff --git a/app/views/admin/enterprises/_admin_index.html.haml b/app/views/admin/enterprises/_admin_index.html.haml index ad37a1200fe..ed8df10b7f2 100644 --- a/app/views/admin/enterprises/_admin_index.html.haml +++ b/app/views/admin/enterprises/_admin_index.html.haml @@ -10,7 +10,7 @@ %col{style: "width: 18%;"}/ %col{style: "width: 25%;"}/ %thead - %tr{"data-hook" => "enterprises_header"} + %tr %th= t('.name') %th= t('.role') - if spree_current_user.admin? @@ -32,7 +32,7 @@ %td= enterprise_form.check_box :visible, {}, 'public', 'hidden' - if spree_current_user.admin? %td= enterprise_form.select :owner_id, enterprise.users.map{ |e| [ e.email, e.id ] }, {}, class: "select2 fullwidth" - %td{"data-hook" => "admin_users_index_row_actions"} + %td = render 'actions', enterprise: enterprise - if @enterprises.empty? %tr diff --git a/app/views/admin/invoice_settings/edit.html.haml b/app/views/admin/invoice_settings/edit.html.haml index 1778e026316..0647c389201 100644 --- a/app/views/admin/invoice_settings/edit.html.haml +++ b/app/views/admin/invoice_settings/edit.html.haml @@ -20,5 +20,5 @@ = check_box_tag 'preferences[enterprise_number_required_on_invoices?]', '1', Spree::Config[:enterprise_number_required_on_invoices?] = label_tag nil, t('.enterprise_number_required_on_invoices?') - .form-buttons{"data-hook" => "buttons"} + .form-buttons = button t(:update), 'icon-refresh' diff --git a/app/views/admin/matomo_settings/edit.html.haml b/app/views/admin/matomo_settings/edit.html.haml index 0c553ae0023..d47ffcf4416 100644 --- a/app/views/admin/matomo_settings/edit.html.haml +++ b/app/views/admin/matomo_settings/edit.html.haml @@ -23,5 +23,5 @@ = preference_field_tag("preferences[#{:matomo_tag_manager_url}]", Spree::Config[:matomo_tag_manager_url], type: Spree::Config.preference_type(:matomo_tag_manager_url)) .warning.note= t('.config_instructions_tag_manager_html') - .form-buttons{"data-hook" => "buttons"} + .form-buttons = button t(:update), 'icon-refresh' diff --git a/app/views/admin/producer_properties/_form.html.haml b/app/views/admin/producer_properties/_form.html.haml index fa05e25b687..05ad2d874d0 100644 --- a/app/views/admin/producer_properties/_form.html.haml +++ b/app/views/admin/producer_properties/_form.html.haml @@ -1,12 +1,12 @@ %fieldset.no-border-top - .add_producer_properties{"data-hook" => "add_producer_properties"} + .add_producer_properties = image_pack_tag 'spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator' - %table.index.sortable{"data-hook" => "", "data-sortable-link" => main_app.update_positions_admin_enterprise_producer_properties_url(@enterprise)} + %table.index.sortable{"data-sortable-link" => main_app.update_positions_admin_enterprise_producer_properties_url(@enterprise)} %thead - %tr{"data-hook" => "producer_properties_header"} + %tr %th{colspan: "2"}= t('admin.products.properties.property_name') %th= t('admin.description') %th.actions - %tbody#producer_properties{"data-hook" => ""} + %tbody#producer_properties = f.fields_for :producer_properties do |pp_form| = render 'admin/producer_properties/producer_property_fields', f: pp_form diff --git a/app/views/admin/producer_properties/_producer_property_fields.html.haml b/app/views/admin/producer_properties/_producer_property_fields.html.haml index 841a0cfb73a..0d856952126 100644 --- a/app/views/admin/producer_properties/_producer_property_fields.html.haml +++ b/app/views/admin/producer_properties/_producer_property_fields.html.haml @@ -1,5 +1,5 @@ -# admin/admin.js.erb in spree requires id to start with "spree_" for sortable tables -%tr.product_property.fields{"data-hook" => "producer_property", id: "spree_#{dom_id(f.object)}"} +%tr.product_property.fields{id: "spree_#{dom_id(f.object)}"} %td.no-border %span.handle = f.hidden_field :id diff --git a/app/views/admin/shared/_enterprises_sub_menu.html.haml b/app/views/admin/shared/_enterprises_sub_menu.html.haml index 3de9f007d43..9913d1f164b 100644 --- a/app/views/admin/shared/_enterprises_sub_menu.html.haml +++ b/app/views/admin/shared/_enterprises_sub_menu.html.haml @@ -1,5 +1,5 @@ - content_for :sub_menu do - %ul#sub_nav.inline-menu{"data-hook" => "admin_enterprise_sub_tabs"} + %ul#sub_nav.inline-menu = tab :enterprises, url: main_app.admin_enterprises_path = tab :enterprise_relationships, url: main_app.admin_enterprise_relationships_path - if ENV["OPENID_APP_ID"].present? && ENV["OPENID_APP_SECRET"].present? diff --git a/app/views/admin/shared/_users_sub_menu.html.haml b/app/views/admin/shared/_users_sub_menu.html.haml index a1bc352783f..2fa04b09f0a 100644 --- a/app/views/admin/shared/_users_sub_menu.html.haml +++ b/app/views/admin/shared/_users_sub_menu.html.haml @@ -1,4 +1,4 @@ - content_for :sub_menu do - %ul#sub_nav.inline-menu{"data-hook" => "admin_user_sub_tabs"} + %ul#sub_nav.inline-menu = tab :users, url: spree.admin_users_path = tab :roles, url: main_app.admin_enterprise_roles_path, match_path: '/enterprise_roles' diff --git a/app/views/admin/stripe_connect_settings/edit.html.haml b/app/views/admin/stripe_connect_settings/edit.html.haml index 37fdd2e8468..54d4ce598d3 100644 --- a/app/views/admin/stripe_connect_settings/edit.html.haml +++ b/app/views/admin/stripe_connect_settings/edit.html.haml @@ -14,7 +14,7 @@ = f.label :stripe_connect_enabled, t('.stripe_connect_enabled') = f.check_box :stripe_connect_enabled, disabled: disabled .row - .twelve.columns.alpha.omega.form-buttons{"data-hook" => "buttons"} + .twelve.columns.alpha.omega.form-buttons = button t(:update), 'icon-refresh', value: "update" %fieldset.no-border-bottom diff --git a/app/views/admin/subscriptions/_review.html.haml b/app/views/admin/subscriptions/_review.html.haml index f7b716684a0..9e5fcb7d556 100644 --- a/app/views/admin/subscriptions/_review.html.haml +++ b/app/views/admin/subscriptions/_review.html.haml @@ -77,7 +77,7 @@ %td.price.align-center {{ item.price_estimate | localizeCurrency }} %td.quantity {{ item.quantity }} %td.total.align-center {{ (item.price_estimate * item.quantity) | localizeCurrency }} - %tbody#subtotal.no-border-top{"data-hook" => "admin_order_form_subtotal"} + %tbody#subtotal.no-border-top %tr#subtotal-row %td{:colspan => "3"} %b @@ -85,7 +85,7 @@ \: %td.total.align-center %span {{ subscription.estimatedSubtotal() | localizeCurrency }} - %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 diff --git a/app/views/admin/subscriptions/_subscription_line_items.html.haml b/app/views/admin/subscriptions/_subscription_line_items.html.haml index fdb5f10fdf5..561cc769966 100644 --- a/app/views/admin/subscriptions/_subscription_line_items.html.haml +++ b/app/views/admin/subscriptions/_subscription_line_items.html.haml @@ -25,7 +25,7 @@ %td.total.align-center {{ (item.price_estimate * item.quantity) | localizeCurrency }} %td.actions %a.delete-item.icon-trash.no-text{ ng: { click: 'removeSubscriptionLineItem(item)'}, :href => "javascript:void(0)" } - %tbody#subtotal.no-border-top{"data-hook" => "admin_order_form_subtotal"} + %tbody#subtotal.no-border-top %tr#subtotal-row %td{:colspan => "3"} %b @@ -43,7 +43,7 @@ %td.total.align-center %span#order_fees {{ subscription.estimatedFees() | localizeCurrency }} %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 diff --git a/app/views/spree/admin/adjustments/_adjustments_table.html.haml b/app/views/spree/admin/adjustments/_adjustments_table.html.haml index 1cf986e40ef..9dda50e8fc9 100644 --- a/app/views/spree/admin/adjustments/_adjustments_table.html.haml +++ b/app/views/spree/admin/adjustments/_adjustments_table.html.haml @@ -1,5 +1,5 @@ -%table.index{"data-hook" => "adjustments"} - %thead{"data-hook" => "adjustmment_head"} +%table.index + %thead %tr %th= "#{t('spree.date')}/#{t('spree.time')}" %th= t(:description) @@ -15,7 +15,7 @@ - taxable = adjustment.adjustable_type == "Spree::Shipment" ? adjustment.adjustable : adjustment - tr_class = cycle('odd', 'even') - tr_id = spree_dom_id(adjustment) - %tr{:class => tr_class, "data-hook" => "adjustment_row", :id => tr_id} + %tr{:class => tr_class, :id => tr_id} %td.align-center.created_at = pretty_time(adjustment.created_at) %td.align-center.label diff --git a/app/views/spree/admin/adjustments/_form.html.haml b/app/views/spree/admin/adjustments/_form.html.haml index 6f0e2236b00..688ed55ee0c 100644 --- a/app/views/spree/admin/adjustments/_form.html.haml +++ b/app/views/spree/admin/adjustments/_form.html.haml @@ -1,4 +1,4 @@ -.row{"data-hook" => "admin_adjustment_form_fields"} +.row - if @adjustment.new_record? = render 'new_form', f: f - else diff --git a/app/views/spree/admin/adjustments/edit.html.haml b/app/views/spree/admin/adjustments/edit.html.haml index 957f84c476c..f9c08024183 100644 --- a/app/views/spree/admin/adjustments/edit.html.haml +++ b/app/views/spree/admin/adjustments/edit.html.haml @@ -14,6 +14,6 @@ = form_for @adjustment, :url => admin_order_adjustment_path(@order, @adjustment), :method => :put do |f| %fieldset.no-border-top = render :partial => 'form', :locals => { :f => f } - .filter-actions.actions{"data-hook" => "buttons"} + .filter-actions.actions = button Spree.t(:continue), 'icon-arrow-right' = link_to_with_icon 'icon-remove', Spree.t('actions.cancel'), admin_order_adjustments_url(@order), :class => 'button' diff --git a/app/views/spree/admin/adjustments/new.html.haml b/app/views/spree/admin/adjustments/new.html.haml index 822af536094..1a00a3bf469 100644 --- a/app/views/spree/admin/adjustments/new.html.haml +++ b/app/views/spree/admin/adjustments/new.html.haml @@ -13,6 +13,6 @@ = form_for @adjustment, :url => admin_order_adjustments_path do |f| %fieldset.no-border-top = render :partial => 'form', :locals => { :f => f } - .filter-actions.actions{"data-hook" => "buttons"} + .filter-actions.actions = button Spree.t(:continue), 'icon-arrow-right' = button_link_to Spree.t('actions.cancel'), admin_order_adjustments_url(@order), :icon => 'icon-remove' diff --git a/app/views/spree/admin/general_settings/edit.html.haml b/app/views/spree/admin/general_settings/edit.html.haml index dcbabeba4eb..5c938419e6f 100644 --- a/app/views/spree/admin/general_settings/edit.html.haml +++ b/app/views/spree/admin/general_settings/edit.html.haml @@ -5,7 +5,7 @@ = Spree.t(:general_settings) = form_tag admin_general_settings_path, :method => :put do - #preferences{"data-hook" => ""} + #preferences %fieldset.general.no-border-top - @preferences_general.each do |key| @@ -85,6 +85,6 @@ = preference_field_tag("available_units[#{unit}]", selected, { type: :boolean, selected: selected }) = label_tag(unit, unit.downcase) + tag(:br) - .form-buttons.filter-actions.actions{"data-hook" => "buttons"} + .form-buttons.filter-actions.actions = button Spree.t('actions.update'), 'icon-refresh' = link_to_with_icon 'icon-remove', Spree.t('actions.cancel'), edit_admin_general_settings_url, :class => 'button' diff --git a/app/views/spree/admin/orders/_add_product.html.haml b/app/views/spree/admin/orders/_add_product.html.haml index 58c288cfe13..bb1ec09a739 100644 --- a/app/views/spree/admin/orders/_add_product.html.haml +++ b/app/views/spree/admin/orders/_add_product.html.haml @@ -1,13 +1,13 @@ = render :partial => "spree/admin/variants/autocomplete", :formats => :js -#add-line-item{"data-hook" => ""} +#add-line-item %fieldset.no-border-bottom %legend{:align => "center"}= Spree.t(:add_product) - if @order.canceled? = t(".cannot_add_item_to_canceled_order") - else - .field.nine.columns.alpha{"data-hook" => "add_product_name"} + .field.nine.columns.alpha = label_tag :add_variant_id, Spree.t(:name_or_sku) = hidden_field_tag :add_variant_id, "", :class => "variant_autocomplete fullwidth" .five.columns.omega diff --git a/app/views/spree/admin/orders/_filters.html.haml b/app/views/spree/admin/orders/_filters.html.haml index 0bce8d2b724..18b16f9dc34 100644 --- a/app/views/spree/admin/orders/_filters.html.haml +++ b/app/views/spree/admin/orders/_filters.html.haml @@ -1,4 +1,4 @@ -%div{"data-hook" => "admin_orders_index_search"} +%div.admin-orders-index-search = form_tag spree.admin_orders_url, {name: "orders_form", "ng-submit" => "fetchResults()"} do .field-block.alpha.four.columns .date-range-filter.field diff --git a/app/views/spree/admin/orders/_form.html.haml b/app/views/spree/admin/orders/_form.html.haml index 94ed0c8f949..9f8b00c6e25 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.admin-order-form-fields - if @line_item.try(:errors).present? = render :partial => 'spree/shared/error_messages', :locals => { :target => @line_item } @@ -13,7 +13,7 @@ = render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => order_adjustments_for_display(@order), :title => t(".order_adjustments")} - if order.line_items.exists? - %fieldset#order-total.no-border-bottom{"data-hook" => "order_details_total"} + %fieldset#order-total.no-border-bottom.order-details-total %legend{ align: 'center' }= t(".order_total") %span.order-total= order.display_total diff --git a/app/views/spree/admin/orders/_shipment.html.haml b/app/views/spree/admin/orders/_shipment.html.haml index 1340ac4e44d..78329c5db9d 100644 --- a/app/views/spree/admin/orders/_shipment.html.haml +++ b/app/views/spree/admin/orders/_shipment.html.haml @@ -1,6 +1,6 @@ %div{ :id => "shipment_#{shipment.id}" } %fieldset.no-border-bottom - %legend.stock-location{ :align => "center", "data-hook" => "stock-location" } + %legend.stock-location{ :align => "center" } %span.shipment-number = shipment.number = "-" @@ -10,7 +10,7 @@ = "-" = link_to t(:ship), '#', :class => 'ship button icon-arrow-right', :data => { 'shipment-number' => shipment.number } - %table.stock-contents.index{ "data-hook" => "stock-contents" } + %table.stock-contents.index %colgroup %col{ :style => "width: 10%;" } %col{ :style => "width: 30%;" } @@ -28,7 +28,7 @@ = Spree.t(:quantity) %th.force-rounded-right = Spree.t(:total) - %th.orders-actions.actions{ "data-hook" => "admin_order_form_line_items_header_actions" } + %th.orders-actions.actions %tbody{ "data-shipment-number" => "#{shipment.number}", "data-order-number" => "#{order.number}" } = render 'spree/admin/orders/shipment_manifest', order: order, shipment: shipment diff --git a/app/views/spree/admin/orders/_shipment_manifest.html.haml b/app/views/spree/admin/orders/_shipment_manifest.html.haml index a2c1fab0dc8..262ad9655ca 100644 --- a/app/views/spree/admin/orders/_shipment_manifest.html.haml +++ b/app/views/spree/admin/orders/_shipment_manifest.html.haml @@ -17,7 +17,7 @@ %td.item-total.align-center = line_item_shipment_price(line_item, item.quantity) - %td.cart-item-delete.actions{ "data-hook" => "cart_item_delete" } + %td.cart-item-delete.actions - if shipment.can_modify? && can?(:update, shipment) .flex = link_to '', '#', :class => 'save-item icon_link icon-ok no-text with-tip', :data => {'shipment-number' => shipment.number, 'variant-id' => item.variant.id, :action => 'save'}, :title => t('actions.save'), :style => 'display: none' diff --git a/app/views/spree/admin/orders/customer_details/_form.html.haml b/app/views/spree/admin/orders/customer_details/_form.html.haml index df34bd81d71..070665ddbac 100644 --- a/app/views/spree/admin/orders/customer_details/_form.html.haml +++ b/app/views/spree/admin/orders/customer_details/_form.html.haml @@ -1,19 +1,19 @@ -%fieldset.no-border-top{"data-hook" => "admin_customer_detail_form_fields"} - %fieldset.index.no-border-bottom{"data-hook" => "customer_guest"} +%fieldset.no-border-top + %fieldset.index.no-border-bottom %legend{:align => "center"}= Spree.t(:account) - .row{"data-hook" => "customer_fields"} + .row .alpha.eight.columns.fullwidth .field = f.label :email, Spree.t(:email) + ':' = f.email_field :email, :class => 'fullwidth' - .alpha.eight.columns{"data-hook" => "bill_address_wrapper"} + .alpha.eight.columns %fieldset.no-border-bottom %legend{:align => "center"}= Spree.t(:billing_address) = f.fields_for :bill_address do |ba_form| = render :partial => 'address_form', :locals => { :f => ba_form, :name => Spree.t(:billing_address), :use_billing => false } - .omega.eight.columns{"data-hook" => "ship_address_wrapper"} + .omega.eight.columns %fieldset.no-border-bottom %legend{:align => "center"}= Spree.t(:shipping_address) = f.fields_for :ship_address do |sa_form| @@ -21,7 +21,7 @@ .clear - .form-buttons.filter-actions.actions{"data-hook" => "buttons"} + .form-buttons.filter-actions.actions = button Spree.t('actions.update'), 'icon-refresh' - content_for :head do diff --git a/app/views/spree/admin/orders/customer_details/edit.html.haml b/app/views/spree/admin/orders/customer_details/edit.html.haml index 8735e3f5ee0..d84b1fcdc5e 100644 --- a/app/views/spree/admin/orders/customer_details/edit.html.haml +++ b/app/views/spree/admin/orders/customer_details/edit.html.haml @@ -12,7 +12,7 @@ %li= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left' - if @order.cart? || @order.address? - #select-customer{"data-hook" => ""} + #select-customer %fieldset.no-border-bottom %legend{:align => "center"}= Spree.t(:customer_search) - content_for :main_ng_app_name do diff --git a/app/views/spree/admin/orders/edit.html.haml b/app/views/spree/admin/orders/edit.html.haml index d5be74c809c..1049a0849fa 100644 --- a/app/views/spree/admin/orders/edit.html.haml +++ b/app/views/spree/admin/orders/edit.html.haml @@ -15,7 +15,7 @@ = render partial: "spree/admin/shared/order_page_title" = render partial: "spree/admin/shared/order_tabs", locals: { current: 'Order Details' } -%div{"data-hook" => "admin_order_edit_header"} +%div -# Suppress errors when manually creating a new order - needs to proceed to edit page -# without having line items (which otherwise gives a validation error) - unless params["suppress_error_msg"] @@ -31,5 +31,5 @@ .no-objects-found = Spree.t(:your_order_is_empty_add_product) - %div{"data-hook" => "admin_order_edit_form"} + %div.admin-order-edit-form = render :partial => 'form', :locals => { :order => @order } diff --git a/app/views/spree/admin/product_properties/_product_property_fields.html.haml b/app/views/spree/admin/product_properties/_product_property_fields.html.haml index 9b42c7dfae1..0136f356b08 100644 --- a/app/views/spree/admin/product_properties/_product_property_fields.html.haml +++ b/app/views/spree/admin/product_properties/_product_property_fields.html.haml @@ -1,4 +1,4 @@ -%tr.product_property.fields{"data-hook" => "product_property", id: "spree_#{dom_id(f.object)}"} +%tr.product_property.fields{id: "spree_#{dom_id(f.object)}"} %td.no-border %span.handle = f.hidden_field :id diff --git a/app/views/spree/admin/products/_form.html.haml b/app/views/spree/admin/products/_form.html.haml index cddb76460a1..3d12c5b5827 100644 --- a/app/views/spree/admin/products/_form.html.haml +++ b/app/views/spree/admin/products/_form.html.haml @@ -1,4 +1,4 @@ -%div{"data-hook" => "admin_product_form_fields"} +%div.admin-product-form-fields .left.twelve.columns.alpha = f.field_container :name do = f.label :name, raw(t(:name) + content_tag(:span, ' *', :class => 'required')) diff --git a/app/views/spree/admin/products/_seo_form.html.haml b/app/views/spree/admin/products/_seo_form.html.haml index 87358437f5d..71fd3ba42ff 100644 --- a/app/views/spree/admin/products/_seo_form.html.haml +++ b/app/views/spree/admin/products/_seo_form.html.haml @@ -1,4 +1,4 @@ -.row{"data-hook" => "admin_product_meta_form"} +.row .alpha.eleven.columns = f.field_container :meta_keywords do = f.label :meta_keywords, t('admin.products.seo.product_search_keywords') diff --git a/app/views/spree/admin/products/index/_header.html.haml b/app/views/spree/admin/products/index/_header.html.haml index e48b5b7a89e..f3314a1a392 100644 --- a/app/views/spree/admin/products/index/_header.html.haml +++ b/app/views/spree/admin/products/index/_header.html.haml @@ -2,7 +2,7 @@ = t('.title') - content_for :page_actions do - %div{ :class => "toolbar", 'data-hook' => "toolbar" } + %div{ :class => "toolbar" } %ul{ :class => "actions header-action-links inline-menu" } %li#new_product_link = button_link_to t(:new_product), new_object_url, { :icon => 'icon-plus', :id => 'admin_new_product' } diff --git a/app/views/spree/admin/shipping_categories/_form.html.haml b/app/views/spree/admin/shipping_categories/_form.html.haml index 00a818e3d2b..e618d5f5153 100644 --- a/app/views/spree/admin/shipping_categories/_form.html.haml +++ b/app/views/spree/admin/shipping_categories/_form.html.haml @@ -1,9 +1,9 @@ -%div{"data-hook" => "admin_shipping_category_form_fields"} - .field.align-center{"data-hook" => "name"} +%div + .field.align-center = label_tag Spree.t(:name) %br/ = f.text_field :name - .field.align-center{"data-hook" => "name"} + .field.align-center = f.label :temperature_controlled, t(:temperature_controlled) = f.check_box :temperature_controlled diff --git a/app/views/spree/admin/shipping_categories/index.html.haml b/app/views/spree/admin/shipping_categories/index.html.haml index e4b9356e32b..f1ec256aba4 100644 --- a/app/views/spree/admin/shipping_categories/index.html.haml +++ b/app/views/spree/admin/shipping_categories/index.html.haml @@ -12,14 +12,14 @@ %col{:style => "width: 85%"}/ %col{:style => "width: 15%"}/ %thead - %tr{"data-hook" => "categories_header"} + %tr %th= Spree.t(:name) %th = t(:temperature_controlled) %th.actions %tbody - @shipping_categories.each do |shipping_category| - %tr{:class => "#{cycle('odd', 'even')}", "data-hook" => "category_row", :id => "#{spree_dom_id shipping_category}"} + %tr{:class => "#{cycle('odd', 'even')}", :id => "#{spree_dom_id shipping_category}"} %td{:style => "width:350px;"}= shipping_category.name %td.align-center = shipping_category.temperature_controlled ? t(:yes) : t(:no) diff --git a/app/views/spree/admin/tax_categories/index.html.haml b/app/views/spree/admin/tax_categories/index.html.haml index 44523eb5e8b..fa4e4e1832e 100644 --- a/app/views/spree/admin/tax_categories/index.html.haml +++ b/app/views/spree/admin/tax_categories/index.html.haml @@ -15,7 +15,7 @@ %col{style: "width: 15%"}/ %col{style: "width: 15%"}/ %thead - %tr{"data-hook" => "tax_header"} + %tr %th= t("spree.name") %th= t("spree.description") %th= t("spree.default") diff --git a/app/views/spree/admin/tax_settings/edit.html.haml b/app/views/spree/admin/tax_settings/edit.html.haml index 7ad2a3cdc7a..18f4c36aa92 100644 --- a/app/views/spree/admin/tax_settings/edit.html.haml +++ b/app/views/spree/admin/tax_settings/edit.html.haml @@ -5,10 +5,10 @@ = form_tag admin_tax_settings_path, :method => :put do - .field.align-center{ "data-hook" => "products_require_tax_category" } + .field.align-center = hidden_field_tag 'preferences[products_require_tax_category]', '0' = check_box_tag 'preferences[products_require_tax_category]', '1', Spree::Config[:products_require_tax_category] = label_tag nil, t(:products_require_tax_category) - .form-buttons{"data-hook" => "buttons"} + .form-buttons = button t(:update), 'icon-refresh' diff --git a/app/views/spree/admin/users/edit.html.haml b/app/views/spree/admin/users/edit.html.haml index 78304b663c3..432e6e80c25 100644 --- a/app/views/spree/admin/users/edit.html.haml +++ b/app/views/spree/admin/users/edit.html.haml @@ -3,15 +3,15 @@ - content_for :page_actions do %li = button_link_to t(".back_to_users_list"), spree.admin_users_path, icon: "icon-arrow-left" -%fieldset.alpha.ten.columns{"data-hook" => "admin_user_edit_general_settings"} +%fieldset.alpha.ten.columns %legend= t(".general_settings") - %div{"data-hook" => "admin_user_edit_form_header"} + %div = render partial: "spree/shared/error_messages", locals: { target: @user } - %div{"data-hook" => "admin_user_edit_form"} + %div = form_for [:admin, @user] do |f| = render "email_confirmation" unless @user.confirmed? = render partial: "form", locals: { f: f } - %div{"data-hook" => "admin_user_edit_form_button"} + %div = render partial: "spree/admin/shared/edit_resource_links" = render partial: 'spree/admin/users/api_fields' diff --git a/app/views/spree/admin/variants/_autocomplete.js.erb b/app/views/spree/admin/variants/_autocomplete.js.erb index c4d1f8d96a1..c4f3bae9546 100644 --- a/app/views/spree/admin/variants/_autocomplete.js.erb +++ b/app/views/spree/admin/variants/_autocomplete.js.erb @@ -29,7 +29,7 @@