Loading analyst/src/components/utilities.ts +1 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ export const DUMMY_EXERCISE: Exercise = { name: '', instructors: [], createdBy: null, exerciseFinish: new Date(0).toUTCString(), timestampCreated: '', config: { id: '0', Loading codegen/package.json +1 −1 Original line number Diff line number Diff line { "name": "@inject/codegen", "version": "3.10.0", "version": "3.11.0", "description": "GraphQL API Codegen Setup for the Inject Backend", "main": "index.js", "license": "MIT", Loading frontend/package.json +1 −1 Original line number Diff line number Diff line { "name": "@inject/frontend", "version": "3.10.0", "version": "3.11.0", "description": "Main wrapper for rendering INJECT Frontend", "main": "index.js", "license": "MIT", Loading frontend/src/components/DefinitionList/DefinitionButtons.tsx +7 −4 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import { DeleteDefinition, useTypedMutation } from '@inject/graphql' import { LinkButton } from '@inject/shared' import type { FC } from 'react' import { useState } from 'react' import DeleteAlert from '../../exercisepanel/DeleteAlert' import ConfirmAlert from '../../exercisepanel/ConfirmAlert' import { DefinitionAssignmentRoute } from '../../routes/_navbar/exercise-panel/definition.$definitionId' import InfoButton from './InfoButton' Loading Loading @@ -53,10 +53,13 @@ const DefinitionButtons: FC<DefinitionButtonsProps> = ({ definition }) => { <InfoButton definition={definition} /> </ButtonGroup> <DeleteAlert <ConfirmAlert icon='trash' confirmButtonText='Delete' intent='danger' open={alertOpen} setOpen={setAlertOpen} onDelete={() => onConfirm={() => deleteDefinition({ definitionId, }) Loading @@ -69,7 +72,7 @@ const DefinitionButtons: FC<DefinitionButtonsProps> = ({ definition }) => { All exercises created from the selected definition will be deleted! </b> </p> </DeleteAlert> </ConfirmAlert> </> ) } Loading frontend/src/components/ExerciseList/ExerciseButtons.tsx +48 −8 Original line number Diff line number Diff line Loading @@ -4,17 +4,18 @@ import { css } from '@emotion/css' import type { Exercise, VariablesOf } from '@inject/graphql' import { DeleteExercise, FinishExercise, StartExercise, StopExercise, useClient, useTypedMutation, } from '@inject/graphql' import { LinkButton } from '@inject/shared' import type { NavigateOptions } from '@tanstack/react-router' import { useEventListener } from 'ahooks' import { useMemo, useState, type FC } from 'react' import type { ExerciseLoadingPayload } from '../../events' import DeleteAlert from '../../exercisepanel/DeleteAlert' import StartAlert from '../../exercisepanel/StartAlert' import ConfirmAlert from '../../exercisepanel/ConfirmAlert' import DownloadLogsButton from './DownloadLogsButton' import InfoButton from './InfoButton' Loading Loading @@ -132,6 +133,7 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ }) => { const [alertOpen, setAlertOpen] = useState(false) const [startAlertOpen, setStartAlertOpen] = useState(false) const [finishAlertOpen, setFinishAlertOpen] = useState(false) const intent: Intent | undefined = useMemo(() => { if (exercise.running) return 'success' Loading @@ -142,6 +144,9 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ const client = useClient() const loading = useLoadingState() const [{ fetching: finishLoading }, finishExercise] = useTypedMutation(FinishExercise) return ( <ButtonGroup className={buttonGroup} alignText='left'> {type === 'selecting' ? ( Loading @@ -168,10 +173,13 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ title={exercise.exerciseStart ? 'Resume' : 'Start'} /> {!exercise.exerciseStart && ( <StartAlert <ConfirmAlert open={startAlertOpen} setOpen={setStartAlertOpen} onSubmit={() => start(client, exercise.id, 'start')} confirmButtonText='Start' icon='warning-sign' intent='warning' onConfirm={() => start(client, exercise.id, 'start')} loading={loading} > <p>Are you sure you want to start this exercise? </p> Loading @@ -179,7 +187,7 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ The exercise will take: <br /> <b>{convertMinutes(exercise.config.exerciseDuration)}</b> </p> </StartAlert> </ConfirmAlert> )} </> )} Loading @@ -192,6 +200,15 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ title='Pause' /> )} {!exercise.finished && exercise.exerciseStart && ( <Button intent={intent} icon='stop' onClick={() => setFinishAlertOpen(true)} title='Finish' active={alertOpen} /> )} <LinkButton link={assignmentLink} button={{ Loading @@ -200,6 +217,7 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ intent, }} /> <Button intent={intent} icon='trash' Loading @@ -211,17 +229,39 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ active={alertOpen} /> {type === 'managing' && ( <DeleteAlert <ConfirmAlert icon='trash' confirmButtonText='Delete' intent='danger' open={alertOpen} setOpen={setAlertOpen} onDelete={() => start(client, exercise.id, 'delete')} onConfirm={() => start(client, exercise.id, 'delete')} loading={loading} > <p> Are you sure you want to delete the selected exercise? This action is irreversible. </p> </DeleteAlert> </ConfirmAlert> )} {type === 'managing' && ( <ConfirmAlert icon='warning-sign' confirmButtonText='Finish' intent='warning' open={finishAlertOpen} setOpen={setFinishAlertOpen} onConfirm={() => { finishExercise({ exerciseId: exercise.id }) setFinishAlertOpen(false) }} loading={finishLoading} > <p> Are you sure you want to finish the selected exercise? This action is irreversible. </p> </ConfirmAlert> )} <DownloadLogsButton exerciseId={exercise.id} Loading Loading
analyst/src/components/utilities.ts +1 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ export const DUMMY_EXERCISE: Exercise = { name: '', instructors: [], createdBy: null, exerciseFinish: new Date(0).toUTCString(), timestampCreated: '', config: { id: '0', Loading
codegen/package.json +1 −1 Original line number Diff line number Diff line { "name": "@inject/codegen", "version": "3.10.0", "version": "3.11.0", "description": "GraphQL API Codegen Setup for the Inject Backend", "main": "index.js", "license": "MIT", Loading
frontend/package.json +1 −1 Original line number Diff line number Diff line { "name": "@inject/frontend", "version": "3.10.0", "version": "3.11.0", "description": "Main wrapper for rendering INJECT Frontend", "main": "index.js", "license": "MIT", Loading
frontend/src/components/DefinitionList/DefinitionButtons.tsx +7 −4 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import { DeleteDefinition, useTypedMutation } from '@inject/graphql' import { LinkButton } from '@inject/shared' import type { FC } from 'react' import { useState } from 'react' import DeleteAlert from '../../exercisepanel/DeleteAlert' import ConfirmAlert from '../../exercisepanel/ConfirmAlert' import { DefinitionAssignmentRoute } from '../../routes/_navbar/exercise-panel/definition.$definitionId' import InfoButton from './InfoButton' Loading Loading @@ -53,10 +53,13 @@ const DefinitionButtons: FC<DefinitionButtonsProps> = ({ definition }) => { <InfoButton definition={definition} /> </ButtonGroup> <DeleteAlert <ConfirmAlert icon='trash' confirmButtonText='Delete' intent='danger' open={alertOpen} setOpen={setAlertOpen} onDelete={() => onConfirm={() => deleteDefinition({ definitionId, }) Loading @@ -69,7 +72,7 @@ const DefinitionButtons: FC<DefinitionButtonsProps> = ({ definition }) => { All exercises created from the selected definition will be deleted! </b> </p> </DeleteAlert> </ConfirmAlert> </> ) } Loading
frontend/src/components/ExerciseList/ExerciseButtons.tsx +48 −8 Original line number Diff line number Diff line Loading @@ -4,17 +4,18 @@ import { css } from '@emotion/css' import type { Exercise, VariablesOf } from '@inject/graphql' import { DeleteExercise, FinishExercise, StartExercise, StopExercise, useClient, useTypedMutation, } from '@inject/graphql' import { LinkButton } from '@inject/shared' import type { NavigateOptions } from '@tanstack/react-router' import { useEventListener } from 'ahooks' import { useMemo, useState, type FC } from 'react' import type { ExerciseLoadingPayload } from '../../events' import DeleteAlert from '../../exercisepanel/DeleteAlert' import StartAlert from '../../exercisepanel/StartAlert' import ConfirmAlert from '../../exercisepanel/ConfirmAlert' import DownloadLogsButton from './DownloadLogsButton' import InfoButton from './InfoButton' Loading Loading @@ -132,6 +133,7 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ }) => { const [alertOpen, setAlertOpen] = useState(false) const [startAlertOpen, setStartAlertOpen] = useState(false) const [finishAlertOpen, setFinishAlertOpen] = useState(false) const intent: Intent | undefined = useMemo(() => { if (exercise.running) return 'success' Loading @@ -142,6 +144,9 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ const client = useClient() const loading = useLoadingState() const [{ fetching: finishLoading }, finishExercise] = useTypedMutation(FinishExercise) return ( <ButtonGroup className={buttonGroup} alignText='left'> {type === 'selecting' ? ( Loading @@ -168,10 +173,13 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ title={exercise.exerciseStart ? 'Resume' : 'Start'} /> {!exercise.exerciseStart && ( <StartAlert <ConfirmAlert open={startAlertOpen} setOpen={setStartAlertOpen} onSubmit={() => start(client, exercise.id, 'start')} confirmButtonText='Start' icon='warning-sign' intent='warning' onConfirm={() => start(client, exercise.id, 'start')} loading={loading} > <p>Are you sure you want to start this exercise? </p> Loading @@ -179,7 +187,7 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ The exercise will take: <br /> <b>{convertMinutes(exercise.config.exerciseDuration)}</b> </p> </StartAlert> </ConfirmAlert> )} </> )} Loading @@ -192,6 +200,15 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ title='Pause' /> )} {!exercise.finished && exercise.exerciseStart && ( <Button intent={intent} icon='stop' onClick={() => setFinishAlertOpen(true)} title='Finish' active={alertOpen} /> )} <LinkButton link={assignmentLink} button={{ Loading @@ -200,6 +217,7 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ intent, }} /> <Button intent={intent} icon='trash' Loading @@ -211,17 +229,39 @@ const ExerciseButtons: FC<ExerciseButtonsProps> = ({ active={alertOpen} /> {type === 'managing' && ( <DeleteAlert <ConfirmAlert icon='trash' confirmButtonText='Delete' intent='danger' open={alertOpen} setOpen={setAlertOpen} onDelete={() => start(client, exercise.id, 'delete')} onConfirm={() => start(client, exercise.id, 'delete')} loading={loading} > <p> Are you sure you want to delete the selected exercise? This action is irreversible. </p> </DeleteAlert> </ConfirmAlert> )} {type === 'managing' && ( <ConfirmAlert icon='warning-sign' confirmButtonText='Finish' intent='warning' open={finishAlertOpen} setOpen={setFinishAlertOpen} onConfirm={() => { finishExercise({ exerciseId: exercise.id }) setFinishAlertOpen(false) }} loading={finishLoading} > <p> Are you sure you want to finish the selected exercise? This action is irreversible. </p> </ConfirmAlert> )} <DownloadLogsButton exerciseId={exercise.id} Loading