Skip to content

Commit

Permalink
dynamic config for legacy vs. TOML
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Nov 30, 2022
1 parent c034d17 commit 49a0ba1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const ConfigurationCard = () => {

return (
<KeyValueListCard
title="ENV Configuration (legacy)"
title="ENV Configuration"
error={error?.message}
loading={loading}
entries={entries}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ export const ConfigurationV2Card = () => {
fetchPolicy: 'cache-and-network',
})

if (data?.configv2.effective == 'N/A') {
return (
<>
<Grid item xs={12}>
<TOMLCard
title="TOML Configuration (config dump)"
error={error?.message}
loading={loading}
toml={data?.configv2.user}
showHead
/>
</Grid>
</>
)
}

return (
<>
<Grid item xs={12}>
Expand Down Expand Up @@ -77,14 +93,14 @@ const TOMLCard = ({ loading, toml, error = '', title }: Props) => {
return <FetchingRow />
}

let styles = {marginLeft: '1em'};
const styles = { marginLeft: '1em' }

return (
<Card>
{title && <CardHeader title={title} />}
<pre style={styles}>
<code>{toml}</code>
</pre>
<pre style={styles}>
<code>{toml}</code>
</pre>
</Card>
)
}
2 changes: 1 addition & 1 deletion src/screens/Configuration/ConfigurationView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('ConfigurationView', () => {
</BuildInfoProvider>,
)

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()
Expand Down

0 comments on commit 49a0ba1

Please sign in to comment.