diff --git a/judgels-client/src/components/ProblemWorksheetCard/Bundle/ProblemSubmissionCard/ProblemSubmissionCard.jsx b/judgels-client/src/components/ProblemWorksheetCard/Bundle/ProblemSubmissionCard/ProblemSubmissionCard.jsx index d1039f6b6..f618682c0 100644 --- a/judgels-client/src/components/ProblemWorksheetCard/Bundle/ProblemSubmissionCard/ProblemSubmissionCard.jsx +++ b/judgels-client/src/components/ProblemWorksheetCard/Bundle/ProblemSubmissionCard/ProblemSubmissionCard.jsx @@ -1,10 +1,13 @@ -import { Callout, Intent } from '@blueprintjs/core'; +import { Button, Callout, Intent } from '@blueprintjs/core'; import { BanCircle } from '@blueprintjs/icons'; -import { ButtonLink } from '../../../ButtonLink/ButtonLink'; import { ContentCard } from '../../../ContentCard/ContentCard'; export function ProblemSubmissionCard({ reasonNotAllowedToSubmit, resultsUrl }) { + const redirectToResultsUrl = () => { + window.location.href = resultsUrl; + }; + const renderSubmissionForm = () => { if (reasonNotAllowedToSubmit) { return ( @@ -14,9 +17,9 @@ export function ProblemSubmissionCard({ reasonNotAllowedToSubmit, resultsUrl }) ); } return ( - + ); }; diff --git a/judgels-client/src/routes/courses/courses/single/chapters/single/problems/single/Bundle/submissions/ChapterProblemSubmissionsPage/ChapterProblemSubmissionsPage.jsx b/judgels-client/src/routes/courses/courses/single/chapters/single/problems/single/Bundle/submissions/ChapterProblemSubmissionsPage/ChapterProblemSubmissionsPage.jsx index 1bbb7ee02..4803394e0 100644 --- a/judgels-client/src/routes/courses/courses/single/chapters/single/problems/single/Bundle/submissions/ChapterProblemSubmissionsPage/ChapterProblemSubmissionsPage.jsx +++ b/judgels-client/src/routes/courses/courses/single/chapters/single/problems/single/Bundle/submissions/ChapterProblemSubmissionsPage/ChapterProblemSubmissionsPage.jsx @@ -7,7 +7,6 @@ import { ButtonLink } from '../../../../../../../../../../../components/ButtonLi import { ContentCard } from '../../../../../../../../../../../components/ContentCard/ContentCard'; import ItemSubmissionUserFilter from '../../../../../../../../../../../components/ItemSubmissionUserFilter/ItemSubmissionUserFilter'; import { LoadingState } from '../../../../../../../../../../../components/LoadingState/LoadingState'; -import { ScrollToTopOnMount } from '../../../../../../../../../../../components/ScrollToTopOnMount/ScrollToTopOnMount'; import { SubmissionDetails } from '../../../../../../../../../../../components/SubmissionDetails/Bundle/SubmissionDetails/SubmissionDetails'; import { selectMaybeUserJid } from '../../../../../../../../../../../modules/session/sessionSelectors'; import { selectStatementLanguage } from '../../../../../../../../../../../modules/webPrefs/webPrefsSelectors'; @@ -56,7 +55,6 @@ class ChapterProblemSubmissionsPage extends Component { return ( -

Results

; } + const resultsUrl = (this.props.location.pathname + '/results').replace('//', '/'); return ( ); }; @@ -82,4 +85,4 @@ const mapDispatchToProps = { onCreateSubmission: problemSetSubmissionActions.createItemSubmission, onGetLatestSubmissions: problemSetSubmissionActions.getLatestSubmissions, }; -export default connect(mapStateToProps, mapDispatchToProps)(ProblemStatementPage); +export default withRouter(connect(mapStateToProps, mapDispatchToProps)(ProblemStatementPage));