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
fix: added empty state
Daniel Hougaard240f558231e2
diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/WorkflowIntegrationTab.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/WorkflowIntegrationTab.tsxindex 1cec10b9ba..c3e2a20f15 100644--- a/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/WorkflowIntegrationTab.tsx+++ b/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/WorkflowIntegrationTab.tsx@@ -1,5 +1,5 @@import { BsMicrosoftTeams, BsSlack } from "react-icons/bs";-import { faPlus } from "@fortawesome/free-solid-svg-icons";+import { faGear, faPlus } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { createNotification } from "@app/components/notifications";@@ -7,6 +7,7 @@ import { OrgPermissionCan } from "@app/components/permissions";import {Button,DeleteActionModal,+ EmptyState,Table,TableContainer,TBody,@@ -16,7 +17,10 @@ import {} from "@app/components/v2";import { OrgPermissionActions, OrgPermissionSubjects, useWorkspace } from "@app/context";import { usePopUp } from "@app/hooks";-import { useDeleteProjectWorkflowIntegration } from "@app/hooks/api";+import {+ useDeleteProjectWorkflowIntegration,+ useGetWorkspaceWorkflowIntegrationConfig+} from "@app/hooks/api";import { WorkflowIntegrationPlatform } from "@app/hooks/api/workflowIntegrations/types";import { AddWorkflowIntegrationModal } from "./components/AddWorkflowIntegrationModal";@@ -44,6 +48,17 @@ export const WorkflowIntegrationTab = () => {] as const);const { currentWorkspace } = useWorkspace();+ const { data: slackConfig, isPending: isSlackConfigLoading } =+ useGetWorkspaceWorkflowIntegrationConfig({+ workspaceId: currentWorkspace?.id ?? "",+ integration: WorkflowIntegrationPlatform.SLACK+ });++ const { data: microsoftTeamsConfig, isPending: isMicrosoftTeamsConfigLoading } =+ useGetWorkspaceWorkflowIntegrationConfig({+ workspaceId: currentWorkspace?.id ?? "",+ integration: WorkflowIntegrationPlatform.MICROSOFT_TEAMS+ });const { mutateAsync: deleteIntegration } = useDeleteProjectWorkflowIntegration();@@ -89,20 +104,37 @@ export const WorkflowIntegrationTab = () => {Connect Infisical to other platforms for notification and workflow integrations.</p><TableContainer>- <Table>- <THead>- <Tr>- <Td>Provider</Td>- <Td>Access Request Notifications Destination</Td>- <Td>Secret Request Notifications Destination</Td>- <Td />- </Tr>- </THead>- <TBody>- <SlackConfigRow handlePopUpOpen={handlePopUpOpen} />- <MicrosoftTeamsConfigRow handlePopUpOpen={handlePopUpOpen} />- </TBody>- </Table>+ {!!slackConfig || !!microsoftTeamsConfig ? (+ <Table>+ <THead>+ <Tr>+ <Td>Provider</Td>+ <Td>Access Request Notifications Destination</Td>+ <Td>Secret Request Notifications Destination</Td>+ <Td />+ </Tr>+ </THead>+ <TBody>+ <SlackConfigRow+ handlePopUpOpen={handlePopUpOpen}+ isSlackConfigLoading={isSlackConfigLoading}+ slackConfig={slackConfig}+ />+ <MicrosoftTeamsConfigRow+ handlePopUpOpen={handlePopUpOpen}+ isMicrosoftTeamsConfigLoading={isMicrosoftTeamsConfigLoading}+ microsoftTeamsConfig={microsoftTeamsConfig}+ />+ </TBody>+ </Table>+ ) : (+ <div className="flex h-full w-full items-center justify-center">+ <EmptyState+ title="No project workflow integrations configured. Add a new workflow integration to get started"+ icon={faGear}+ />+ </div>+ )}</TableContainer><AddWorkflowIntegrationModalisOpen={popUp.addWorkflowIntegration.isOpen}diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/components/MicrosoftTeamsConfigRow.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/components/MicrosoftTeamsConfigRow.tsxindex f341b67c9b..ad846d2b8e 100644--- a/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/components/MicrosoftTeamsConfigRow.tsx+++ b/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/components/MicrosoftTeamsConfigRow.tsx@@ -15,15 +15,17 @@ import {Td,Tr} from "@app/components/v2";-import { OrgPermissionActions, OrgPermissionSubjects, useWorkspace } from "@app/context";+import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";+import { useGetMicrosoftTeamsIntegrationTeams } from "@app/hooks/api";import {- useGetMicrosoftTeamsIntegrationTeams,- useGetWorkspaceWorkflowIntegrationConfig-} from "@app/hooks/api";-import { WorkflowIntegrationPlatform } from "@app/hooks/api/workflowIntegrations/types";+ ProjectWorkflowIntegrationConfig,+ WorkflowIntegrationPlatform+} from "@app/hooks/api/workflowIntegrations/types";import { UsePopUpState } from "@app/hooks/usePopUp";type Props = {+ microsoftTeamsConfig?: ProjectWorkflowIntegrationConfig;+ isMicrosoftTeamsConfigLoading: boolean;handlePopUpOpen: (popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,data?: {@@ -33,14 +35,11 @@ type Props = {) => void;};-export const MicrosoftTeamsConfigRow = ({ handlePopUpOpen }: Props) => {- const { currentWorkspace } = useWorkspace();- const { data: microsoftTeamsConfig, isPending: isMicrosoftTeamsConfigLoading } =- useGetWorkspaceWorkflowIntegrationConfig({- workspaceId: currentWorkspace?.id ?? "",- integration: WorkflowIntegrationPlatform.MICROSOFT_TEAMS- });-+export const MicrosoftTeamsConfigRow = ({+ handlePopUpOpen,+ isMicrosoftTeamsConfigLoading,+ microsoftTeamsConfig+}: Props) => {const { data: microsoftTeamsChannels, isPending: isMicrosoftTeamsChannelsLoading } =useGetMicrosoftTeamsIntegrationTeams(microsoftTeamsConfig?.integrationId);const microsoftTeamsChannelIdToName = Object.fromEntries(diff --git a/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/components/SlackConfigRow.tsx b/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/components/SlackConfigRow.tsxindex d711769275..0993ef6aca 100644--- a/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/components/SlackConfigRow.tsx+++ b/frontend/src/pages/secret-manager/SettingsPage/components/WorkflowIntegrationSection/components/SlackConfigRow.tsx@@ -15,15 +15,17 @@ import {Td,Tr} from "@app/components/v2";-import { OrgPermissionActions, OrgPermissionSubjects, useWorkspace } from "@app/context";+import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";+import { useGetSlackIntegrationChannels } from "@app/hooks/api";import {- useGetSlackIntegrationChannels,- useGetWorkspaceWorkflowIntegrationConfig-} from "@app/hooks/api";-import { WorkflowIntegrationPlatform } from "@app/hooks/api/workflowIntegrations/types";+ ProjectWorkflowIntegrationConfig,+ WorkflowIntegrationPlatform+} from "@app/hooks/api/workflowIntegrations/types";import { UsePopUpState } from "@app/hooks/usePopUp";type Props = {+ slackConfig?: ProjectWorkflowIntegrationConfig;+ isSlackConfigLoading: boolean;handlePopUpOpen: (popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,data?: {@@ -33,14 +35,7 @@ type Props = {) => void;};-export const SlackConfigRow = ({ handlePopUpOpen }: Props) => {- const { currentWorkspace } = useWorkspace();- const { data: slackConfig, isPending: isSlackConfigLoading } =- useGetWorkspaceWorkflowIntegrationConfig({- workspaceId: currentWorkspace?.id ?? "",- integration: WorkflowIntegrationPlatform.SLACK- });-+export const SlackConfigRow = ({ handlePopUpOpen, isSlackConfigLoading, slackConfig }: Props) => {const { data: slackChannels, isPending: isSlackChannelsLoading } = useGetSlackIntegrationChannels(slackConfig?.integrationId);