From 48fd10afc43ae59d6f6c610e8d2467aaecae94e9 Mon Sep 17 00:00:00 2001 From: Romuald Caplier Date: Fri, 31 May 2024 12:12:41 +0200 Subject: [PATCH] refactor(datahub): added an error message when record has no link. --- .../src/e2e/datasetDetailPage.cy.ts | 11 ++- .../record-metadata.component.html | 15 ++- .../record-metadata.component.spec.ts | 39 +++++--- .../record-metadata.component.ts | 11 +++ .../results-list.container.component.html | 8 +- libs/ui/elements/src/index.ts | 2 +- .../error.component.css} | 0 .../error.component.html} | 21 ++++- .../src/lib/error/error.component.spec.ts | 86 ++++++++++++++++++ .../error.component.stories.ts} | 14 ++- .../error.component.ts} | 9 +- .../search-results-error.component.spec.ts | 24 ----- .../ui/elements/src/lib/ui-elements.module.ts | 7 +- .../docker-entrypoint-initdb.d/dump | Bin 449380 -> 460487 bytes 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 + translations/sk.json | 1 + 22 files changed, 187 insertions(+), 68 deletions(-) rename libs/ui/elements/src/lib/{search-results-error/search-results-error.component.css => error/error.component.css} (100%) rename libs/ui/elements/src/lib/{search-results-error/search-results-error.component.html => error/error.component.html} (66%) create mode 100644 libs/ui/elements/src/lib/error/error.component.spec.ts rename libs/ui/elements/src/lib/{search-results-error/search-results-error.component.stories.ts => error/error.component.stories.ts} (80%) rename libs/ui/elements/src/lib/{search-results-error/search-results-error.component.ts => error/error.component.ts} (63%) delete mode 100644 libs/ui/elements/src/lib/search-results-error/search-results-error.component.spec.ts diff --git a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts index d02385ae12..0e9813850e 100644 --- a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts @@ -575,6 +575,15 @@ describe('dataset pages', () => { }) }) }) + + describe('When there is no link', () => { + beforeEach(() => { + cy.visit('/dataset/a3774ef6-809d-4dd1-984f-9254f49cbd0a') + }) + it('display the error datasetHasNoLink error block', () => { + cy.get('[data-test="dataset-has-no-link-block"]').should('exist') + }) + }) }) }) }) @@ -795,7 +804,7 @@ describe('When the metadata does not exists', () => { cy.visit('/dataset/xyz') }) it('should display an error message', () => { - cy.get('gn-ui-search-results-error').should('exist') + cy.get('gn-ui-error').should('exist') cy.screenshot({ capture: 'viewport' }) }) }) diff --git a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html index a741ca4b6a..efc77e05c4 100644 --- a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html +++ b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html @@ -133,7 +133,12 @@ - + + +