Skip to content

Conversation

@hentrymartin
Copy link
Collaborator

…ewer

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-3208

What's in this PR?

  • Fix "Add manager comment" button showing to submitters and normal reviewer

@hentrymartin hentrymartin changed the title fix(PM-3208): add manager comment button showing to submitters and normal reviewer hotfix(PM-3208): add manager comment button showing to submitters and normal reviewer Dec 12, 2025
? ownedMemberIds.has(submissionOwnerId)
: false
},
canRespondToAppeals: isAdmin || hasReviewerRole,

Choose a reason for hiding this comment

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

[⚠️ security]
The condition isAdmin || hasReviewerRole is used to determine canRespondToAppeals. Ensure that this logic aligns with the intended access control policy, as it might inadvertently allow more users than intended to respond to appeals.

isAppealsTab: false,
}),
[],
[canRespondToAppeals],

Choose a reason for hiding this comment

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

[⚠️ performance]
The useMemo dependency array now includes canRespondToAppeals, which is correct for ensuring the memoized value updates when canRespondToAppeals changes. However, ensure that canRespondToAppeals is a stable value (e.g., derived from props or state) to prevent unnecessary recalculations.

<Link
className={styles.respondButton}
to={getReviewRoute(submission.id, reviewId)}
to={getReviewRoute(submission.id, reviewId, canRespondToAppeals)}

Choose a reason for hiding this comment

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

[❗❗ correctness]
The getReviewRoute function now receives an additional canRespondToAppeals argument. Ensure that this function is designed to handle this new parameter correctly and that it does not introduce any unintended side effects.

const reviewUrl = getReviewUrl ? getReviewUrl(reviewId) : getReviewRoute(submission.id, reviewId)
const reviewUrl = getReviewUrl
? getReviewUrl(reviewId)
: getReviewRoute(submission.id, reviewId, canRespondToAppeals)

Choose a reason for hiding this comment

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

[❗❗ correctness]
The getReviewRoute function now takes an additional canRespondToAppeals parameter. Ensure that this function can handle the new parameter correctly and that it doesn't introduce any unintended side effects or errors.

const reviewUrl = getReviewUrl ? getReviewUrl(reviewId) : getReviewRoute(submission.id, reviewId)
const reviewUrl = getReviewUrl
? getReviewUrl(reviewId)
: getReviewRoute(submission.id, reviewId, canRespondToAppeals)

Choose a reason for hiding this comment

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

[❗❗ correctness]
The getReviewRoute function now takes an additional canRespondToAppeals parameter. Ensure that this function can handle the new parameter correctly and that it doesn't introduce any unintended side effects or errors.

addRespondToAppeals?: boolean,
currentPathname?: string,
): string {
console.log('getReviewRoute called with:', addRespondToAppeals)

Choose a reason for hiding this comment

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

[⚠️ maintainability]
Remove the console.log statement. Debugging logs should not be present in production code as they can clutter the console and potentially leak sensitive information.

@kkartunov kkartunov merged commit 2f91e54 into dev Dec 12, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants