From 666a1c022a768f04b90bc28e6fbbb9f54facb82e Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Mon, 11 Nov 2024 13:22:27 +0100 Subject: [PATCH 01/10] chore: remove multi-select checkbox from results table --- .../results-table.component.html | 11 +--------- .../results-table/results-table.component.ts | 20 ------------------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/libs/ui/search/src/lib/results-table/results-table.component.html b/libs/ui/search/src/lib/results-table/results-table.component.html index 72f94ab11..5ddfbd814 100644 --- a/libs/ui/search/src/lib/results-table/results-table.component.html +++ b/libs/ui/search/src/lib/results-table/results-table.component.html @@ -4,16 +4,7 @@ > - - - - + - this.selectedRecordsIdentifiers.includes(record.uniqueIdentifier) - ) - } - - isSomeSelected(): boolean { - const allSelected = this.records.every((record) => - this.selectedRecordsIdentifiers.includes(record.uniqueIdentifier) - ) - const someSelected = this.records.some((record) => - this.selectedRecordsIdentifiers.includes(record.uniqueIdentifier) - ) - return !allSelected && someSelected - } } From b6b3836184e43033de41601e1b0293d21c2814de Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Mon, 11 Nov 2024 13:27:26 +0100 Subject: [PATCH 02/10] chore: remove tabs above record tables and their translations --- .../all-records/all-records.component.html | 16 ---------------- .../records/my-records/my-records.component.html | 16 ---------------- translations/de.json | 4 ---- translations/en.json | 4 ---- translations/es.json | 4 ---- translations/fr.json | 4 ---- translations/it.json | 4 ---- translations/nl.json | 4 ---- translations/pt.json | 4 ---- translations/sk.json | 4 ---- 10 files changed, 64 deletions(-) diff --git a/apps/metadata-editor/src/app/records/all-records/all-records.component.html b/apps/metadata-editor/src/app/records/all-records/all-records.component.html index 2cef0f1d7..3cd22212c 100644 --- a/apps/metadata-editor/src/app/records/all-records/all-records.component.html +++ b/apps/metadata-editor/src/app/records/all-records/all-records.component.html @@ -27,22 +27,6 @@

