Wired most of the frontend to support ghost users

This commit is contained in:
Daniel Hougaard
2024-02-22 05:00:26 +01:00
parent a366dbb16d
commit 4b37b2afba
3 changed files with 39 additions and 53 deletions
+6 -4
View File
@@ -300,12 +300,14 @@ export const AppLayout = ({ children }: LayoutProps) => {
// -> logout + redirect to SAML SSO
await logout.mutateAsync();
window.open(`/api/v1/sso/redirect/saml2/organizations/${org.slug}`);
window.open(
`/api/v1/sso/redirect/saml2/organizations/${org.slug}`
);
window.close();
return;
}
changeOrg(org?.id)
changeOrg(org?.id);
}}
variant="plain"
colorSchema="secondary"
@@ -322,7 +324,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
</div>
</Button>
</DropdownMenuItem>
)
);
})}
{/* <DropdownMenuItem key="add-org">
<Button
@@ -598,7 +600,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
</MenuItem>
</a>
</Link>
{(window.location.origin.includes("https://app.infisical.com")) && (
{window.location.origin.includes("https://app.infisical.com") && (
<Link href={`/org/${currentOrg?.id}/billing`} passHref>
<a>
<MenuItem
@@ -509,7 +509,6 @@ const OrganizationPage = withPermission(
projectName: name
});
/*
if (addMembers) {
const orgUsers = await fetchOrgUsers(currentOrg);
@@ -524,23 +523,6 @@ const OrganizationPage = withPermission(
// eslint-disable-next-line no-promise-executor-return -- We do this because the function returns too fast, which sometimes causes an error when the user is redirected.
await new Promise((resolve) => setTimeout(resolve, 2_000));
const decryptKey = await fetchUserWsKey(newWorkspaceId);
await addWsUser.mutateAsync({
workspaceId: newWorkspaceId,
decryptKey,
userPrivateKey: PRIVATE_KEY,
members: orgUsers
.filter(
({ status, user: orgUser }) => status === "accepted" && user.email !== orgUser.email
)
.map(({ user: orgUser, id: orgMembershipId }) => ({
userPublicKey: orgUser.publicKey,
orgMembershipId
}))
});
}
*/
createNotification({ text: "Workspace created", type: "success" });
handlePopUpClose("addNewWs");
createNotification({ text: "Workspace created", type: "success" });
@@ -135,6 +135,8 @@ export const MemberListTab = () => {
text: "Failed to add user to project, unknown project type",
type: "error"
});
return;
}
createNotification({
text: "Successfully added user to the project",