-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
@@ -65,6 +65,10 @@ const CopilotOpportunityDetails: FC<{}> = () => { | |||
[profile], | |||
) | |||
const { data: copilotApplications }: { data?: CopilotApplication[] } = useCopilotApplications(opportunityId) | |||
const appliedCopilotApplications = useMemo( |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Related JIRA Ticket:
https://topcoder.atlassian.net/browse/PM-1395
What's in this PR?