From 8b75244715d4639731391c29eacc078a144efc55 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Wed, 25 Oct 2023 15:30:17 +0200 Subject: [PATCH 1/3] feat(ME): Add selected records count, add translations --- .../record-table/record-table.component.html | 27 ++++++++++++------- translations/de.json | 1 + translations/en.json | 1 + translations/es.json | 1 + translations/fr.json | 1 + translations/it.json | 1 + translations/nl.json | 1 + translations/pt.json | 1 + 8 files changed, 25 insertions(+), 9 deletions(-) diff --git a/libs/ui/search/src/lib/record-table/record-table.component.html b/libs/ui/search/src/lib/record-table/record-table.component.html index 809973bf98..426d7977fa 100644 --- a/libs/ui/search/src/lib/record-table/record-table.component.html +++ b/libs/ui/search/src/lib/record-table/record-table.component.html @@ -1,14 +1,23 @@
-
- results.records.hits.displayedOn +
+
+ results.records.hits.displayedOn +
+
+ results.records.hits.selected +
  • Versuchen Sie andere Wörter
  • Geben Sie weniger Wörter ein
  • ", "results.records.hits.found": "{hits, plural, =0{Keine Dokumente entsprechen der angegebenen Suche.} one{1 Datensatz gefunden.} other{{hits} Datensätze gefunden.}}", + "results.records.hits.selected": "", "results.showMore": "Mehr Ergebnisse anzeigen...", "results.sortBy.dateStamp": "Letzte Aktualisierungen", "results.sortBy.popularity": "Beliebtheit", diff --git a/translations/en.json b/translations/en.json index a8f6d85feb..06f25a10d8 100644 --- a/translations/en.json +++ b/translations/en.json @@ -224,6 +224,7 @@ "results.records.hits.displayedOn": "{displayed, plural, =0{No record.} one{1 record} other{{displayed} records }} {hits, plural, other{displayed on {hits} total.}}", "results.records.hits.empty.help.html": "Suggestions:
    • Try other words
    • Specify fewer words
    ", "results.records.hits.found": "{hits, plural, =0{No documents match the specified search.} one{1 record found.} other{{hits} records found.}}", + "results.records.hits.selected": "{ amount } selected", "results.showMore": "Show more results...", "results.sortBy.dateStamp": "Most recent", "results.sortBy.popularity": "Popularity", diff --git a/translations/es.json b/translations/es.json index deb48dee7a..fb343b2f7b 100644 --- a/translations/es.json +++ b/translations/es.json @@ -224,6 +224,7 @@ "results.records.hits.displayedOn": "", "results.records.hits.empty.help.html": "", "results.records.hits.found": "", + "results.records.hits.selected": "", "results.showMore": "", "results.sortBy.dateStamp": "", "results.sortBy.popularity": "", diff --git a/translations/fr.json b/translations/fr.json index b433aaa0f9..55a5b0b9d8 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -224,6 +224,7 @@ "results.records.hits.displayedOn": "", "results.records.hits.empty.help.html": "Suggestions :
    • Essayez d'autres mots clés
    • Cherchez moins de mots
    ", "results.records.hits.found": "{hits, plural, =0{Aucune correspondance.} one{1 enregistrement trouvé.} other{{hits} résultats.}}", + "results.records.hits.selected": "", "results.showMore": "Plus de résultats...", "results.sortBy.dateStamp": "Plus récent", "results.sortBy.popularity": "Popularité", diff --git a/translations/it.json b/translations/it.json index db14efc962..bbb065b142 100644 --- a/translations/it.json +++ b/translations/it.json @@ -224,6 +224,7 @@ "results.records.hits.displayedOn": "", "results.records.hits.empty.help.html": "", "results.records.hits.found": "", + "results.records.hits.selected": "", "results.showMore": "", "results.sortBy.dateStamp": "", "results.sortBy.popularity": "", diff --git a/translations/nl.json b/translations/nl.json index 4af1cd9267..11d0f0ab3e 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -224,6 +224,7 @@ "results.records.hits.displayedOn": "", "results.records.hits.empty.help.html": "", "results.records.hits.found": "", + "results.records.hits.selected": "", "results.showMore": "", "results.sortBy.dateStamp": "", "results.sortBy.popularity": "", diff --git a/translations/pt.json b/translations/pt.json index d4a4d66612..22c858950f 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -224,6 +224,7 @@ "results.records.hits.displayedOn": "", "results.records.hits.empty.help.html": "", "results.records.hits.found": "", + "results.records.hits.selected": "", "results.showMore": "", "results.sortBy.dateStamp": "", "results.sortBy.popularity": "", From 1a97045b8f771f0ea85cd58f176879d0d8eb6869 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Tue, 31 Oct 2023 10:18:51 +0100 Subject: [PATCH 2/3] feat(ME): Add e2e tests for chekcboxes --- .../src/e2e/dashboard.cy.ts | 34 +++++++++++++++++++ .../record-table/record-table.component.html | 5 +-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts index 01fcd7a4ef..bb64524af4 100644 --- a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts @@ -61,4 +61,38 @@ describe('dashboard', () => { }) }) }) + + describe('checkboxes', () => { + it('should show the correct amount of selected records when they are selected', () => { + cy.visit('/records/all') + cy.get('gn-ui-record-table') + .find('.record-table-col') + .get('[type="checkbox"]') + .eq(2) + .click() + cy.get('.selected-records').contains('1 selected') + }) + + it('should show nothing when none are selected', () => { + cy.visit('/records/all') + cy.get('gn-ui-record-table') + .find('.record-table-col') + .get('mat-checkbox.mat-primary') + .each(($checkbox) => cy.wrap($checkbox).click()) + cy.get('.records-information').should( + 'not.have.descendants', + '.selected-records' + ) + }) + + it('should select all records when the "select all" checkbox is checked', () => { + cy.visit('/records/all') + cy.get('gn-ui-record-table') + .find('.record-table-col') + .get('mat-checkbox.mat-primary') + .first() + .click() + cy.get('.selected-records').contains('12 selected') + }) + }) }) diff --git a/libs/ui/search/src/lib/record-table/record-table.component.html b/libs/ui/search/src/lib/record-table/record-table.component.html index 426d7977fa..d8dccc68b7 100644 --- a/libs/ui/search/src/lib/record-table/record-table.component.html +++ b/libs/ui/search/src/lib/record-table/record-table.component.html @@ -1,6 +1,6 @@
    -
    +
    From be7ea5002fd57bf9209762f5f9ac8a1ff98d426f Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Tue, 31 Oct 2023 12:26:52 +0100 Subject: [PATCH 3/3] feat(ME): Remove np from records table title --- apps/metadata-editor/src/app/records/records-list.component.html | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/metadata-editor/src/app/records/records-list.component.html b/apps/metadata-editor/src/app/records/records-list.component.html index ef2f49181f..8bdb00e3c6 100644 --- a/apps/metadata-editor/src/app/records/records-list.component.html +++ b/apps/metadata-editor/src/app/records/records-list.component.html @@ -14,7 +14,6 @@

    {{ title }}

    - np

    dashboard.records.users