Skip to content

Commit

Permalink
chore(orgAdmins): Update copy for Non Org Admins on Integration Setti…
Browse files Browse the repository at this point in the history
…ngs page (#10447)
  • Loading branch information
tianrunhe authored Nov 13, 2024
1 parent a77408e commit 33e2589
Showing 1 changed file with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import graphql from 'babel-plugin-relay/macro'
import {Suspense} from 'react'
import {useFragment} from 'react-relay'
import {useHistory} from 'react-router'
import {OrgIntegrations_organization$key} from '../../../../__generated__/OrgIntegrations_organization.graphql'
import {Loader} from '../../../../utils/relay/renderLoader'
import GitLabProviders from './GitLabProviders'
Expand All @@ -22,14 +23,25 @@ const OrgIntegrations = (props: Props) => {
id
role
}
organizationUsers {
edges {
node {
role
}
}
}
}
`,
organizationRef
)

const {viewerOrganizationUser} = organization
const {id: orgId, viewerOrganizationUser, organizationUsers} = organization
const history = useHistory()
const isOrgAdmin = viewerOrganizationUser?.role === 'ORG_ADMIN'

const orgUsers = organizationUsers?.edges.map((edge) => edge.node)
const isAnyOrgAdmins = orgUsers?.some((user) => user.role === 'ORG_ADMIN')

return (
<Suspense fallback={<Loader />}>
<div className='flex w-full flex-wrap'>
Expand All @@ -43,7 +55,29 @@ const OrgIntegrations = (props: Props) => {
See the team integration tab for team-level connections.
</div>
) : (
<div className='text-slate-700'>Only organization admins can manage integrations.</div>
<div className='text-slate-700'>
{`Organization-level integrations are managed by `}
<a
href='https://www.parabol.co/support/roles-on-parabol'
className='font-bold text-sky-500 hover:text-sky-600'
target='_blank'
>
Org Admins
</a>
{`.`}
{isAnyOrgAdmins ? (
<>
{` View yours `}
<button
onClick={() => history.push(`/me/organizations/${orgId}/billing`)}
className='cursor-pointer bg-transparent p-0 font-bold text-sky-500 hover:text-sky-600'
>
here
</button>
{`.`}
</>
) : null}
</div>
)}
<GitLabProviders organizationRef={organization} />
</div>
Expand Down

0 comments on commit 33e2589

Please sign in to comment.