From 59c242961fdec6d46b956109ae422fff8bf58731 Mon Sep 17 00:00:00 2001 From: Vikrant Gupta Date: Tue, 9 Apr 2024 11:29:54 +0530 Subject: [PATCH] feat: revamp integration flow (#4832) * feat: revamp integration flow * feat: final design changes * feat: make test connection button grey --- .../IntegrationDetailContent.tsx | 14 ++- .../IntegrationDetailHeader.tsx | 108 +++++++++++++++--- .../IntegrationDetailPage.styles.scss | 82 ++++++++++--- .../IntegrationDetailPage.tsx | 10 +- .../src/pages/Integrations/Integrations.tsx | 1 + 5 files changed, 178 insertions(+), 37 deletions(-) diff --git a/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailContent.tsx b/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailContent.tsx index c0b3a52f44..d6b7a80dfe 100644 --- a/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailContent.tsx +++ b/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailContent.tsx @@ -13,12 +13,18 @@ interface IntegrationDetailContentProps { activeDetailTab: string; integrationData: IntegrationDetailedProps; integrationId: string; + setActiveDetailTab: React.Dispatch>; } function IntegrationDetailContent( props: IntegrationDetailContentProps, ): JSX.Element { - const { activeDetailTab, integrationData, integrationId } = props; + const { + activeDetailTab, + integrationData, + integrationId, + setActiveDetailTab, + } = props; const items: TabsProps['items'] = [ { key: 'overview', @@ -78,7 +84,11 @@ function IntegrationDetailContent( ]; return (
- +
); } diff --git a/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailHeader.tsx b/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailHeader.tsx index f630f3ecc4..6d15fc8694 100644 --- a/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailHeader.tsx +++ b/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailHeader.tsx @@ -3,6 +3,8 @@ import './IntegrationDetailPage.styles.scss'; import { Button, Modal, Tooltip, Typography } from 'antd'; import installIntegration from 'api/Integrations/installIntegration'; +import ConfigureIcon from 'assets/Integrations/ConfigureIcon'; +import cx from 'classnames'; import { SOMETHING_WENT_WRONG } from 'constants/api'; import dayjs from 'dayjs'; import useAnalytics from 'hooks/analytics/useAnalytics'; @@ -23,6 +25,7 @@ interface IntegrationDetailHeaderProps { refetchIntegrationDetails: () => void; connectionState: ConnectionStates; connectionData: IntegrationConnectionStatus; + setActiveDetailTab: React.Dispatch>; } // eslint-disable-next-line sonarjs/cognitive-complexity function IntegrationDetailHeader( @@ -36,6 +39,7 @@ function IntegrationDetailHeader( connectionState, connectionData, refetchIntegrationDetails, + setActiveDetailTab, } = props; const [isModalOpen, setIsModalOpen] = useState(false); @@ -106,6 +110,12 @@ function IntegrationDetailHeader( last_received_from: connectionData.metrics.last_received_from, }; } + const isConnectionStatePending = + connectionState === ConnectionStates.NotInstalled || + connectionState === ConnectionStates.TestingConnection; + + const isConnectionStateNotInstalled = + connectionState === ConnectionStates.NotInstalled; return (
@@ -119,7 +129,10 @@ function IntegrationDetailHeader(
@@ -153,15 +163,67 @@ function IntegrationDetailHeader( }} - cancelButtonProps={{ style: { display: 'none' } }} + footer={ +
+ + {isConnectionStatePending && ( + + )} +
+ } >
- + {!isConnectionStateNotInstalled && ( + + )} {connectionState === ConnectionStates.Connected || connectionState === ConnectionStates.NoDataSinceLong ? ( <> @@ -210,12 +272,26 @@ function IntegrationDetailHeader( ) : connectionState === ConnectionStates.TestingConnection ? (
- After adding the {title} integration, you need to manually configure - your Redis data source to start sending data to SigNoz. + We have not received data from your {title} Instance yet. You need to + manually configure your {title} instance to start sending data to + SigNoz.
- The status bar above would turn green if we are successfully receiving - the data. + If you have already configured your resources to send data, sit tight + and wait for the data to flow in, Or else, see the steps to configure + your resources to start sending data. +
+
+ ) : isConnectionStateNotInstalled ? ( +
+
+ You would need to manually configure your {title} instance to start + sending data to SigNoz. +
+
+ If you have already configured your resources to send data, sit tight + and wait for the data to flow in, Or else, see the steps to configure + your resources to start sending data.
) : null} diff --git a/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailPage.styles.scss b/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailPage.styles.scss index b7630491ae..96b5ab4c16 100644 --- a/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailPage.styles.scss +++ b/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailPage.styles.scss @@ -160,6 +160,14 @@ font-weight: 500; line-height: 10px; /* 83.333% */ letter-spacing: 0.12px; + box-shadow: none; + + &.test-connection { + border-radius: 2px; + border: 1px solid var(--bg-slate-400); + background: var(--bg-ink-300); + color: var(--bg-vanilla-400); + } } } @@ -380,25 +388,56 @@ display: flex; flex-direction: row-reverse; - .understandBtn { - border-radius: 2px; - border: 1px solid var(--bg-slate-400); - background: var(--bg-ink-300); - box-shadow: none; - color: var(--bg-vanilla-400); - font-family: Inter; - font-size: 12px; - font-style: normal; - font-weight: 400; - line-height: 10px; /* 83.333% */ - letter-spacing: 0.12px; + .connection-footer { display: flex; - justify-content: center; - align-items: center; - width: 131px; - height: 30px; - padding: 6px; - flex-shrink: 0; + width: 100%; + .understandBtn { + width: 50%; + border-radius: 2px; + border: 1px solid var(--bg-slate-400); + background: var(--bg-ink-300); + box-shadow: none; + color: var(--bg-vanilla-400); + font-family: Inter; + font-size: 12px; + font-style: normal; + font-weight: 400; + line-height: 10px; /* 83.333% */ + letter-spacing: 0.12px; + display: flex; + justify-content: center; + align-items: center; + height: 34px; + padding: 6px; + flex-shrink: 0; + } + .configureBtn { + width: 50%; + color: var(--bg-vanilla-100); + font-family: Inter; + font-size: 12px; + font-style: normal; + font-weight: 400; + line-height: 10px; /* 83.333% */ + letter-spacing: 0.12px; + border-radius: 2px; + background: var(--bg-robin-500); + display: flex; + height: 34px; + padding: 6px; + justify-content: center; + align-items: center; + gap: 6px; + flex: 1 0 0; + } + + &.not-pending { + flex-direction: row-reverse; + + .understandBtn { + width: 131px; + } + } } } } @@ -544,6 +583,13 @@ color: var(--bg-slate-200); } } + .configure-btn { + &.test-connection { + border: 1px solid rgba(53, 59, 76, 0.2); + background: var(--bg-vanilla-200); + color: var(--bg-slate-200); + } + } } .testingConnection { diff --git a/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailPage.tsx b/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailPage.tsx index a0e97dfe1c..2c7ffa070c 100644 --- a/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailPage.tsx +++ b/frontend/src/pages/Integrations/IntegrationDetailPage/IntegrationDetailPage.tsx @@ -22,10 +22,16 @@ interface IntegrationDetailPageProps { selectedIntegration: string; setSelectedIntegration: (id: string | null) => void; activeDetailTab: string; + setActiveDetailTab: React.Dispatch>; } function IntegrationDetailPage(props: IntegrationDetailPageProps): JSX.Element { - const { selectedIntegration, setSelectedIntegration, activeDetailTab } = props; + const { + selectedIntegration, + setSelectedIntegration, + activeDetailTab, + setActiveDetailTab, + } = props; const { data, @@ -119,11 +125,13 @@ function IntegrationDetailPage(props: IntegrationDetailPageProps): JSX.Element { metrics: null, })} refetchIntegrationDetails={refetch} + setActiveDetailTab={setActiveDetailTab} /> {connectionStatus !== ConnectionStates.NotInstalled && ( diff --git a/frontend/src/pages/Integrations/Integrations.tsx b/frontend/src/pages/Integrations/Integrations.tsx index 187c77f4f6..332c808311 100644 --- a/frontend/src/pages/Integrations/Integrations.tsx +++ b/frontend/src/pages/Integrations/Integrations.tsx @@ -55,6 +55,7 @@ function Integrations(): JSX.Element { selectedIntegration={selectedIntegration} setSelectedIntegration={setSelectedIntegration} activeDetailTab={activeDetailTab} + setActiveDetailTab={setActiveDetailTab} /> ) : ( <>