From 49a0ba15013b00419a63c26d5a122c09ef4c0ee9 Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Tue, 29 Nov 2022 20:06:49 -0600 Subject: [PATCH] dynamic config for legacy vs. TOML --- .../ConfigurationCard/ConfigurationCard.tsx | 2 +- .../ConfigurationV2Card.tsx | 24 +++++++++++++++---- .../Configuration/ConfigurationView.test.tsx | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/screens/Configuration/ConfigurationCard/ConfigurationCard.tsx b/src/screens/Configuration/ConfigurationCard/ConfigurationCard.tsx index b1bb77ad..623eda0a 100644 --- a/src/screens/Configuration/ConfigurationCard/ConfigurationCard.tsx +++ b/src/screens/Configuration/ConfigurationCard/ConfigurationCard.tsx @@ -44,7 +44,7 @@ export const ConfigurationCard = () => { return ( { fetchPolicy: 'cache-and-network', }) + if (data?.configv2.effective == 'N/A') { + return ( + <> + + + + + ) + } + return ( <> @@ -77,14 +93,14 @@ const TOMLCard = ({ loading, toml, error = '', title }: Props) => { return } - let styles = {marginLeft: '1em'}; + const styles = { marginLeft: '1em' } return ( {title && } -
-          {toml}
-        
+
+        {toml}
+      
) } diff --git a/src/screens/Configuration/ConfigurationView.test.tsx b/src/screens/Configuration/ConfigurationView.test.tsx index 2cc555e6..ee15da94 100644 --- a/src/screens/Configuration/ConfigurationView.test.tsx +++ b/src/screens/Configuration/ConfigurationView.test.tsx @@ -18,7 +18,7 @@ describe('ConfigurationView', () => { , ) - expect(await findByText('ENV Configuration (legacy)')).toBeInTheDocument() + expect(await findByText('ENV Configuration')).toBeInTheDocument() expect(await findByText('Node')).toBeInTheDocument() expect(await findByText('Job Runs')).toBeInTheDocument() expect(await findByText('Logging')).toBeInTheDocument()