mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 20:27:12 +00:00
fix: added empty state
This commit is contained in:
+48
-16
@@ -1,5 +1,5 @@
|
|||||||
import { BsMicrosoftTeams, BsSlack } from "react-icons/bs";
|
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 { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
|
||||||
import { createNotification } from "@app/components/notifications";
|
import { createNotification } from "@app/components/notifications";
|
||||||
@@ -7,6 +7,7 @@ import { OrgPermissionCan } from "@app/components/permissions";
|
|||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
DeleteActionModal,
|
DeleteActionModal,
|
||||||
|
EmptyState,
|
||||||
Table,
|
Table,
|
||||||
TableContainer,
|
TableContainer,
|
||||||
TBody,
|
TBody,
|
||||||
@@ -16,7 +17,10 @@ import {
|
|||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects, useWorkspace } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects, useWorkspace } from "@app/context";
|
||||||
import { usePopUp } from "@app/hooks";
|
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 { WorkflowIntegrationPlatform } from "@app/hooks/api/workflowIntegrations/types";
|
||||||
|
|
||||||
import { AddWorkflowIntegrationModal } from "./components/AddWorkflowIntegrationModal";
|
import { AddWorkflowIntegrationModal } from "./components/AddWorkflowIntegrationModal";
|
||||||
@@ -44,6 +48,17 @@ export const WorkflowIntegrationTab = () => {
|
|||||||
] as const);
|
] as const);
|
||||||
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
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();
|
const { mutateAsync: deleteIntegration } = useDeleteProjectWorkflowIntegration();
|
||||||
|
|
||||||
@@ -89,20 +104,37 @@ export const WorkflowIntegrationTab = () => {
|
|||||||
Connect Infisical to other platforms for notification and workflow integrations.
|
Connect Infisical to other platforms for notification and workflow integrations.
|
||||||
</p>
|
</p>
|
||||||
<TableContainer>
|
<TableContainer>
|
||||||
<Table>
|
{!!slackConfig || !!microsoftTeamsConfig ? (
|
||||||
<THead>
|
<Table>
|
||||||
<Tr>
|
<THead>
|
||||||
<Td>Provider</Td>
|
<Tr>
|
||||||
<Td>Access Request Notifications Destination</Td>
|
<Td>Provider</Td>
|
||||||
<Td>Secret Request Notifications Destination</Td>
|
<Td>Access Request Notifications Destination</Td>
|
||||||
<Td />
|
<Td>Secret Request Notifications Destination</Td>
|
||||||
</Tr>
|
<Td />
|
||||||
</THead>
|
</Tr>
|
||||||
<TBody>
|
</THead>
|
||||||
<SlackConfigRow handlePopUpOpen={handlePopUpOpen} />
|
<TBody>
|
||||||
<MicrosoftTeamsConfigRow handlePopUpOpen={handlePopUpOpen} />
|
<SlackConfigRow
|
||||||
</TBody>
|
handlePopUpOpen={handlePopUpOpen}
|
||||||
</Table>
|
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>
|
</TableContainer>
|
||||||
<AddWorkflowIntegrationModal
|
<AddWorkflowIntegrationModal
|
||||||
isOpen={popUp.addWorkflowIntegration.isOpen}
|
isOpen={popUp.addWorkflowIntegration.isOpen}
|
||||||
|
|||||||
+12
-13
@@ -15,15 +15,17 @@ import {
|
|||||||
Td,
|
Td,
|
||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects, useWorkspace } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
||||||
|
import { useGetMicrosoftTeamsIntegrationTeams } from "@app/hooks/api";
|
||||||
import {
|
import {
|
||||||
useGetMicrosoftTeamsIntegrationTeams,
|
ProjectWorkflowIntegrationConfig,
|
||||||
useGetWorkspaceWorkflowIntegrationConfig
|
WorkflowIntegrationPlatform
|
||||||
} from "@app/hooks/api";
|
} from "@app/hooks/api/workflowIntegrations/types";
|
||||||
import { WorkflowIntegrationPlatform } from "@app/hooks/api/workflowIntegrations/types";
|
|
||||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
microsoftTeamsConfig?: ProjectWorkflowIntegrationConfig;
|
||||||
|
isMicrosoftTeamsConfigLoading: boolean;
|
||||||
handlePopUpOpen: (
|
handlePopUpOpen: (
|
||||||
popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,
|
popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,
|
||||||
data?: {
|
data?: {
|
||||||
@@ -33,14 +35,11 @@ type Props = {
|
|||||||
) => void;
|
) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MicrosoftTeamsConfigRow = ({ handlePopUpOpen }: Props) => {
|
export const MicrosoftTeamsConfigRow = ({
|
||||||
const { currentWorkspace } = useWorkspace();
|
handlePopUpOpen,
|
||||||
const { data: microsoftTeamsConfig, isPending: isMicrosoftTeamsConfigLoading } =
|
isMicrosoftTeamsConfigLoading,
|
||||||
useGetWorkspaceWorkflowIntegrationConfig({
|
microsoftTeamsConfig
|
||||||
workspaceId: currentWorkspace?.id ?? "",
|
}: Props) => {
|
||||||
integration: WorkflowIntegrationPlatform.MICROSOFT_TEAMS
|
|
||||||
});
|
|
||||||
|
|
||||||
const { data: microsoftTeamsChannels, isPending: isMicrosoftTeamsChannelsLoading } =
|
const { data: microsoftTeamsChannels, isPending: isMicrosoftTeamsChannelsLoading } =
|
||||||
useGetMicrosoftTeamsIntegrationTeams(microsoftTeamsConfig?.integrationId);
|
useGetMicrosoftTeamsIntegrationTeams(microsoftTeamsConfig?.integrationId);
|
||||||
const microsoftTeamsChannelIdToName = Object.fromEntries(
|
const microsoftTeamsChannelIdToName = Object.fromEntries(
|
||||||
|
|||||||
+8
-13
@@ -15,15 +15,17 @@ import {
|
|||||||
Td,
|
Td,
|
||||||
Tr
|
Tr
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects, useWorkspace } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
||||||
|
import { useGetSlackIntegrationChannels } from "@app/hooks/api";
|
||||||
import {
|
import {
|
||||||
useGetSlackIntegrationChannels,
|
ProjectWorkflowIntegrationConfig,
|
||||||
useGetWorkspaceWorkflowIntegrationConfig
|
WorkflowIntegrationPlatform
|
||||||
} from "@app/hooks/api";
|
} from "@app/hooks/api/workflowIntegrations/types";
|
||||||
import { WorkflowIntegrationPlatform } from "@app/hooks/api/workflowIntegrations/types";
|
|
||||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
slackConfig?: ProjectWorkflowIntegrationConfig;
|
||||||
|
isSlackConfigLoading: boolean;
|
||||||
handlePopUpOpen: (
|
handlePopUpOpen: (
|
||||||
popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,
|
popUpName: keyof UsePopUpState<["removeIntegration", "editIntegration"]>,
|
||||||
data?: {
|
data?: {
|
||||||
@@ -33,14 +35,7 @@ type Props = {
|
|||||||
) => void;
|
) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SlackConfigRow = ({ handlePopUpOpen }: Props) => {
|
export const SlackConfigRow = ({ handlePopUpOpen, isSlackConfigLoading, slackConfig }: Props) => {
|
||||||
const { currentWorkspace } = useWorkspace();
|
|
||||||
const { data: slackConfig, isPending: isSlackConfigLoading } =
|
|
||||||
useGetWorkspaceWorkflowIntegrationConfig({
|
|
||||||
workspaceId: currentWorkspace?.id ?? "",
|
|
||||||
integration: WorkflowIntegrationPlatform.SLACK
|
|
||||||
});
|
|
||||||
|
|
||||||
const { data: slackChannels, isPending: isSlackChannelsLoading } = useGetSlackIntegrationChannels(
|
const { data: slackChannels, isPending: isSlackChannelsLoading } = useGetSlackIntegrationChannels(
|
||||||
slackConfig?.integrationId
|
slackConfig?.integrationId
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user