Skip to content

Commit

Permalink
fix: Contextualize observer details modal to target type (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm authored Sep 16, 2024
1 parent 3795335 commit 5ffc85b
Showing 1 changed file with 40 additions and 34 deletions.
74 changes: 40 additions & 34 deletions assets/src/components/cd/observers/Observers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { GqlError } from 'components/utils/Alert'
import { FullHeightTableWrap } from 'components/utils/layout/FullHeightTableWrap'
import {
ObserverFragment,
ObserverTargetType,
useDeleteObserverMutation,
useObserversQuery,
} from 'generated/graphql'
Expand Down Expand Up @@ -130,40 +131,45 @@ const columns = [
<ObserverTargetOrderChip order={node.target.order} />
</Prop>
</div>
{node.target.git && (
<div>
<PropsContainerHeader>Git</PropsContainerHeader>
<PropsContainer>
<PropWide title="Type">{node.target.git.type}</PropWide>
<PropWide title="Repository ID">
{node.target.git.repositoryId}
</PropWide>
</PropsContainer>
</div>
)}
{node.target.helm && (
<div>
<PropsContainerHeader>Helm</PropsContainerHeader>
<PropsContainer>
<PropWide title="Chart">{node.target.helm.chart}</PropWide>
<PropWide title="URL">{node.target.helm.url}</PropWide>
<PropWide title="Provider">
{node.target.helm.provider}
</PropWide>
</PropsContainer>
</div>
)}
{node.target.oci && (
<div>
<PropsContainerHeader>OCI</PropsContainerHeader>
<PropsContainer>
<PropWide title="Chart">{node.target.oci.url}</PropWide>
<PropWide title="Provider">
{node.target.oci.provider}
</PropWide>
</PropsContainer>
</div>
)}
{node.target.git &&
node.target.target === ObserverTargetType.Git && (
<div>
<PropsContainerHeader>Git</PropsContainerHeader>
<PropsContainer>
<PropWide title="Type">{node.target.git.type}</PropWide>
<PropWide title="Repository ID">
{node.target.git.repositoryId}
</PropWide>
</PropsContainer>
</div>
)}
{node.target.helm &&
node.target.target === ObserverTargetType.Helm && (
<div>
<PropsContainerHeader>Helm</PropsContainerHeader>
<PropsContainer>
<PropWide title="Chart">
{node.target.helm.chart}
</PropWide>
<PropWide title="URL">{node.target.helm.url}</PropWide>
<PropWide title="Provider">
{node.target.helm.provider}
</PropWide>
</PropsContainer>
</div>
)}
{node.target.oci &&
node.target.target === ObserverTargetType.Oci && (
<div>
<PropsContainerHeader>OCI</PropsContainerHeader>
<PropsContainer>
<PropWide title="URL">{node.target.oci.url}</PropWide>
<PropWide title="Provider">
{node.target.oci.provider}
</PropWide>
</PropsContainer>
</div>
)}
</div>
</Modal>
</div>
Expand Down

0 comments on commit 5ffc85b

Please sign in to comment.