Skip to content

fix(PM-1273): remove members from copilot response and use canApplyAsCopilot #1114

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 1 commit into from
Jun 19, 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
2 changes: 1 addition & 1 deletion src/apps/copilots/src/models/CopilotOpportunity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export interface CopilotOpportunity {
startDate: Date,
tzRestrictions: 'yes' | 'no',
createdAt: Date,
members: Array<number>,
canApplyAsCopilot: boolean,
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ const CopilotOpportunityDetails: FC<{}> = () => {
}

const application = copilotApplications && copilotApplications[0]
const isAlreadyMemberOfTheProject = profile && opportunity?.members?.includes(profile.userId)

return (
<ContentLayout
Expand All @@ -135,7 +134,7 @@ const CopilotOpportunityDetails: FC<{}> = () => {
&& copilotApplications
&& copilotApplications.length === 0
&& opportunity?.status === 'active'
&& !isAlreadyMemberOfTheProject ? applyCopilotOpportunityButton : undefined
&& opportunity?.canApplyAsCopilot ? applyCopilotOpportunityButton : undefined

Choose a reason for hiding this comment

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

Consider checking if opportunity?.canApplyAsCopilot is explicitly false to ensure that the button is not rendered when it should not be. This can help avoid potential issues if canApplyAsCopilot is undefined or null.

}
infoComponent={(isCopilot && !(copilotApplications
&& copilotApplications.length === 0
Expand Down