Skip to content

Commit a4457e3

Browse files
author
himaniraghav3
committed
Add PM role
1 parent be354e8 commit a4457e3

File tree

1 file changed

+5
-2
lines changed
  • src/apps/copilots/src/pages/copilot-opportunity-list

1 file changed

+5
-2
lines changed

src/apps/copilots/src/pages/copilot-opportunity-list/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ const CopilotOpportunityList: FC<{}> = () => {
9191
const navigate = useNavigate()
9292

9393
const { profile }: ProfileContextData = useContext(profileContext)
94-
const isAdmin: boolean = useMemo(() => !!profile?.roles?.includes(UserRole.tcaAdmin), [profile])
94+
const isAdminOrPM: boolean = useMemo(
95+
() => !!profile?.roles?.some(role => role === UserRole.tcaAdmin || role === UserRole.projectManager),
96+
[profile],
97+
)
9598

9699
const {
97100
data: opportunities, isValidating, size, setSize,
@@ -120,7 +123,7 @@ const CopilotOpportunityList: FC<{}> = () => {
120123
return (
121124
<ContentLayout
122125
title='Copilot Opportunities'
123-
buttonConfig={isAdmin ? addNewRequestButton : undefined}
126+
buttonConfig={isAdminOrPM ? addNewRequestButton : undefined}
124127
>
125128
<PageTitle>Copilot Opportunities</PageTitle>
126129
<Table

0 commit comments

Comments
 (0)