PM-3686 group submissions in challenge details#7177
Conversation
| const finalScoreValue = parseScore(finalScore); | ||
| const submissionMoment = submissionTime ? moment(submissionTime) : null; | ||
|
|
||
| const timeField = isMM ? submissionTime : createdAt; |
There was a problem hiding this comment.
[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.
| </div> | ||
| ) | ||
| } | ||
| <div styleName={`${isMM ? 'col-4' : 'col-3'} col ${isMM ? 'mm' : ''}`}> |
There was a problem hiding this comment.
[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.
| }; | ||
|
|
||
| // For non-MM challenges, use createdAt field for submission date | ||
| const submissionDateField = isMM ? submissionTime : (created || createdAt); |
There was a problem hiding this comment.
[correctness]
The logic for determining submissionDateField uses created || createdAt for non-MM challenges. Ensure that both created and createdAt are consistently populated and correctly represent the submission date to avoid potential discrepancies.
| const memberLinkTarget = `${_.includes(window.origin, 'www') ? '_self' : '_blank'}`; | ||
| const memberForHistory = memberHandle || memberDisplay; | ||
| const latestSubmissionId = submissionId || 'N/A'; | ||
| const latestSubmissionId = latestSubmission.submissionId || latestSubmission.id || 'N/A'; |
There was a problem hiding this comment.
[correctness]
The fallback logic for latestSubmissionId uses latestSubmission.id. Ensure that id is always a valid identifier and not confused with other potential IDs in the system.
| auth={auth} | ||
| isLoggedIn={isLoggedIn} | ||
| submissionId={submissionHistory.submissionId} | ||
| createdAt={submissionHistory.created || submissionHistory.createdAt} |
There was a problem hiding this comment.
[correctness]
The createdAt field is derived from submissionHistory.created || submissionHistory.createdAt. Ensure that both fields are consistently used and correctly represent the intended timestamp to avoid potential data inconsistencies.
| .col-1 { | ||
| padding-left: 30px; | ||
| width: 10%; | ||
| flex: 20; |
There was a problem hiding this comment.
[maintainability]
Changing from width to flex without specifying flex-basis or flex-grow may lead to unexpected layout behavior if the container size changes. Consider specifying flex: 1 1 20%; to maintain similar behavior to the original width: 10%;.
|
|
||
| .col-2 { | ||
| width: 15%; | ||
| flex: 20; |
There was a problem hiding this comment.
[maintainability]
Switching from width to flex without defining flex-basis or flex-grow might cause layout issues. To ensure consistent behavior, consider using flex: 1 1 15%; which aligns with the original width: 15%;.
|
|
||
| .col-3 { | ||
| width: 20.5%; | ||
| flex: 20; |
There was a problem hiding this comment.
[maintainability]
The change from width to flex could alter the layout if the container size changes. To maintain the intended layout, consider using flex: 1 1 20.5%; to match the original width: 20.5%;.
|
|
||
| .col-4 { | ||
| width: 20.5%; | ||
| flex: 20; |
There was a problem hiding this comment.
[maintainability]
Replacing width with flex without specifying flex-basis or flex-grow may lead to layout inconsistencies. Consider using flex: 1 1 20.5%; to preserve the original layout behavior.
|
|
||
| .col-5 { | ||
| width: 22%; | ||
| flex: 20; |
There was a problem hiding this comment.
[maintainability]
Changing from width to flex without defining flex-basis or flex-grow might cause layout issues. To ensure consistent behavior, consider using flex: 1 1 22%; which aligns with the original width: 22%;.
|
|
||
| .col-6 { | ||
| width: 22%; | ||
| flex: 20; |
There was a problem hiding this comment.
[maintainability]
Switching from width to flex without specifying flex-basis or flex-grow may lead to unexpected layout behavior. Consider using flex: 1 1 22%; to maintain similar behavior to the original width: 22%;.
https://topcoder.atlassian.net/browse/PM-3686 - Group Challenge Submissions
Currently, the Submissions tab on the challenge details page displays every submission made by a member as separate entries. This results in an unnecessarily large count of submissions being listed. To improve usability, submissions should be grouped by member, similar to the approach used in Marathon matches.
Each member should appear only once in the Submissions tab. When a user clicks on a member’s record, they should be able to view the complete history of all submissions made by that member.