From b46131eb6a06feafdff9a7dffaa0000b2a727d76 Mon Sep 17 00:00:00 2001 From: Jan Cortiel Date: Thu, 12 Dec 2024 14:26:53 +0100 Subject: [PATCH] #418: Remove export calendar functionality from studies module The `exportStudyCalendar` function and related UI elements were removed from the codebase. This cleanup eliminates unused functionality, simplifying the component logic and reducing clutter in the studies module. --- src/components/StudyList.vue | 17 ----------------- src/stores/studyStore.ts | 8 +++----- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/components/StudyList.vue b/src/components/StudyList.vue index 92106ae..e51dd93 100644 --- a/src/components/StudyList.vue +++ b/src/components/StudyList.vue @@ -165,16 +165,6 @@ Licensed under the Elastic License 2.0. */ visible: (study: Study) => !!study.userRoles?.some((r: any) => [StudyRole.Admin].includes(r)), }, - { - id: 'exportCalendar', - label: t('study.studyList.labels.exportStudyCalendar'), - icon: 'pi pi-calendar', - tooltip: t('study.studyList.labels.exportStudyCalendar'), - visible: (study: Study) => - !!study.userRoles?.some((r: any) => - [StudyRole.Admin, StudyRole.Operator].includes(r), - ), - }, ]; const endRowActions: MoreTableAction[] = [ @@ -215,9 +205,6 @@ Licensed under the Elastic License 2.0. */ case 'exportData': onExportStudyData(row.studyId as number); break; - case 'exportCalendar': - onExportStudyCalendar(row.studyId as number); - break; case 'copyId': onCopyId(row.studyId, row.title); break; @@ -277,10 +264,6 @@ Licensed under the Elastic License 2.0. */ studyStore.exportStudyData({ studyId } as DownloadData); } - function onExportStudyCalendar(studyId: number): void { - studyStore.exportStudyCalendar(studyId); - } - function onImportStudy(event: FileUploadUploaderEvent): void { const file: File = Array.isArray(event.files) ? event.files[0] diff --git a/src/stores/studyStore.ts b/src/stores/studyStore.ts index 5ee4b87..7900f65 100644 --- a/src/stores/studyStore.ts +++ b/src/stores/studyStore.ts @@ -36,6 +36,7 @@ export const useStudyStore = defineStore('study', () => { return study.value; }); } + async function updateStudy(studyResponse: Study): Promise { if (study.value.studyId) { study.value = await studiesApi @@ -95,6 +96,7 @@ export const useStudyStore = defineStore('study', () => { ); } } + async function listStudies(): Promise { studies.value = await studiesApi .listStudies() @@ -104,6 +106,7 @@ export const useStudyStore = defineStore('study', () => { return studies.value; }); } + async function updateStudyInStudies(changedStudy: Study): Promise { const i = studies.value.findIndex( (studyItem) => studyItem.studyId === changedStudy.studyId, @@ -175,10 +178,6 @@ export const useStudyStore = defineStore('study', () => { }); } - function exportStudyCalendar(studyId: number): void { - window.open(`api/v1/studies/${studyId}/calendar.ics`); - } - function downloadJSON(filename: string, file: File): void { const fileJSON = JSON.stringify(file); const link = document.createElement('a'); @@ -217,7 +216,6 @@ export const useStudyStore = defineStore('study', () => { importStudy, exportStudyConfig, exportStudyData, - exportStudyCalendar, studyUserRoles, studyStatus, studyId,