Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ workflows:
branches:
only:
- develop
- PM-3087_virus-scan-fix
- PM-3541_home-points-challenge
- PM-3686_group-submissions-in-challenge-details

- "build-prod":
context: org-global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function SubmissionHistoryRow({
finalScore,
provisionalScore,
submissionTime,
createdAt,
isReviewPhaseComplete,
status,
challengeStatus,
Expand All @@ -42,9 +43,11 @@ export default function SubmissionHistoryRow({
};
const provisionalScoreValue = parseScore(provisionalScore);
const finalScoreValue = parseScore(finalScore);
const submissionMoment = submissionTime ? moment(submissionTime) : null;

const timeField = isMM ? submissionTime : createdAt;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The logic for selecting timeField based on isMM could lead to confusion if the conditions for isMM change in the future. Consider making the logic more explicit or documenting the rationale for this choice to improve maintainability.

const submissionMoment = timeField ? moment(timeField) : null;
const submissionTimeDisplay = submissionMoment
? `${submissionMoment.format('DD MMM YYYY')} ${submissionMoment.format('HH:mm:ss')}`
? submissionMoment.format('MMM DD, YYYY HH:mm')
: 'N/A';
const getInitialReviewResult = () => {
if (status === 'failed') return <FailedSubmissionTooltip />;
Expand Down Expand Up @@ -85,13 +88,17 @@ export default function SubmissionHistoryRow({
{getFinalScore()}
</div>
</div>
<div styleName="col-3 col">
<div styleName="mobile-header">PROVISIONAL SCORE</div>
<div>
{getInitialReviewResult()}
</div>
</div>
<div styleName={`col-4 col ${isMM ? 'mm' : ''}`}>
{
isMM && (
<div styleName="col-3 col">
<div styleName="mobile-header">PROVISIONAL SCORE</div>
<div>
{getInitialReviewResult()}
</div>
</div>
)
}
<div styleName={`${isMM ? 'col-4' : 'col-3'} col ${isMM ? 'mm' : ''}`}>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ maintainability]
The use of template literals for styleName could be prone to errors if the conditions for isMM change. Consider using a more robust method for managing class names, such as a library like classnames, to improve maintainability and readability.

<div styleName="mobile-header">TIME</div>
<div>
{submissionTimeDisplay}
Expand Down Expand Up @@ -134,6 +141,8 @@ SubmissionHistoryRow.defaultProps = {
provisionalScore: null,
isReviewPhaseComplete: false,
isLoggedIn: false,
createdAt: null,
submissionTime: null,
};

SubmissionHistoryRow.propTypes = {
Expand All @@ -154,7 +163,11 @@ SubmissionHistoryRow.propTypes = {
submissionTime: PT.oneOfType([
PT.string,
PT.oneOf([null]),
]).isRequired,
]),
createdAt: PT.oneOfType([
PT.string,
PT.oneOf([null]),
]),
challengeStatus: PT.string.isRequired,
isReviewPhaseComplete: PT.bool,
auth: PT.shape().isRequired,
Expand Down
Loading
Loading