feat: export/import functionality (backup/restore/share with friends) + a new input component (#433)

* feat: export schedule function to be added to handler

* feat: use UserScheduleStore and return json

* feat: download functionality

* feat: oh wow we already have a blob download util that is very very nice

* feat: return empty json if none found

* feat: import function completion

* feat: file uploading done

* feat: new input component-stories made-settings input replaced with component

* feat: attempt 1 to hook settings.tsx to importSchedule

* feat: it works horray aka using right Course constructor it works

* chore: fix jsdoc

* chore: comments and debug style

* docs: extra comment

* feat: name of schedule more user friendly

* feat: reworked how schedule is passed and check for file being schedule

* feat: color is kept on import

* fix: add sendResponse to exportSchedule

---------

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
This commit is contained in:
2024-11-21 12:55:48 -06:00
committed by GitHub
parent 8b922082a7
commit 7dbffc6eef
8 changed files with 329 additions and 2 deletions

View File

@@ -63,4 +63,12 @@ export interface UserScheduleMessages {
* @returns Undefined if successful, otherwise an error message
*/
renameSchedule: (data: { scheduleId: string; newName: string }) => string | undefined;
/**
* Exports the current schedule to a JSON file for backing up and sharing
*
* @param data - Id of schedule that will be exported
* @returns
*/
exportSchedule: (data: { scheduleId: string }) => string | undefined;
}