Pluralize admin products search result [OFN-12532]

This commit is contained in:
wandji20
2024-07-16 13:10:14 +01:00
parent a66fec0b26
commit 80ade22bd6
3 changed files with 10 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
#sort
%div.pagination-description
- if pagy.present?
= t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to)
= t(".pagination.total_html", count: pagy.count, from: pagy.from, to: pagy.to)
- if search_term.present? || producer_id.present? || category_id.present?
%a{ href: url_for(page: 1), class: "button disruptive", 'data-turbo-frame': "_self" }

View File

@@ -878,7 +878,9 @@ en:
search: Search
sort:
pagination:
total_html: "<strong>%{total} products</strong> found for your search criteria. Showing %{from} to %{to}."
total_html:
one: "<strong>%{count} product</strong> found for your search criteria. Showing %{from} to %{to}."
other: "<strong>%{count} products</strong> found for your search criteria. Showing %{from} to %{to}."
per_page:
show: Show
per_page: "%{num} per page"

View File

@@ -186,7 +186,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
search_for "searchable product"
expect(page).to have_field "search_term", with: "searchable product"
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
expect_products_count_to_be 1
end
@@ -205,7 +205,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
search_for "searchable product"
expect(page).to have_field "search_term", with: "searchable product"
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
expect_products_count_to_be 1
end
@@ -218,7 +218,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
search_for "Big box"
expect(page).to have_field "search_term", with: "Big box"
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
expect_products_count_to_be 1
end
@@ -235,7 +235,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
expect_per_page_to_be 15
expect_products_count_to_be 1
search_for "searchable product"
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
expect_products_count_to_be 1
end
@@ -245,7 +245,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
search_for "searchable product"
expect(page).to have_field "search_term", with: "searchable product"
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
expect_products_count_to_be 1
expect(page).to have_field "Name", with: product_by_name.name
@@ -315,7 +315,7 @@ RSpec.describe 'As an enterprise user, I can manage my products', feature: :admi
search_by_category "Category 1"
expect(page).to have_content "1 products found for your search criteria. Showing 1 to 1."
expect(page).to have_content "1 product found for your search criteria. Showing 1 to 1."
expect(page).to have_select "category_id", selected: "Category 1"
expect_products_count_to_be 1
expect(page).to have_field "Name", with: product_by_category.name