From 3347157b435656f5976b1fc073523da630b7142a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 25 Aug 2021 01:17:21 +0200 Subject: [PATCH] Remove placeholder in advanced search When users see a label saying "With the text" and an input field, they don't usually need a placeholder saying "Write the text". On the contrary, this text adds noise and is hard to read due to the low contrast between the color of the placeholder and the color of the field, making the text an unnecessary distraction. --- .../shared/advanced_search_component.html.erb | 3 +-- config/locales/en/general.yml | 1 - config/locales/es/general.yml | 1 - spec/system/advanced_search_spec.rb | 10 +++++----- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/components/shared/advanced_search_component.html.erb b/app/components/shared/advanced_search_component.html.erb index 401e8f426..8a138f529 100644 --- a/app/components/shared/advanced_search_component.html.erb +++ b/app/components/shared/advanced_search_component.html.erb @@ -8,8 +8,7 @@ - <%= text_field_tag "search", params[:search], - placeholder: t("shared.advanced_search.general_placeholder") %> + <%= text_field_tag "search", params[:search] %>
diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 8340486db..a1de08041 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -683,7 +683,6 @@ en: date_5: "Customized" from: "From" general: "With the text" - general_placeholder: "Write the text" goal: "By SDG" goal_blank: "Select a goal" search: "Filter" diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index b07c45b2e..6286269d9 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -683,7 +683,6 @@ es: date_5: "Personalizada" from: "Desde" general: "Con el texto" - general_placeholder: "Escribe el texto" goal: "Por ODS" goal_blank: "Elige un objetivo" search: "Filtrar" diff --git a/spec/system/advanced_search_spec.rb b/spec/system/advanced_search_spec.rb index 9a0d44a39..adfbb46bb 100644 --- a/spec/system/advanced_search_spec.rb +++ b/spec/system/advanced_search_spec.rb @@ -12,7 +12,7 @@ describe "Advanced search" do visit debates_path click_button "Advanced search" - fill_in "Write the text", with: "Schwifty" + fill_in "With the text", with: "Schwifty" click_button "Filter" expect(page).to have_content("There are 2 debates") @@ -32,7 +32,7 @@ describe "Advanced search" do visit proposals_path click_button "Advanced search" - fill_in "Write the text", with: "Schwifty" + fill_in "With the text", with: "Schwifty" click_button "Filter" expect(page).to have_content("There are 2 citizen proposals") @@ -52,7 +52,7 @@ describe "Advanced search" do visit budget_investments_path(budget) click_button "Advanced search" - fill_in "Write the text", with: "Schwifty" + fill_in "With the text", with: "Schwifty" click_button "Filter" expect(page).to have_content("There are 2 investments") @@ -204,7 +204,7 @@ describe "Advanced search" do visit budget_investments_path(budget) click_button "Advanced search" - fill_in "Write the text", with: "Schwifty" + fill_in "With the text", with: "Schwifty" select "7. Affordable and Clean Energy", from: "By SDG" select "Last 24 hours", from: "js-advanced-search-date-min" @@ -224,7 +224,7 @@ describe "Advanced search" do visit debates_path click_button "Advanced search" - fill_in "Write the text", with: "Schwifty" + fill_in "With the text", with: "Schwifty" select "7. Affordable and Clean Energy", from: "By SDG" select "Last 24 hours", from: "js-advanced-search-date-min"