chore: get ready for release (#308)

* chore: get ready for release

* chore: update pnpm-lock.yaml

* chore(docs): update CHANGELOG.md

* chore: fix lint warnings and add notes

---------

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
This commit is contained in:
Razboy20
2024-10-14 22:08:45 -05:00
committed by GitHub
parent d22237d561
commit 2983a0c0fd
19 changed files with 1054 additions and 60 deletions

View File

@@ -39,6 +39,9 @@ function MigrationButtons({ close }: { close: () => void }): JSX.Element {
};
handleMigration();
// This is on purpose
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [processState]);
return (
@@ -81,6 +84,15 @@ function MigrationButtons({ close }: { close: () => void }): JSX.Element {
);
}
/**
* Custom hook that provides a function to show a migration dialog.
*
* The dialog prompts the user to migrate their saved schedules if there are any courses
* available to migrate. If there are no courses to migrate, it informs the user that
* migration has already been completed.
*
* @returns A function that, when called, checks for courses to migrate and shows the appropriate dialog.
*/
export function useMigrationDialog() {
const showDialog = usePrompt();
@@ -114,6 +126,19 @@ export function useMigrationDialog() {
};
}
/**
* MigrationDialog component.
*
* This component is responsible for checking if a migration has already been attempted
* and if there are any courses from UTRPv1 that need to be migrated. If migration is needed,
* it triggers the migration dialog.
*
* @returns An empty fragment.
*
* @remarks
* The component uses the `useMigrationDialog` hook to show the migration dialog and the
* `useEffect` hook to perform the migration check on component mount.
*/
export function MigrationDialog(): JSX.Element {
const showMigrationDialog = useMigrationDialog();
@@ -126,6 +151,9 @@ export function MigrationDialog(): JSX.Element {
};
checkMigration();
// This is on purpose
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// (not actually a useless fragment)