diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/IntegrationsSection/IntegrationsSection.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/IntegrationsSection/IntegrationsSection.tsx deleted file mode 100644 index cf2e0067f..000000000 --- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/IntegrationsSection/IntegrationsSection.tsx +++ /dev/null @@ -1,136 +0,0 @@ -import { faPlus } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; - -import { Button, Checkbox, DeleteActionModal, PageHeader } from "@app/components/v2"; -import { usePopUp, useToggle } from "@app/hooks"; -import { TCloudIntegration, TIntegration } from "@app/hooks/api/types"; - -import { IntegrationsTable } from "./components"; - -type Props = { - environments: Array<{ name: string; slug: string; id: string }>; - integrations?: TIntegration[]; - cloudIntegrations?: TCloudIntegration[]; - isLoading?: boolean; - onIntegrationDelete: ( - integrationId: string, - shouldDeleteIntegrationSecrets: boolean, - cb: () => void - ) => Promise; - workspaceId: string; - onAddIntegration: () => void; -}; - -export const IntegrationsSection = ({ - integrations = [], - environments = [], - isLoading, - onIntegrationDelete, - workspaceId, - onAddIntegration, - cloudIntegrations = [] -}: Props) => { - const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([ - "deleteConfirmation", - "deleteSecretsConfirmation" - ] as const); - - const [shouldDeleteSecrets, setShouldDeleteSecrets] = useToggle(false); - - return ( -
- -
-
-

Active Integrations

- -
- { - setShouldDeleteSecrets.off(); - handlePopUpOpen("deleteConfirmation", integration); - }} - /> -
- handlePopUpToggle("deleteConfirmation", isOpen)} - deleteKey={ - ((popUp?.deleteConfirmation?.data as TIntegration)?.integration === - "azure-app-configuration" && - (popUp?.deleteConfirmation?.data as TIntegration)?.app - ?.split("//")[1] - ?.split(".")[0]) || - (popUp?.deleteConfirmation?.data as TIntegration)?.app || - (popUp?.deleteConfirmation?.data as TIntegration)?.owner || - (popUp?.deleteConfirmation?.data as TIntegration)?.path || - (popUp?.deleteConfirmation?.data as TIntegration)?.integration || - "" - } - onDeleteApproved={async () => { - if (shouldDeleteSecrets) { - handlePopUpOpen("deleteSecretsConfirmation"); - return; - } - - await onIntegrationDelete( - (popUp?.deleteConfirmation.data as TIntegration).id, - false, - () => handlePopUpClose("deleteConfirmation") - ); - }} - > - {(popUp?.deleteConfirmation?.data as TIntegration)?.integration === "github" && ( -
- setShouldDeleteSecrets.toggle()} - > - Delete previously synced secrets from the destination - -
- )} -
- handlePopUpToggle("deleteSecretsConfirmation", isOpen)} - deleteKey="confirm" - onDeleteApproved={async () => { - await onIntegrationDelete( - (popUp?.deleteConfirmation.data as TIntegration).id, - true, - () => { - handlePopUpClose("deleteSecretsConfirmation"); - handlePopUpClose("deleteConfirmation"); - } - ); - }} - /> -
- ); -};