Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

feat(plg): Invite users on Cody Dashboard#63375

Merged
vdavid merged 3 commits into
mainfrom
dv/cody-invite-on-dashboard
Jun 20, 2024
Merged

feat(plg): Invite users on Cody Dashboard#63375
vdavid merged 3 commits into
mainfrom
dv/cody-invite-on-dashboard

Conversation

@vdavid

@vdavid vdavid commented Jun 20, 2024

Copy link
Copy Markdown
Contributor

Before this PR, you could only invite teammates on the /cody/team/manage page.

Now you can also do it on the Cody Dashboard, like @rrhyne suggested here.

Test plan

Here is a 30-sec Loom demoing the new behavior.

And a screenshot:

CleanShot 2024-06-20 at 11 10 21@2x

@vdavid vdavid requested review from a team and rrhyne June 20, 2024 09:10
@cla-bot cla-bot Bot added the cla-signed label Jun 20, 2024
</PageHeader.Heading>
</PageHeader>

{isAdmin && <InviteUsers telemetryRecorder={telemetryRecorder} />}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

By now we are sure that the subscription summary is successfully loaded and user is admin. We can pass summary as a prop and avoid query status-checking logic in the InviteUsers component.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The user is not always an admin on this page. This page also loads for non-admins.
Also, I tried to make the InviteUsers component independent of the embedding page, allowing that we may not have the subscription summary elsewhere on the page.
The isAdmin check is only there because the InviteUsers component uses the useCurrentSubscription hook, which is fairly expensive, so wanted to make sure that it doesn't load for non-admins.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@vdavid, I mean that InviteUsers component is only rendered for admins and can get subscription summary as prop to avoid dealing with subscription summary query states.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

By now we are sure that the subscription summary is successfully loaded and user is admin

"By now" refers to line 147

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants