Skip to content

fix(submission-management): missing Add Submission button #4854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import React from 'react';
import PT from 'prop-types';
import moment from 'moment';
import { PrimaryButton } from 'topcoder-react-ui-kit';
import { phaseEndDate } from 'utils/challenge-listing/helper';
import SubmissionsTable from '../SubmissionsTable';

import style from './styles.scss';
Expand Down Expand Up @@ -47,6 +48,8 @@ export default function SubmissionManagement(props) {
const currentPhase = challenge.phases
.filter(p => p.name !== 'Registration' && p.isOpen)
.sort((a, b) => moment(a.scheduledEndDate).diff(b.scheduledEndDate))[0];
const submissionPhase = challenge.phases.filter(p => p.name === 'Submission')[0];
const submissionEndDate = submissionPhase && phaseEndDate(submissionPhase);

const now = moment();
const end = moment(currentPhase.scheduledEndDate);
Expand Down Expand Up @@ -159,7 +162,7 @@ export default function SubmissionManagement(props) {
)
}
</div>
{now.isBefore(challenge.submissionEndDate) && (
{now.isBefore(submissionEndDate) && (
<div styleName="btn-wrap">
<PrimaryButton
theme={{
Expand Down