From f21ff0af508e2e925b13ae88aa22da8e53228fdc Mon Sep 17 00:00:00 2001 From: iudizm Date: Wed, 14 Feb 2024 14:47:46 -0300 Subject: [PATCH] Change default selected text to 'None selected' Issue: documentacao-e-tarefas/desenvolvimento_e_infra#744 Signed-off-by: Iudi Signed-off-by: Jhon --- cypress/tests/Test1_authorFilter.cy.js | 5 ++++- cypress/tests/Test2_sectionFilter.cy.js | 3 +++ locale/en/locale.po | 5 ++++- locale/es/locale.po | 5 ++++- locale/pt_BR/locale.po | 5 ++++- locale/sv/locale.po | 5 ++++- templates/newAuthorsFilter.tpl | 2 +- templates/sectionSearchFilter.tpl | 2 +- 8 files changed, 25 insertions(+), 7 deletions(-) diff --git a/cypress/tests/Test1_authorFilter.cy.js b/cypress/tests/Test1_authorFilter.cy.js index be51d62..54eaced 100644 --- a/cypress/tests/Test1_authorFilter.cy.js +++ b/cypress/tests/Test1_authorFilter.cy.js @@ -6,7 +6,10 @@ describe('Author search filter replacement', function () { it('Field should be a dropdown list of authors', function () { cy.visit('publicknowledge/search'); cy.get('#authors').should('be.visible').and('have.prop', 'tagName', 'SELECT'); + cy.get('#authors').should('have.value', ''); + cy.get('#authors').children().eq(0).should('have.text', 'None selected'); + cy.get('#authors').children().should('have.length', expectedAuthorsCount + 1); cy.contains('#authors option', expectedAuthorsNamesInSelection[0]); cy.contains('#authors option', expectedAuthorsNamesInSelection[1]); @@ -17,7 +20,7 @@ describe('Author search filter replacement', function () { cy.get('#authors').select(expectedAuthorsNamesInSelection[0]); cy.contains('button', 'Search').click(); cy.contains("Antimicrobial, heavy metal resistance and plasmid profile of coliforms isolated from nosocomial infections in a hospital in Isfahan, Iran"); - + cy.get('#authors').select(expectedAuthors[1]); cy.contains('button', 'Search').click(); cy.contains("The Signalling Theory Dividends"); diff --git a/cypress/tests/Test2_sectionFilter.cy.js b/cypress/tests/Test2_sectionFilter.cy.js index 20782a0..9f3ab99 100644 --- a/cypress/tests/Test2_sectionFilter.cy.js +++ b/cypress/tests/Test2_sectionFilter.cy.js @@ -5,7 +5,10 @@ describe('Section search filter', function () { it('New field should be a dropdown list of sections', function () { cy.visit('publicknowledge/search'); cy.get('#sections').should('be.visible').and('have.prop', 'tagName', 'SELECT'); + cy.get('#sections').should('have.value', ''); + cy.get('#sections').children().eq(0).should('have.text', 'None selected'); + cy.get('#sections').children().should('have.length', expectedSectionsCount + 1); cy.contains('#sections option', expectedSections[0]); cy.contains('#sections option', expectedSections[1]); diff --git a/locale/en/locale.po b/locale/en/locale.po index ecea017..6b42558 100644 --- a/locale/en/locale.po +++ b/locale/en/locale.po @@ -18,4 +18,7 @@ msgid "plugins.generic.authorAndSectionSearchFilters.description" msgstr "Adds/modify advanced filters by author and section in the OJS search" msgid "plugins.generic.authorAndSectionSearchFilters.search.sections" -msgstr "By Section" \ No newline at end of file +msgstr "By Section" + +msgid "plugins.generic.authorAndSectionSearchFilters.search.noneSelected" +msgstr "None selected" \ No newline at end of file diff --git a/locale/es/locale.po b/locale/es/locale.po index 4aa166f..29dd3a6 100644 --- a/locale/es/locale.po +++ b/locale/es/locale.po @@ -18,4 +18,7 @@ msgid "plugins.generic.authorAndSectionSearchFilters.description" msgstr "Agregar/modificar filtros avanzados por autor y sección en la búsqueda del OJS" msgid "plugins.generic.authorAndSectionSearchFilters.search.sections" -msgstr "Por Sección" \ No newline at end of file +msgstr "Por Sección" + +msgid "plugins.generic.authorAndSectionSearchFilters.search.noneSelected" +msgstr "Nada seleccionado" \ No newline at end of file diff --git a/locale/pt_BR/locale.po b/locale/pt_BR/locale.po index 73be6de..7041137 100644 --- a/locale/pt_BR/locale.po +++ b/locale/pt_BR/locale.po @@ -18,4 +18,7 @@ msgid "plugins.generic.authorAndSectionSearchFilters.description" msgstr "Adiciona/modifica filtros avançados por autor e por seção na busca do OJS" msgid "plugins.generic.authorAndSectionSearchFilters.search.sections" -msgstr "Por Seção" \ No newline at end of file +msgstr "Por Seção" + +msgid "plugins.generic.authorAndSectionSearchFilters.search.noneSelected" +msgstr "Nada selecionado" \ No newline at end of file diff --git a/locale/sv/locale.po b/locale/sv/locale.po index bf990a1..9505876 100644 --- a/locale/sv/locale.po +++ b/locale/sv/locale.po @@ -18,4 +18,7 @@ msgid "plugins.generic.authorAndSectionSearchFilters.description" msgstr "Lägger till/ändrar avancerade filter efter författare och avsnitt i OJS-sökningen" msgid "plugins.generic.authorAndSectionSearchFilters.search.sections" -msgstr "Efter Avsnitt" \ No newline at end of file +msgstr "Efter Avsnitt" + +msgid "plugins.generic.authorAndSectionSearchFilters.search.noneSelected" +msgstr "Ingen vald" \ No newline at end of file diff --git a/templates/newAuthorsFilter.tpl b/templates/newAuthorsFilter.tpl index f770691..6d42f5c 100644 --- a/templates/newAuthorsFilter.tpl +++ b/templates/newAuthorsFilter.tpl @@ -1 +1 @@ -{fbvElement type="select" id="authors" name="authors" defaultLabel="" defaultValue="" selected=$authors from=$authorsList translate="0" size=$fbvStyles.size.MEDIUM} \ No newline at end of file +{fbvElement type="select" id="authors" name="authors" defaultLabel="{translate key="plugins.generic.authorAndSectionSearchFilters.search.noneSelected"}" defaultValue="" selected=$authors from=$authorsList translate="0" size=$fbvStyles.size.MEDIUM} \ No newline at end of file diff --git a/templates/sectionSearchFilter.tpl b/templates/sectionSearchFilter.tpl index 74a4834..e11ddb4 100644 --- a/templates/sectionSearchFilter.tpl +++ b/templates/sectionSearchFilter.tpl @@ -3,6 +3,6 @@ {translate key="plugins.generic.authorAndSectionSearchFilters.search.sections"} {block name=searchSections} - {fbvElement type="select" id="sections" name="sections" defaultLabel="" defaultValue="" selected=$sections from=$sectionsList translate="0" size=$fbvStyles.size.MEDIUM} + {fbvElement type="select" id="sections" name="sections" defaultLabel="{translate key="plugins.generic.authorAndSectionSearchFilters.search.noneSelected"}" defaultValue="" selected=$sections from=$sectionsList translate="0" size=$fbvStyles.size.MEDIUM} {/block}