From b3f05d1a98d509f2c19884a5cafe1a0bab159ebf Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 15 Jan 2020 13:56:31 +0100 Subject: [PATCH] Use "Variants" instead of "Products" in order cycle exchanges UI --- .../panels/exchange_products_distributed.html.haml | 2 +- .../panels/exchange_products_panel_footer.html.haml | 6 +++--- .../panels/exchange_products_panel_header.html.haml | 4 ++-- .../admin/panels/exchange_products_supplied.html.haml | 2 +- config/locales/en.yml | 10 +++++----- spec/features/admin/order_cycles_spec.rb | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/templates/admin/panels/exchange_products_distributed.html.haml b/app/assets/javascripts/templates/admin/panels/exchange_products_distributed.html.haml index 2e05c6493b..fc0326f116 100644 --- a/app/assets/javascripts/templates/admin/panels/exchange_products_distributed.html.haml +++ b/app/assets/javascripts/templates/admin/panels/exchange_products_distributed.html.haml @@ -9,7 +9,7 @@ 'ng-model' => 'exchange.select_all_variants', 'ng-change' => 'setExchangeVariants(exchange, incomingExchangeVariantsFor(exchange.enterprise_id), exchange.select_all_variants)', 'id' => 'order_cycle_outgoing_exchange_{{ $parent.$index }}_select_all_variants' } - {{ 'js.admin.panels.exchange_products.select_all_products' | t:{ total_number_of_products: exchangeTotalVariants(exchange) } }} + {{ 'js.admin.panels.exchange_products.select_all_variants' | t:{ total_number_of_variants: exchangeTotalVariants(exchange) } }} .exchange-products{ 'ng-hide' => 'productsLoading()' } .exchange-product{'ng-repeat' => 'product in enterprises[exchange.enterprise_id].supplied_products | filter:visibleProducts:exchange:order_cycle.visible_variants_for_outgoing_exchanges' } diff --git a/app/assets/javascripts/templates/admin/panels/exchange_products_panel_footer.html.haml b/app/assets/javascripts/templates/admin/panels/exchange_products_panel_footer.html.haml index b15b8a6d0a..7db48a869a 100644 --- a/app/assets/javascripts/templates/admin/panels/exchange_products_panel_footer.html.haml +++ b/app/assets/javascripts/templates/admin/panels/exchange_products_panel_footer.html.haml @@ -1,11 +1,11 @@ .pagination{ 'ng-show' => 'enterprises[exchange.enterprise_id].last_page_loaded < enterprises[exchange.enterprise_id].num_of_pages && !productsLoading()'} .button{ 'ng-click' => 'loadMoreExchangeProducts(exchange)' } - {{ 'js.admin.panels.exchange_products.load_more_products' | t }} + {{ 'js.admin.panels.exchange_products.load_more_variants' | t }} .button{ 'ng-click' => 'loadAllExchangeProducts(exchange)' } - {{ 'js.admin.panels.exchange_products.load_all_products' | t }} + {{ 'js.admin.panels.exchange_products.load_all_variants' | t }} .sixteen.columns.alpha#loading{ 'ng-show' => 'productsLoading()' } %br %img.spinner{ src: "/assets/spinning-circles.svg" } %h1 - {{ 'js.admin.panels.exchange_products.loading_products' | t }} + {{ 'js.admin.panels.exchange_products.loading_variants' | t }} diff --git a/app/assets/javascripts/templates/admin/panels/exchange_products_panel_header.html.haml b/app/assets/javascripts/templates/admin/panels/exchange_products_panel_header.html.haml index ad21ee869c..a08e2800c9 100644 --- a/app/assets/javascripts/templates/admin/panels/exchange_products_panel_header.html.haml +++ b/app/assets/javascripts/templates/admin/panels/exchange_products_panel_header.html.haml @@ -1,5 +1,5 @@ .exchange-load-all-variants %div - {{ 'js.admin.panels.exchange_products.products_loaded' | t:{ num_of_products_loaded: exchangeLoadedVariants(exchange), total_number_of_products: exchangeTotalVariants(exchange) } }} + {{ 'js.admin.panels.exchange_products.variants_loaded' | t:{ num_of_variants_loaded: exchangeLoadedVariants(exchange), total_number_of_variants: exchangeTotalVariants(exchange) } }} %a{ 'ng-click' => 'loadAllExchangeProducts(exchange)', 'ng-show' => 'enterprises[exchange.enterprise_id].last_page_loaded < enterprises[exchange.enterprise_id].num_of_pages' } - {{ 'js.admin.panels.exchange_products.load_all_products' | t }} + {{ 'js.admin.panels.exchange_products.load_all_variants' | t }} diff --git a/app/assets/javascripts/templates/admin/panels/exchange_products_supplied.html.haml b/app/assets/javascripts/templates/admin/panels/exchange_products_supplied.html.haml index c4be5e082c..5277b6dc79 100644 --- a/app/assets/javascripts/templates/admin/panels/exchange_products_supplied.html.haml +++ b/app/assets/javascripts/templates/admin/panels/exchange_products_supplied.html.haml @@ -9,7 +9,7 @@ 'ng-model' => 'exchange.select_all_variants', 'ng-change' => 'selectAllVariants(exchange, exchange.select_all_variants)', 'id' => 'order_cycle_incoming_exchange_{{ $index }}_select_all_variants' } - {{ 'js.admin.panels.exchange_products.select_all_products' | t:{ total_number_of_products: exchangeTotalVariants(exchange) } }} + {{ 'js.admin.panels.exchange_products.select_all_variants' | t:{ total_number_of_variants: exchangeTotalVariants(exchange) } }} %div{ 'ng-include' => "'admin/panels/exchange_products_supplied_list.html'" } diff --git a/config/locales/en.yml b/config/locales/en.yml index 0de0059f3d..761c0d158f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2557,11 +2557,11 @@ See the %{link} to find out more about %{sitename}'s features and to start using description: Description resolve: Resolve exchange_products: - load_more_products: "Load More Products" - load_all_products: "Load All Products" - select_all_products: "Select All %{total_number_of_products} Products" - products_loaded: "%{num_of_products_loaded} of %{total_number_of_products} Products Loaded" - loading_products: "Loading Products" + load_more_variants: "Load More Variants" + load_all_variants: "Load All Variants" + select_all_variants: "Select All %{total_number_of_variants} Variants" + variants_loaded: "%{num_of_variants_loaded} of %{total_number_of_variants} Variants Loaded" + loading_variants: "Loading Variants" tag_rules: shipping_method_tagged_top: "Shipping methods tagged" shipping_method_tagged_bottom: "are:" diff --git a/spec/features/admin/order_cycles_spec.rb b/spec/features/admin/order_cycles_spec.rb index 140c17b5ad..0da5f07c6d 100644 --- a/spec/features/admin/order_cycles_spec.rb +++ b/spec/features/admin/order_cycles_spec.rb @@ -542,7 +542,7 @@ feature ' page.find("tr.supplier-#{supplier_enterprise.id} td.products").click expect(page).to have_selector ".exchange-product-details" - expect(page).to have_content "1 of 2 Products Loaded" + expect(page).to have_content "1 of 2 Variants Loaded" expect(page).to_not have_content new_product.name end @@ -562,7 +562,7 @@ feature ' def expect_all_products_loaded expect(page).to have_content new_product.name.upcase - expect(page).to have_content "2 of 2 Products Loaded" + expect(page).to have_content "2 of 2 Variants Loaded" end end