diff --git a/app/components/sdg/related_list_selector_component.html.erb b/app/components/sdg/related_list_selector_component.html.erb index a1bbca60e..e86ee3288 100644 --- a/app/components/sdg/related_list_selector_component.html.erb +++ b/app/components/sdg/related_list_selector_component.html.erb @@ -12,7 +12,11 @@ <%= f.text_field :related_sdg_list, class: "input", placeholder: t("sdg.related_list_selector.placeholder"), - label: t("sdg.related_list_selector.hint"), + hint: sanitize(t("sdg.related_list_selector.hint", + link: link_to(t("sdg.related_list_selector.help.text"), + sdg_help_path, + title: t("shared.target_blank"), + target: "_blank"))), data: { "suggestions-list": sdg_related_suggestions, "remove-tag-text": t("sdg.related_list_selector.remove_tag") } %> diff --git a/config/locales/en/activerecord.yml b/config/locales/en/activerecord.yml index ce8db966a..91d497b96 100644 --- a/config/locales/en/activerecord.yml +++ b/config/locales/en/activerecord.yml @@ -7,6 +7,7 @@ en: name: Name email: Email description: Description + related_sdg_list: Goals and Targets activerecord: models: activity: diff --git a/config/locales/en/sdg.yml b/config/locales/en/sdg.yml index c3fbb20ac..5ba8a35e0 100644 --- a/config/locales/en/sdg.yml +++ b/config/locales/en/sdg.yml @@ -461,7 +461,8 @@ en: goal_list: "You can choose one or several SDGs aligned with your %{record}" help: title: "Which SDGs and targets are aligned with my %{record}?" - hint: "You can introduce the code of a specific goal/target or a text to find one" + text: "SDG help page" + hint: You can introduce the code of a specific goal/target or a text to find one. For more information visit the %{link}. placeholder: "Write a goal or target code or description" remove_tag: "Remove" title: "Sustainable Development Goals and Targets" diff --git a/config/locales/es/activerecord.yml b/config/locales/es/activerecord.yml index 86f05b5ff..65f17649b 100644 --- a/config/locales/es/activerecord.yml +++ b/config/locales/es/activerecord.yml @@ -7,6 +7,7 @@ es: name: Nombre email: Email description: Descripción + related_sdg_list: Objetivos y Metas activerecord: models: activity: diff --git a/config/locales/es/sdg.yml b/config/locales/es/sdg.yml index 879a2484d..0b4e7e484 100644 --- a/config/locales/es/sdg.yml +++ b/config/locales/es/sdg.yml @@ -461,7 +461,8 @@ es: goal_list: "Puedes seleccionar uno o varios ODS con los que se alinea tu %{record}" help: title: "¿Qué ODS y metas se alinean con mi %{record}?" - hint: "Puedes introducir el código de un objetivo/meta específico o un texto para encontrar uno" + text: "página de ayuda de ODS" + hint: Puedes introducir el código de un objetivo/meta específico o un texto para encontrar uno. Para más información visita la %{link}. placeholder: "Escribe las etiquetas que desees" remove_tag: "Eliminar" title: "Objetivos de Desarrollo Sostenible y Metas" diff --git a/spec/system/sdg_management/relations_spec.rb b/spec/system/sdg_management/relations_spec.rb index e6d43513b..6afc0475c 100644 --- a/spec/system/sdg_management/relations_spec.rb +++ b/spec/system/sdg_management/relations_spec.rb @@ -305,17 +305,17 @@ describe "SDG Relations", :js do create(:sdg_local_target, code: "1.1.1") visit sdg_management_edit_legislation_process_path(process) - fill_in "You can introduce the code of a specific goal/target or a text to find one", with: "3" + fill_in "Goals and Targets", with: "3" within(".amsify-list") { find(:css, "[data-val='3']").click } within(".amsify-suggestags-input-area") { expect(page).to have_content "SDG3" } - fill_in "You can introduce the code of a specific goal/target or a text to find one", with: "1.1" + fill_in "Goals and Targets", with: "1.1" within(".amsify-list") { find(:css, "[data-val='1.1']").click } within(".amsify-suggestags-input-area") { expect(page).to have_content "1.1" } - fill_in "You can introduce the code of a specific goal/target or a text to find one", with: "1.1.1" + fill_in "Goals and Targets", with: "1.1.1" within(".amsify-list") { find(:css, "[data-val='1.1.1']").click } within(".amsify-suggestags-input-area") { expect(page).to have_content "1.1.1" } @@ -333,7 +333,7 @@ describe "SDG Relations", :js do process = create(:legislation_process, title: "SDG process") visit sdg_management_edit_legislation_process_path(process) - fill_in "You can introduce the code of a specific goal/target or a text to find one", with: "tag nonexistent," + fill_in "Goals and Targets", with: "tag nonexistent," within(".amsify-suggestags-input-area") { expect(page).not_to have_content "tag nonexistent" } end