Skip to content

fix(PM-1395): Show apply as copilot button for a user who is both admin and copilot #1145

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 2 commits into from
Jul 22, 2025

Conversation

hentrymartin
Copy link
Collaborator

Related JIRA Ticket:

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

What's in this PR?

  • Show apply as copilot button for a user who is both admin and copilot

@@ -65,6 +65,10 @@ const CopilotOpportunityDetails: FC<{}> = () => {
[profile],
)
const { data: copilotApplications }: { data?: CopilotApplication[] } = useCopilotApplications(opportunityId)
const appliedCopilotApplications = useMemo(

Choose a reason for hiding this comment

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

Consider adding a type annotation for appliedCopilotApplications to improve type safety and readability.

@@ -164,17 +168,17 @@ const CopilotOpportunityDetails: FC<{}> = () => {
title='Copilot Opportunity'
buttonConfig={
isCopilot
&& copilotApplications
&& copilotApplications.length === 0
&& appliedCopilotApplications

Choose a reason for hiding this comment

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

The variable appliedCopilotApplications is used here, but it is not clear from the diff if it has been defined or initialized correctly. Ensure that appliedCopilotApplications is properly defined and initialized before this usage.

&& opportunity?.status === 'active'
&& opportunity?.canApplyAsCopilot ? applyCopilotOpportunityButton : undefined
}
secondaryButtonConfig={
opportunity?.status === 'active'
&& isAdminOrPM ? cancelCopilotOpportunityButton : undefined
}
infoComponent={(isCopilot && !(copilotApplications
&& copilotApplications.length === 0
infoComponent={(isCopilot && !(appliedCopilotApplications

Choose a reason for hiding this comment

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

The variable appliedCopilotApplications is used here, but it is not clear if it has been defined or initialized elsewhere in the code. Ensure that appliedCopilotApplications is properly defined and initialized before this usage.

@hentrymartin hentrymartin requested a review from kkartunov July 22, 2025 15:13
Copy link
Collaborator

@kkartunov kkartunov left a comment

Choose a reason for hiding this comment

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

Looks good.

@hentrymartin hentrymartin merged commit 2ead2c1 into dev Jul 22, 2025
3 checks passed
@hentrymartin hentrymartin deleted the pm-1395 branch July 22, 2025 18:01
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.

2 participants