improvements: ui improvements & add users to org from project member invite modal

This commit is contained in:
Scott Wilson
2025-02-11 16:14:13 -08:00
parent 4e48ab1eeb
commit 4fdfdc1a39
156 changed files with 1059 additions and 314 deletions
@@ -23,7 +23,8 @@ export const useCreateSecretSync = () => {
return data.secretSync;
},
onSuccess: () => queryClient.invalidateQueries({ queryKey: secretSyncKeys.list() })
onSuccess: (_, { projectId }) =>
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list(projectId) })
});
};
@@ -38,8 +39,8 @@ export const useUpdateSecretSync = () => {
return data.secretSync;
},
onSuccess: (_, { syncId, destination }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list() });
onSuccess: (_, { syncId, destination, projectId }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list(projectId) });
queryClient.invalidateQueries({ queryKey: secretSyncKeys.byId(destination, syncId) });
}
});
@@ -55,8 +56,8 @@ export const useDeleteSecretSync = () => {
return data;
},
onSuccess: (_, { syncId, destination }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list() });
onSuccess: (_, { syncId, destination, projectId }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list(projectId) });
queryClient.invalidateQueries({ queryKey: secretSyncKeys.byId(destination, syncId) });
}
});
@@ -72,8 +73,8 @@ export const useTriggerSecretSyncSyncSecrets = () => {
return data;
},
onSuccess: (_, { syncId, destination }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list() });
onSuccess: (_, { syncId, destination, projectId }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list(projectId) });
queryClient.invalidateQueries({ queryKey: secretSyncKeys.byId(destination, syncId) });
}
});
@@ -93,8 +94,8 @@ export const useTriggerSecretSyncImportSecrets = () => {
return data;
},
onSuccess: (_, { syncId, destination }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list() });
onSuccess: (_, { syncId, destination, projectId }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list(projectId) });
queryClient.invalidateQueries({ queryKey: secretSyncKeys.byId(destination, syncId) });
}
});
@@ -110,8 +111,8 @@ export const useTriggerSecretSyncRemoveSecrets = () => {
return data;
},
onSuccess: (_, { syncId, destination }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list() });
onSuccess: (_, { syncId, destination, projectId }) => {
queryClient.invalidateQueries({ queryKey: secretSyncKeys.list(projectId) });
queryClient.invalidateQueries({ queryKey: secretSyncKeys.byId(destination, syncId) });
}
});
+11 -9
View File
@@ -12,7 +12,7 @@ import {
export const secretSyncKeys = {
all: ["secret-sync"] as const,
options: () => [...secretSyncKeys.all, "options"] as const,
list: () => [...secretSyncKeys.all, "list"] as const,
list: (projectId: string) => [...secretSyncKeys.all, "list", projectId] as const,
byId: (destination: SecretSync, syncId: string) =>
[...secretSyncKeys.all, destination, "by-id", syncId] as const
};
@@ -46,6 +46,14 @@ export const useSecretSyncOption = (destination: SecretSync) => {
return { syncOption, isPending };
};
export const fetchSecretSyncsByProjectId = async (projectId: string) => {
const { data } = await apiRequest.get<TListSecretSyncs>("/api/v1/secret-syncs", {
params: { projectId }
});
return data.secretSyncs;
};
export const useListSecretSyncs = (
projectId: string,
options?: Omit<
@@ -54,14 +62,8 @@ export const useListSecretSyncs = (
>
) => {
return useQuery({
queryKey: secretSyncKeys.list(),
queryFn: async () => {
const { data } = await apiRequest.get<TListSecretSyncs>("/api/v1/secret-syncs", {
params: { projectId }
});
return data.secretSyncs;
},
queryKey: secretSyncKeys.list(projectId),
queryFn: () => fetchSecretSyncsByProjectId(projectId),
...options
});
};
@@ -43,26 +43,31 @@ export type TUpdateSecretSyncDTO = Partial<
> & {
destination: SecretSync;
syncId: string;
projectId: string;
};
export type TDeleteSecretSyncDTO = {
destination: SecretSync;
syncId: string;
removeSecrets: boolean;
projectId: string;
};
export type TTriggerSecretSyncSyncSecretsDTO = {
destination: SecretSync;
syncId: string;
projectId: string;
};
export type TTriggerSecretSyncImportSecretsDTO = {
destination: SecretSync;
syncId: string;
importBehavior: SecretSyncImportBehavior;
projectId: string;
};
export type TTriggerSecretSyncRemoveSecretsDTO = {
destination: SecretSync;
syncId: string;
projectId: string;
};
+1 -1
View File
@@ -206,7 +206,7 @@ export const useGetWorkspaceAuthorizations = <TData = IntegrationAuth[],>(
select
});
const fetchWorkspaceIntegrations = async (workspaceId: string) => {
export const fetchWorkspaceIntegrations = async (workspaceId: string) => {
const { data } = await apiRequest.get<{ integrations: TIntegration[] }>(
`/api/v1/workspace/${workspaceId}/integrations`
);