Skip to content

Commit

Permalink
Change default selected text to 'None selected'
Browse files Browse the repository at this point in the history
Issue: documentacao-e-tarefas/desenvolvimento_e_infra#744

Signed-off-by: Iudi <[email protected]>
Signed-off-by: Jhon <[email protected]>
  • Loading branch information
iudizm committed Feb 14, 2024
1 parent 920af7b commit f21ff0a
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 7 deletions.
5 changes: 4 additions & 1 deletion cypress/tests/Test1_authorFilter.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions cypress/tests/Test2_sectionFilter.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
5 changes: 4 additions & 1 deletion locale/en/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
msgstr "By Section"

msgid "plugins.generic.authorAndSectionSearchFilters.search.noneSelected"
msgstr "None selected"
5 changes: 4 additions & 1 deletion locale/es/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
msgstr "Por Sección"

msgid "plugins.generic.authorAndSectionSearchFilters.search.noneSelected"
msgstr "Nada seleccionado"
5 changes: 4 additions & 1 deletion locale/pt_BR/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
msgstr "Por Seção"

msgid "plugins.generic.authorAndSectionSearchFilters.search.noneSelected"
msgstr "Nada selecionado"
5 changes: 4 additions & 1 deletion locale/sv/locale.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
msgstr "Efter Avsnitt"

msgid "plugins.generic.authorAndSectionSearchFilters.search.noneSelected"
msgstr "Ingen vald"
2 changes: 1 addition & 1 deletion templates/newAuthorsFilter.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{fbvElement type="select" id="authors" name="authors" defaultLabel="" defaultValue="" selected=$authors from=$authorsList translate="0" size=$fbvStyles.size.MEDIUM}
{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}
2 changes: 1 addition & 1 deletion templates/sectionSearchFilter.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{translate key="plugins.generic.authorAndSectionSearchFilters.search.sections"}
</label>
{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}
</div>

0 comments on commit f21ff0a

Please sign in to comment.