From 0e12f89d8e20ad6d1cd570eb7a1b40f6602afb26 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Thu, 23 May 2024 15:28:59 +0200 Subject: [PATCH 1/3] feat: add condition to userFeedBacks display --- .../record-metadata.component.html | 18 +++++++++++------- .../record-metadata.component.ts | 5 +++++ 2 files changed, 16 insertions(+), 7 deletions(-) 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 b55e6ed7e1..65c35e6f1d 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 @@ -148,13 +148,17 @@
- -
-
- +
+
+ +
this.sourceService.getSourceLabel(uuid)) ) + loadFeedBacks$ = this.metadataViewFacade.metadata$.pipe( + map((record) => record?.title), + filter(Boolean) + ) + errorTypes = ErrorType selectedTabIndex$ = new BehaviorSubject(0) From 9278cb40bead4251f9a0cad0e06fc52465a4dd56 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Thu, 23 May 2024 15:41:26 +0200 Subject: [PATCH 2/3] feat: add e2e test --- apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts index 155e67a0c0..d4dfb3a1fb 100644 --- a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts @@ -797,3 +797,12 @@ describe('userFeedback', () => { }) }) }) + +describe('When the metadata does not exists', () => { + beforeEach(() => { + cy.visit('/dataset/xyz') + }) + it('should display an error message', () => { + cy.get('gn-ui-search-results-error').should('exist') + }) +}) From 46f507be393600c138c9d4116cd6a5cbbc333aa7 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Tue, 28 May 2024 12:20:33 +0200 Subject: [PATCH 3/3] feat: remove error reset when the feedbacks are loading --- .../record/record-metadata/record-metadata.component.html | 2 +- .../app/record/record-metadata/record-metadata.component.ts | 5 ----- libs/feature/record/src/lib/state/mdview.reducer.ts | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) 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 65c35e6f1d..a741ca4b6a 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 @@ -149,7 +149,7 @@
diff --git a/apps/datahub/src/app/record/record-metadata/record-metadata.component.ts b/apps/datahub/src/app/record/record-metadata/record-metadata.component.ts index f0114e327f..94ee20c041 100644 --- a/apps/datahub/src/app/record/record-metadata/record-metadata.component.ts +++ b/apps/datahub/src/app/record/record-metadata/record-metadata.component.ts @@ -70,11 +70,6 @@ export class RecordMetadataComponent { mergeMap((uuid) => this.sourceService.getSourceLabel(uuid)) ) - loadFeedBacks$ = this.metadataViewFacade.metadata$.pipe( - map((record) => record?.title), - filter(Boolean) - ) - errorTypes = ErrorType selectedTabIndex$ = new BehaviorSubject(0) diff --git a/libs/feature/record/src/lib/state/mdview.reducer.ts b/libs/feature/record/src/lib/state/mdview.reducer.ts index 7e9be2eccd..e09622e089 100644 --- a/libs/feature/record/src/lib/state/mdview.reducer.ts +++ b/libs/feature/record/src/lib/state/mdview.reducer.ts @@ -82,7 +82,6 @@ const metadataViewReducer = createReducer( */ on(MetadataViewActions.loadUserFeedbacks, (state) => ({ ...state, - error: null, allUserFeedbacksLoading: true, })), on(MetadataViewActions.addUserFeedback, (state) => ({ @@ -93,7 +92,6 @@ const metadataViewReducer = createReducer( MetadataViewActions.loadUserFeedbacksSuccess, (state, { userFeedbacks }) => ({ ...state, - error: null, userFeedbacks: userFeedbacks, addUserFeedbackLoading: false, allUserFeedbacksLoading: false,