diff --git a/src/commons/assessment/Assessment.tsx b/src/commons/assessment/Assessment.tsx index fc674c05c5..35cbc962d6 100644 --- a/src/commons/assessment/Assessment.tsx +++ b/src/commons/assessment/Assessment.tsx @@ -1,5 +1,5 @@ import { - Button, + Button, Collapse, Dialog, DialogBody, @@ -79,7 +79,8 @@ const Assessment: React.FC = () => { const sortAssessments = (assessments: AssessmentOverview[]) => sortBy(assessments, [a => -a.id]); - const makeSubmissionButton = (overview: AssessmentOverview) => ( + +const makeSubmissionButton = (overview: AssessmentOverview) => ( { overview={overview} renderAttemptButton={role !== Role.Student} renderGradingTooltip={false} - makeSubmissionButton={makeSubmissionButton} /> ) ); @@ -178,7 +178,6 @@ const Assessment: React.FC = () => { overview={overview} renderAttemptButton renderGradingTooltip={false} - makeSubmissionButton={makeSubmissionButton} /> )); @@ -193,7 +192,6 @@ const Assessment: React.FC = () => { overview={overview} renderAttemptButton renderGradingTooltip - makeSubmissionButton={makeSubmissionButton} /> )); @@ -228,6 +226,8 @@ const Assessment: React.FC = () => { ); } + + // Define the warning text when finalising submissions const hasBonusXp = (betchaAssessment?.earlySubmissionXp as number) > 0; const warningText = hasBonusXp ? ( diff --git a/src/commons/assessment/AssessmentOverviewCard.tsx b/src/commons/assessment/AssessmentOverviewCard.tsx index 7da503df85..5999a08a8b 100644 --- a/src/commons/assessment/AssessmentOverviewCard.tsx +++ b/src/commons/assessment/AssessmentOverviewCard.tsx @@ -1,8 +1,11 @@ import { Card, Elevation, H4, H6, Icon, Intent, Position, Text, Tooltip } from '@blueprintjs/core'; import { IconName, IconNames } from '@blueprintjs/icons'; import classNames from 'classnames'; + +import classes from 'src/styles/Academy.module.scss'; import { JSX } from 'react'; + import defaultCoverImage from '../../assets/default_cover_image.jpg'; import Markdown from '../Markdown'; import NotificationBadge from '../notificationBadge/NotificationBadge'; @@ -18,7 +21,6 @@ type AssessmentOverviewCardProps = { /** Will only render the attempt button if true, regardless of attempt status. */ renderAttemptButton: boolean; renderGradingTooltip: boolean; - makeSubmissionButton: (overview: AssessmentOverview) => JSX.Element; }; /** A card to display `AssessmentOverview`s. */ @@ -26,7 +28,6 @@ const AssessmentOverviewCard: React.FC = ({ overview, renderAttemptButton, renderGradingTooltip, - makeSubmissionButton }) => { const { isMobileBreakpoint } = useResponsive(); return ( @@ -48,7 +49,6 @@ const AssessmentOverviewCard: React.FC = ({
@@ -90,13 +90,11 @@ const AssessmentOverviewCard: React.FC = ({ type AssessmentOverviewCardTitleProps = { overview: AssessmentOverview; renderProgressStatus: boolean; - makeSubmissionButton: (overview: AssessmentOverview) => JSX.Element; }; const AssessmentOverviewCardTitle: React.FC = ({ overview, renderProgressStatus, - makeSubmissionButton }) => (
@@ -113,7 +111,6 @@ const AssessmentOverviewCardTitle: React.FC = {renderProgressStatus ? showGradingTooltip(overview.isGradingPublished) : null} -
{makeSubmissionButton(overview)}
); diff --git a/src/commons/assessment/__tests__/__snapshots__/Assessment.test.tsx.snap b/src/commons/assessment/__tests__/__snapshots__/Assessment.test.tsx.snap index 86e431d5f2..629536c599 100644 --- a/src/commons/assessment/__tests__/__snapshots__/Assessment.test.tsx.snap +++ b/src/commons/assessment/__tests__/__snapshots__/Assessment.test.tsx.snap @@ -144,50 +144,6 @@ exports[`Assessment page does not show attempt Button for upcoming assessments f An Odessey to Runes (Duplicate)
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
= props => { ); // Compute this here to avoid re-rendering the button every keystroke + + const persistenceIsDirty = persistenceFile && (!persistenceFile.lastSaved || persistenceFile.lastSaved < lastEdit); const persistenceButtons = useMemo(() => { return ( - dispatch(PersistenceActions.persistenceSaveFileAs())} - onClickOpen={() => dispatch(PersistenceActions.persistenceOpenPicker())} - onClickSave={ - persistenceFile - ? () => dispatch(PersistenceActions.persistenceSaveFile(persistenceFile)) - : undefined - } - onClickLogOut={() => dispatch(SessionActions.logoutGoogle())} - onPopoverOpening={() => dispatch(PersistenceActions.persistenceInitialise())} - /> + null // Google Drive Button used to be here ); }, [isFolderModeEnabled, persistenceFile, persistenceUser, persistenceIsDirty, dispatch]); diff --git a/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap b/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap index 4eb55233a4..363f51986f 100644 --- a/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap +++ b/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap @@ -193,40 +193,6 @@ exports[`Playground tests > Playground renders correctly 1`] = ` - - - - - @@ -1794,40 +1760,6 @@ exports[`Playground tests > Playground with link renders correctly 1`] = ` - - - - -