Finish identity page project provisioning/deprovisioning

This commit is contained in:
Tuan Dang
2024-07-10 18:14:34 +07:00
parent ebbccdb857
commit 4dddf764bd
15 changed files with 457 additions and 99 deletions
@@ -9,9 +9,11 @@ import {
IdentityAzureAuth,
IdentityGcpAuth,
IdentityKubernetesAuth,
IdentityMembership,
IdentityMembershipOrg,
IdentityTokenAuth,
IdentityUniversalAuth} from "./types";
IdentityUniversalAuth
} from "./types";
export const identitiesKeys = {
getIdentityById: (identityId: string) => [{ identityId }, "identity"] as const,
@@ -53,7 +55,9 @@ export const useGetIdentityProjectMemberships = (identityId: string) => {
queryFn: async () => {
const {
data: { identityMemberships }
} = await apiRequest.get(`/api/v1/identities/${identityId}/identity-memberships`);
} = await apiRequest.get<{ identityMemberships: IdentityMembership[] }>(
`/api/v1/identities/${identityId}/identity-memberships`
);
return identityMemberships;
}
});
@@ -1,4 +1,5 @@
import { TOrgRole } from "../roles/types";
import { Workspace } from "../workspace/types";
import { IdentityAuthMethod } from "./enums";
export type IdentityTrustedIp = {
@@ -45,6 +46,7 @@ export type IdentityMembershipOrg = {
export type IdentityMembership = {
id: string;
identity: Identity;
project: Pick<Workspace, "id" | "name">;
roles: Array<
{
id: string;