Skip to content

fix(PM-580): show invite button only for active projects #1089

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
May 28, 2025
Merged

Conversation

hentrymartin
Copy link
Collaborator

Related JIRA Ticket:

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

What's in this PR?

  • show invite button only for active projects

@@ -223,9 +223,10 @@ const CopilotOpportunityDetails: FC<{}> = () => {
)
}
{activeTab === CopilotDetailsTabViews.details && <OpportunityDetails opportunity={opportunity} />}
{activeTab === CopilotDetailsTabViews.applications && isAdminOrPM && (
{activeTab === CopilotDetailsTabViews.applications && isAdminOrPM && opportunity && (

Choose a reason for hiding this comment

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

Consider checking if opportunity is not null or undefined before using it in the condition. This ensures that the CopilotApplications component is only rendered when opportunity is valid.

!isInvited && copilotApplication.status === CopilotApplicationStatus.PENDING && (
!isInvited
&& copilotApplication.status === CopilotApplicationStatus.PENDING
&& copilotApplication.opportunityStatus === 'active' && (

Choose a reason for hiding this comment

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

Consider using a constant or enum for the string 'active' to avoid potential typos and to make the code more maintainable.

@hentrymartin hentrymartin merged commit 2bf40eb into dev May 28, 2025
3 checks passed
@hentrymartin hentrymartin deleted the pm-580_1 branch May 28, 2025 11:34
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.

1 participant