Skip to content

[PROD RELEASE] - Bug fixes #7093

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 7 commits into from
May 13, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ export default class Registrants extends React.Component {
break;
}
case 'Submitted Date': {
const checkpointA = this.getFinal(a);
const checkpointB = this.getFinal(b);
const checkpointA = this.getFinal(a) || this.getSubmissionDate(a);
const checkpointB = this.getFinal(b) || this.getSubmissionDate(b);
if (checkpointA) {
valueA = new Date(checkpointA);
}
Expand Down
13 changes: 11 additions & 2 deletions src/shared/components/challenge-detail/Specification/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,23 @@ export default function ChallengeDetailsView(props) {
metadata,
events,
track,
phases,
} = challenge;

const getScoreCardByPhase = (phaseName) => {

Choose a reason for hiding this comment

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

Consider adding error handling or a default return value in getScoreCardByPhase in case phases is undefined or does not contain the expected structure. This will prevent potential runtime errors.

const phase = phases.find(item => item.name === phaseName);

Choose a reason for hiding this comment

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

The find method will return undefined if no matching phase is found. Ensure that phase is checked before attempting to access phase.constraints to avoid potential errors.

const scoreCardConstraint = phase && phase.constraints && phase.constraints.find(item => item.name === 'Scorecard');

Choose a reason for hiding this comment

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

Consider checking if phase.constraints is an array before calling find on it to prevent runtime errors if constraints is not defined or not an array.

return scoreCardConstraint ? scoreCardConstraint.value : '';
};

const roles = (userDetails || {}).roles || [];
const {
reviewScorecardId,
screeningScorecardId,
forumId,
} = legacy;

const reviewScorecardId = getScoreCardByPhase('Review');
const screeningScorecardId = getScoreCardByPhase('Screening');

let stockArtValue = '';
const allowStockArt = _.find(metadata, { name: 'allowStockArt' });
if (allowStockArt) {
Expand Down Expand Up @@ -421,6 +429,7 @@ ChallengeDetailsView.propTypes = {
}),
metadata: PT.array,
events: PT.arrayOf(PT.string),
phases: PT.arrayOf(PT.any),

Choose a reason for hiding this comment

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

Using PT.any for phases prop type is not specific and can lead to potential issues with type checking. Consider defining a more specific prop type that accurately reflects the expected structure of the phases array.

}),
challengesUrl: PT.string.isRequired,
communitiesList: PT.arrayOf(PT.shape({
Expand Down