Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Update BackfillSecretReferenceSection.tsx
Daniel Hougaard69311f058bcc
diff --git a/frontend/src/views/Settings/ProjectSettingsPage/components/BackfillSecretReferenceSection/BackfillSecretReferenceSection.tsx b/frontend/src/views/Settings/ProjectSettingsPage/components/BackfillSecretReferenceSection/BackfillSecretReferenceSection.tsxindex 91f71f5ebc..6b1da60b32 100644--- a/frontend/src/views/Settings/ProjectSettingsPage/components/BackfillSecretReferenceSection/BackfillSecretReferenceSection.tsx+++ b/frontend/src/views/Settings/ProjectSettingsPage/components/BackfillSecretReferenceSection/BackfillSecretReferenceSection.tsx@@ -5,39 +5,40 @@ import { useBackfillSecretReference } from "@app/hooks/api";import { ProjectMembershipRole } from "@app/hooks/api/roles/types";export const BackfillSecretReferenceSecretion = () => {- const { currentWorkspace } = useWorkspace();- const { membership } = useProjectPermission();- const backfillSecretReferences = useBackfillSecretReference();+ const { currentWorkspace } = useWorkspace();+ const { membership } = useProjectPermission();+ const backfillSecretReferences = useBackfillSecretReference();- if (!currentWorkspace) return null;+ if (!currentWorkspace) return null;- const handleBackfill = async () => {- if (backfillSecretReferences.isLoading) return;- try {- await backfillSecretReferences.mutateAsync({ projectId: currentWorkspace.id || "" });- createNotification({ text: "Successfully re-indexed secret references", type: "success" });- } catch {- createNotification({ text: "Failed to re-index secret references", type: "error" });- }- };+ const handleBackfill = async () => {+ if (backfillSecretReferences.isLoading) return;+ try {+ await backfillSecretReferences.mutateAsync({ projectId: currentWorkspace.id || "" });+ createNotification({ text: "Successfully re-indexed secret references", type: "success" });+ } catch {+ createNotification({ text: "Failed to re-index secret references", type: "error" });+ }+ };- const isAdmin = membership.roles.includes(ProjectMembershipRole.Admin);- return (- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">- <div className="flex w-full items-center justify-between">- <p className="text-xl font-semibold">Index Secret References</p>- </div>- <p className="mb-4 mt-2 max-w-2xl text-sm text-gray-400">- This will index all secret references, enabling integrations to be triggered when their values change going forward.- </p>- <Button- variant="outline_bg"- isLoading={backfillSecretReferences.isLoading}- onClick={handleBackfill}- isDisabled={!isAdmin}- >- Index Secret References- </Button>- </div>- );+ const isAdmin = membership.roles.includes(ProjectMembershipRole.Admin);+ return (+ <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">+ <div className="flex w-full items-center justify-between">+ <p className="text-xl font-semibold">Index Secret References</p>+ </div>+ <p className="mb-4 mt-2 max-w-2xl text-sm text-gray-400">+ This will index all secret references, enabling integrations to be triggered when their+ values change going forward. This happens automatically when secrets are created or updated.+ </p>+ <Button+ variant="outline_bg"+ isLoading={backfillSecretReferences.isLoading}+ onClick={handleBackfill}+ isDisabled={!isAdmin}+ >+ Index Secret References+ </Button>+ </div>+ );};