From 34843ef62c8f9b73c7a03b86e6401b3584ccf4ff Mon Sep 17 00:00:00 2001 From: Abdi Abdulle Date: Wed, 27 Aug 2025 14:33:27 +0200 Subject: [PATCH 1/6] removed duplicate logbook endpoint calls --- .../logbooks/logbooks-dashboard/logbooks-dashboard.component.ts | 1 - src/app/state-management/effects/logbooks.effects.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/app/logbooks/logbooks-dashboard/logbooks-dashboard.component.ts b/src/app/logbooks/logbooks-dashboard/logbooks-dashboard.component.ts index daaec4455..30bf7e942 100644 --- a/src/app/logbooks/logbooks-dashboard/logbooks-dashboard.component.ts +++ b/src/app/logbooks/logbooks-dashboard/logbooks-dashboard.component.ts @@ -125,7 +125,6 @@ export class LogbooksDashboardComponent this.store.select(selectCurrentDataset).subscribe((dataset) => { if (dataset) { this.dataset = dataset; - this.store.dispatch(fetchDatasetLogbookAction({ pid: dataset.pid })); this.ownershipService.checkDatasetAccess( dataset, this.store, diff --git a/src/app/state-management/effects/logbooks.effects.ts b/src/app/state-management/effects/logbooks.effects.ts index 7296551fc..09850143a 100644 --- a/src/app/state-management/effects/logbooks.effects.ts +++ b/src/app/state-management/effects/logbooks.effects.ts @@ -65,7 +65,6 @@ export class LogbookEffects { timeout(3000), mergeMap((logbook) => [ fromActions.fetchLogbookCompleteAction({ logbook }), - fromActions.fetchCountAction({ pid }), ]), catchError(() => of(fromActions.fetchDatasetLogbookFailedAction())), ), From 4e5a45fa8f8a2db63e15c059d2c3b9e37d697f84 Mon Sep 17 00:00:00 2001 From: Abdi Abdulle Date: Wed, 27 Aug 2025 15:39:23 +0200 Subject: [PATCH 2/6] changed which call to trigger and kept the fetchCountAction, so now 2 calls are being made --- .../dataset-details-dashboard.component.ts | 23 ++++--------------- .../logbooks-dashboard.component.ts | 1 + .../effects/logbooks.effects.ts | 1 + 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts index ecab268ee..36d099983 100644 --- a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts +++ b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts @@ -238,24 +238,11 @@ export class DatasetDetailsDashboardComponent fetchDataForTab(tab: string) { if (tab in this.fetchDataActions) { const args: { [key: string]: any } = { pid: this.dataset?.pid }; - // load related data for selected tab - switch (tab) { - case TAB.details: - { - const { action, loaded } = this.fetchDataActions[TAB.attachments]; - if (!loaded) { - this.store.dispatch(action(args)); - this.fetchDataActions[TAB.attachments].loaded = true; - } - } - break; - default: { - const { action, loaded } = this.fetchDataActions[tab]; - if (!loaded) { - this.fetchDataActions[tab].loaded = true; - this.store.dispatch(action(args)); - } - } + // load related data for tab.details + const { action, loaded } = this.fetchDataActions[TAB.attachments]; + if (!loaded) { + this.store.dispatch(action(args)); + this.fetchDataActions[TAB.attachments].loaded = true; } } } diff --git a/src/app/logbooks/logbooks-dashboard/logbooks-dashboard.component.ts b/src/app/logbooks/logbooks-dashboard/logbooks-dashboard.component.ts index 30bf7e942..daaec4455 100644 --- a/src/app/logbooks/logbooks-dashboard/logbooks-dashboard.component.ts +++ b/src/app/logbooks/logbooks-dashboard/logbooks-dashboard.component.ts @@ -125,6 +125,7 @@ export class LogbooksDashboardComponent this.store.select(selectCurrentDataset).subscribe((dataset) => { if (dataset) { this.dataset = dataset; + this.store.dispatch(fetchDatasetLogbookAction({ pid: dataset.pid })); this.ownershipService.checkDatasetAccess( dataset, this.store, diff --git a/src/app/state-management/effects/logbooks.effects.ts b/src/app/state-management/effects/logbooks.effects.ts index 09850143a..7296551fc 100644 --- a/src/app/state-management/effects/logbooks.effects.ts +++ b/src/app/state-management/effects/logbooks.effects.ts @@ -65,6 +65,7 @@ export class LogbookEffects { timeout(3000), mergeMap((logbook) => [ fromActions.fetchLogbookCompleteAction({ logbook }), + fromActions.fetchCountAction({ pid }), ]), catchError(() => of(fromActions.fetchDatasetLogbookFailedAction())), ), From dede70ffd845e3dbe0eb40666187e3770e4549cc Mon Sep 17 00:00:00 2001 From: Abdi Abdulle Date: Wed, 27 Aug 2025 16:06:42 +0200 Subject: [PATCH 3/6] WIP: fixing some e2e tests --- .../dataset-details-dashboard.component.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts index 36d099983..f15b68c57 100644 --- a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts +++ b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts @@ -238,11 +238,17 @@ export class DatasetDetailsDashboardComponent fetchDataForTab(tab: string) { if (tab in this.fetchDataActions) { const args: { [key: string]: any } = { pid: this.dataset?.pid }; - // load related data for tab.details - const { action, loaded } = this.fetchDataActions[TAB.attachments]; - if (!loaded) { - this.store.dispatch(action(args)); - this.fetchDataActions[TAB.attachments].loaded = true; + // load related data for selected tab + switch (tab) { + case TAB.details: + { + const { action, loaded } = this.fetchDataActions[TAB.attachments]; + if (!loaded) { + this.store.dispatch(action(args)); + this.fetchDataActions[TAB.attachments].loaded = true; + } + } + break; } } } From 3337c2690e8e98cabe48fc4499f1c766874092cf Mon Sep 17 00:00:00 2001 From: Abdi Abdulle Date: Wed, 27 Aug 2025 16:24:40 +0200 Subject: [PATCH 4/6] WIP: reverting all changes to check e2e tests in pipeline --- .../dataset-details-dashboard.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts index f15b68c57..ecab268ee 100644 --- a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts +++ b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts @@ -249,6 +249,13 @@ export class DatasetDetailsDashboardComponent } } break; + default: { + const { action, loaded } = this.fetchDataActions[tab]; + if (!loaded) { + this.fetchDataActions[tab].loaded = true; + this.store.dispatch(action(args)); + } + } } } } From bc7795e7125be090d9615c7723a2fe66265fef0b Mon Sep 17 00:00:00 2001 From: Abdi Abdulle Date: Thu, 28 Aug 2025 13:50:40 +0200 Subject: [PATCH 5/6] removing duplicated api calls --- .../dataset-details-dashboard.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts index ecab268ee..307f1dedf 100644 --- a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts +++ b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts @@ -251,7 +251,7 @@ export class DatasetDetailsDashboardComponent break; default: { const { action, loaded } = this.fetchDataActions[tab]; - if (!loaded) { + if (!loaded && tab !== TAB.logbook) { this.fetchDataActions[tab].loaded = true; this.store.dispatch(action(args)); } From 5a417a03832a0d1c2e8658cee773f5e735124099 Mon Sep 17 00:00:00 2001 From: Abdi Abdulle Date: Fri, 29 Aug 2025 10:58:29 +0200 Subject: [PATCH 6/6] created a new case --- .../dataset-details-dashboard.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts index 307f1dedf..f26f62f12 100644 --- a/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts +++ b/src/app/datasets/dataset-details-dashboard/dataset-details-dashboard.component.ts @@ -249,9 +249,17 @@ export class DatasetDetailsDashboardComponent } } break; + case TAB.logbook: + { + const { loaded } = this.fetchDataActions[TAB.logbook]; + if (!loaded) { + this.fetchDataActions[TAB.logbook].loaded = true; + } + } + break; default: { const { action, loaded } = this.fetchDataActions[tab]; - if (!loaded && tab !== TAB.logbook) { + if (!loaded) { this.fetchDataActions[tab].loaded = true; this.store.dispatch(action(args)); }