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 // -> logout + redirect to SAML SSO
await logout.mutateAsync(); 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(); window.close();
return; return;
} }
changeOrg(org?.id) changeOrg(org?.id);
}} }}
variant="plain" variant="plain"
colorSchema="secondary" colorSchema="secondary"
@@ -322,7 +324,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
</div> </div>
</Button> </Button>
</DropdownMenuItem> </DropdownMenuItem>
) );
})} })}
{/* <DropdownMenuItem key="add-org"> {/* <DropdownMenuItem key="add-org">
<Button <Button
@@ -598,7 +600,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
</MenuItem> </MenuItem>
</a> </a>
</Link> </Link>
{(window.location.origin.includes("https://app.infisical.com")) && ( {window.location.origin.includes("https://app.infisical.com") && (
<Link href={`/org/${currentOrg?.id}/billing`} passHref> <Link href={`/org/${currentOrg?.id}/billing`} passHref>
<a> <a>
<MenuItem <MenuItem
@@ -509,7 +509,6 @@ const OrganizationPage = withPermission(
projectName: name projectName: name
}); });
/*
if (addMembers) { if (addMembers) {
const orgUsers = await fetchOrgUsers(currentOrg); 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. // 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)); 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" }); createNotification({ text: "Workspace created", type: "success" });
handlePopUpClose("addNewWs"); handlePopUpClose("addNewWs");
createNotification({ text: "Workspace created", type: "success" }); createNotification({ text: "Workspace created", type: "success" });
@@ -135,6 +135,8 @@ export const MemberListTab = () => {
text: "Failed to add user to project, unknown project type", text: "Failed to add user to project, unknown project type",
type: "error" type: "error"
}); });
return;
} }
createNotification({ createNotification({
text: "Successfully added user to the project", text: "Successfully added user to the project",