Skip to content

Commit

Permalink
Merge pull request #567 from MORE-Platform/418-remove-calendar-export
Browse files Browse the repository at this point in the history
#418: Remove export calendar functionality from studies module
  • Loading branch information
janoliver20 authored Dec 16, 2024
2 parents 3c063eb + b46131e commit 87ebe7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
17 changes: 0 additions & 17 deletions src/components/StudyList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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]
Expand Down
8 changes: 3 additions & 5 deletions src/stores/studyStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const useStudyStore = defineStore('study', () => {
return study.value;
});
}

async function updateStudy(studyResponse: Study): Promise<void> {
if (study.value.studyId) {
study.value = await studiesApi
Expand Down Expand Up @@ -95,6 +96,7 @@ export const useStudyStore = defineStore('study', () => {
);
}
}

async function listStudies(): Promise<void> {
studies.value = await studiesApi
.listStudies()
Expand All @@ -104,6 +106,7 @@ export const useStudyStore = defineStore('study', () => {
return studies.value;
});
}

async function updateStudyInStudies(changedStudy: Study): Promise<void> {
const i = studies.value.findIndex(
(studyItem) => studyItem.studyId === changedStudy.studyId,
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -217,7 +216,6 @@ export const useStudyStore = defineStore('study', () => {
importStudy,
exportStudyConfig,
exportStudyData,
exportStudyCalendar,
studyUserRoles,
studyStatus,
studyId,
Expand Down

0 comments on commit 87ebe7d

Please sign in to comment.