Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#418: Remove export calendar functionality from studies module #567

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`);
janoliver20 marked this conversation as resolved.
Show resolved Hide resolved
}

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
Loading