From f1e3f519984d70b2e3127446475632dea7f9fd57 Mon Sep 17 00:00:00 2001 From: Kira Miller Date: Mon, 9 Sep 2024 15:33:54 +0000 Subject: [PATCH 1/2] fix: add integration count number --- .../Customers/CustomerDetailView/CustomerIntegrations.jsx | 8 ++++++-- .../tests/CustomerViewIntegrations.test.jsx | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Configuration/Customers/CustomerDetailView/CustomerIntegrations.jsx b/src/Configuration/Customers/CustomerDetailView/CustomerIntegrations.jsx index bde748610..bbd98220f 100644 --- a/src/Configuration/Customers/CustomerDetailView/CustomerIntegrations.jsx +++ b/src/Configuration/Customers/CustomerDetailView/CustomerIntegrations.jsx @@ -11,12 +11,16 @@ const CustomerIntegrations = ({ const { ADMIN_PORTAL_BASE_URL } = getConfig(); const ssoDateText = ({ sso }) => (`Created ${formatDate(sso?.created)} • Last modified ${formatDate(sso?.modifed)}`); const configDateText = ({ config }) => (`Created ${formatDate(config?.created)} • Last modified ${formatDate(config?.lastModifiedAt)}`); + let integrationCount = activeSSO?.length + activeIntegrations?.length; + if (apiCredentialsEnabled) { + integrationCount++; + } return (
- {(activeSSO || activeIntegrations || apiCredentialsEnabled) && ( + {(integrationCount > 0) && (
-

Associated integrations

+

Associated integrations ({integrationCount})


{activeSSO && activeSSO.map((sso) => ( { , ); await waitFor(() => { - expect(screen.getByText('Associated integrations')).toBeInTheDocument(); - + expect(screen.getByText('Associated integrations (4)')).toBeInTheDocument(); expect(screen.getByText('SSO')).toBeInTheDocument(); expect(screen.getByText('Orange cats rule')).toBeInTheDocument(); expect(screen.getAllByText('Created September 15, 2024 • Last modified September 15, 2024')).toHaveLength(3); From bce476d98c1cd3a5ca06dc9ecb2d2431c94153cc Mon Sep 17 00:00:00 2001 From: Kira Miller Date: Mon, 9 Sep 2024 15:47:02 +0000 Subject: [PATCH 2/2] fix: PR request --- .../Customers/CustomerDetailView/CustomerIntegrations.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Configuration/Customers/CustomerDetailView/CustomerIntegrations.jsx b/src/Configuration/Customers/CustomerDetailView/CustomerIntegrations.jsx index bbd98220f..90543448b 100644 --- a/src/Configuration/Customers/CustomerDetailView/CustomerIntegrations.jsx +++ b/src/Configuration/Customers/CustomerDetailView/CustomerIntegrations.jsx @@ -11,7 +11,7 @@ const CustomerIntegrations = ({ const { ADMIN_PORTAL_BASE_URL } = getConfig(); const ssoDateText = ({ sso }) => (`Created ${formatDate(sso?.created)} • Last modified ${formatDate(sso?.modifed)}`); const configDateText = ({ config }) => (`Created ${formatDate(config?.created)} • Last modified ${formatDate(config?.lastModifiedAt)}`); - let integrationCount = activeSSO?.length + activeIntegrations?.length; + let integrationCount = (activeSSO ? activeSSO.length : 0) + (activeIntegrations ? activeIntegrations.length : 0); if (apiCredentialsEnabled) { integrationCount++; }