Skip to content
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

fix: Add permission guard to "Add a new Editor" button #3786

Merged
merged 2 commits into from
Oct 10, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,19 @@ export const MembersTable = ({
</StyledTableRow>
))}
{showAddMemberButton && (
<TableRow>
<TableCell colSpan={5}>
<AddButton
onClick={() => {
addUser();
}}
>
Add a new editor
</AddButton>
</TableCell>
</TableRow>
<Permission.IsPlatformAdmin>
<TableRow>
<TableCell colSpan={5}>
<AddButton
onClick={() => {
addUser();
}}
>
Add a new editor
</AddButton>
</TableCell>
</TableRow>
</Permission.IsPlatformAdmin>
Copy link
Member

Choose a reason for hiding this comment

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

We must have had a bad rebase somewhere because I swear I made this exact change a couple weeks ago ?? 👀

Eg https://github.com/theopensystemslab/planx-new/pull/3713/files#diff-b5928b9d92361e26a33f6c0b9af0253b319eab4128cee43689cce0eb88cc87c5R151

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I thought the exact same thing! I swear we talked about this and fixed it before as well but couldn't find the PR.

Rebase makes sense as the cause of this regression 👍

)}
</TableBody>
</Table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe("when a user is not a platform admin", () => {
useStore.setState({
teamMembers: mockTeamMembersData,
user: mockPlainUser,
teamSlug: "templates",
teamSlug: "trumptonshire",
});
});

Expand Down
Loading