-
- dashboard.results.listMetadata -
-
- dashboard.results.listResources -
-
- dashboard.myRecords.publishedMetadatas -
-
- dashboard.myRecords.currentlyEdited -
Date: Mon, 11 Nov 2024 13:32:50 +0100 Subject: [PATCH 03/10] chore: uncomment tabs from navbar and remove their translations --- .../dashboard/dashboard-menu/dashboard-menu.component.html | 4 ++-- translations/de.json | 2 -- translations/en.json | 2 -- translations/es.json | 2 -- translations/fr.json | 2 -- translations/it.json | 2 -- translations/nl.json | 2 -- translations/pt.json | 2 -- translations/sk.json | 2 -- 9 files changed, 2 insertions(+), 18 deletions(-) diff --git a/apps/metadata-editor/src/app/dashboard/dashboard-menu/dashboard-menu.component.html b/apps/metadata-editor/src/app/dashboard/dashboard-menu/dashboard-menu.component.html index 021ad9895..debd4e9c7 100644 --- a/apps/metadata-editor/src/app/dashboard/dashboard-menu/dashboard-menu.component.html +++ b/apps/metadata-editor/src/app/dashboard/dashboard-menu/dashboard-menu.component.html @@ -10,7 +10,7 @@ dashboard.catalog.allRecords - dashboard.catalog.calendar - + --> Date: Mon, 11 Nov 2024 13:40:54 +0100 Subject: [PATCH 04/10] chore: uncomment elements from editor toolbar that are not yet implemented and immport record from model --- .../top-toolbar/top-toolbar.component.html | 8 ++++---- .../import-record/import-record.component.ts | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.html b/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.html index c191759ce..8257d3474 100644 --- a/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.html +++ b/apps/metadata-editor/src/app/edit/components/top-toolbar/top-toolbar.component.html @@ -1,5 +1,5 @@
- - + --> editor.record.saveStatus.draftWithChangesPending
- - +
-->
diff --git a/libs/feature/editor/src/lib/components/import-record/import-record.component.ts b/libs/feature/editor/src/lib/components/import-record/import-record.component.ts index 98f1193b7..2bb72582c 100644 --- a/libs/feature/editor/src/lib/components/import-record/import-record.component.ts +++ b/libs/feature/editor/src/lib/components/import-record/import-record.component.ts @@ -63,13 +63,13 @@ export class ImportRecordComponent { @Output() closeImportMenu = new EventEmitter() importMenuItems: ImportMenuItems[] = [ - { - label: this.translateService.instant('dashboard.importRecord.useModel'), - icon: 'iconoirLightBulbOn', - action: () => null, - dataTest: 'useAModelButton', - disabled: true, - }, + // { + // label: this.translateService.instant('dashboard.importRecord.useModel'), + // icon: 'iconoirLightBulbOn', + // action: () => null, + // dataTest: 'useAModelButton', + // disabled: true, + // }, { label: this.translateService.instant( 'dashboard.importRecord.importExternal' From 36c294eeb3350965c0ef10895c70bc8c1e0ca219 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Mon, 11 Nov 2024 14:09:19 +0100 Subject: [PATCH 05/10] chore: do not display title help icon if text is empty --- .../components/record-form/form-field/form-field.component.html | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html b/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html index f2d34d0b7..93c3990f5 100644 --- a/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +++ b/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html @@ -41,6 +41,7 @@ >edit Date: Mon, 11 Nov 2024 14:48:37 +0100 Subject: [PATCH 06/10] chore: fix e2e test --- apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts index 6f206e848..65362b094 100644 --- a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts @@ -140,25 +140,11 @@ describe('dashboard (authenticated)', () => { it('should show nothing when none are selected', () => { cy.visit('/catalog/search') - cy.get('gn-ui-results-table') - .find('.table-row-cell') - .get('gn-ui-checkbox') - .each(($checkbox) => cy.wrap($checkbox).click()) cy.get('[data-cy=records-information]').should( 'not.have.descendants', '[data-test=selected-count]' ) }) - - it('should select all records when the "select all" checkbox is checked', () => { - cy.visit('/catalog/search') - cy.get('gn-ui-results-table') - .find('.table-row-cell') - .get('gn-ui-checkbox') - .first() - .click() - cy.get('[data-test=selected-count]').contains('15 selected') - }) }) describe('columns', () => { beforeEach(() => { From db3d1909b2a3b54f6a91614911bb52d5f28d59a8 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Mon, 11 Nov 2024 14:55:18 +0100 Subject: [PATCH 07/10] chore: fix unit test --- .../results-table.component.spec.ts | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/libs/ui/search/src/lib/results-table/results-table.component.spec.ts b/libs/ui/search/src/lib/results-table/results-table.component.spec.ts index a4b639c80..ac00566dc 100644 --- a/libs/ui/search/src/lib/results-table/results-table.component.spec.ts +++ b/libs/ui/search/src/lib/results-table/results-table.component.spec.ts @@ -106,32 +106,6 @@ describe('ResultsTableComponent', () => { expect(emitted).toEqual([[record], true]) }) }) - - describe('#isAllSelected', () => { - it('returns true if all records in the page are selected', () => { - component.selectedRecordsIdentifiers = ['1', '2', '3', '4', '5'] - expect(component.isAllSelected()).toBe(true) - }) - it('returns false otherwise', () => { - component.selectedRecordsIdentifiers = ['1'] - expect(component.isAllSelected()).toBe(false) - }) - }) - - describe('#isSomeSelected', () => { - it('returns false if all records in the page are selected', () => { - component.selectedRecordsIdentifiers = ['1', '2', '3', '4', '5'] - expect(component.isSomeSelected()).toBe(false) - }) - it('returns true if one or more records in the page is selected', () => { - component.selectedRecordsIdentifiers = ['2', '3'] - expect(component.isSomeSelected()).toBe(true) - }) - it('returns false if no record in the page is selected', () => { - component.selectedRecordsIdentifiers = ['4', '5'] - expect(component.isSomeSelected()).toBe(false) - }) - }) }) describe('clicking on a dataset', () => { From af569af3a67d9c6da8c5a4c3848168c128c1c87b Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Mon, 11 Nov 2024 15:22:12 +0100 Subject: [PATCH 08/10] chore: fix e2e test --- apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts index 65362b094..d9475f15d 100644 --- a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts @@ -211,7 +211,7 @@ describe('dashboard (authenticated)', () => { }) describe('my records', () => { it('should only display records I own', () => { - cy.get('md-editor-dashboard-menu').find('a').eq(5).click() + cy.get('md-editor-dashboard-menu').find('a').eq(3).click() cy.get('gn-ui-results-table') .find('[data-cy="table-row"]') .find('ng-icon') @@ -219,19 +219,18 @@ describe('dashboard (authenticated)', () => { .should('contain', 'admin admin') }) it('should display the correct amount of records', () => { - cy.get('md-editor-dashboard-menu').find('a').eq(5).click() + cy.get('md-editor-dashboard-menu').find('a').eq(3).click() cy.get('gn-ui-results-table') .find('[data-cy="table-row"]') .should('have.length', '10') }) it('should sort the records by title', () => { - cy.get('md-editor-dashboard-menu').find('a').eq(5).click() + cy.get('md-editor-dashboard-menu').find('a').eq(3).click() cy.get('gn-ui-results-table') .find('[data-cy="table-row"]') .first() .invoke('text') .then((firstRecord) => { - console.log(firstRecord) cy.get('gn-ui-results-table') .find('.table-header-cell') .eq(1) From 19a0aa3cd8b0cce03c83cff6510a93f28ea01943 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Mon, 11 Nov 2024 15:52:55 +0100 Subject: [PATCH 09/10] chore: fix e2e test --- apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts index d9475f15d..6d2b978e2 100644 --- a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts @@ -273,7 +273,7 @@ describe('dashboard (authenticated)', () => { cy.get('gn-ui-autocomplete').should('have.value', '') }) it('should hide the search input when navigating to my drafts', () => { - cy.get('md-editor-dashboard-menu').find('a').eq(6).click() + cy.get('md-editor-dashboard-menu').find('a').eq(4).click() cy.get('gn-ui-autocomplete').should('not.exist') }) }) From 58fe44ea1982fbbf09f0e3bece021781cb516fa0 Mon Sep 17 00:00:00 2001 From: Angelika Kinas Date: Tue, 26 Nov 2024 09:06:14 +0100 Subject: [PATCH 10/10] chore: clean up ng-template --- .../ui/search/src/lib/results-table/results-table.component.html | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/ui/search/src/lib/results-table/results-table.component.html b/libs/ui/search/src/lib/results-table/results-table.component.html index 5ddfbd814..38fcf8fbf 100644 --- a/libs/ui/search/src/lib/results-table/results-table.component.html +++ b/libs/ui/search/src/lib/results-table/results-table.component.html @@ -4,7 +4,6 @@ > -