Skip to content

Commit

Permalink
Add Yaml tab to Pipeline details (#3662)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGostKasper authored Nov 22, 2023
1 parent 9948a1f commit df549e7
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion ui/src/components/Pipelines/PipelineDetails/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { ListError } from '@weaveworks/progressive-delivery/api/prog/types.pb';
import {
RouterTab,
SubRouterTabs,
YamlView,
createYamlCommand,
} from '@weaveworks/weave-gitops';
import { Pipeline } from '../../../api/pipelines/types.pb';
import { useGetPipeline } from '../../../contexts/Pipelines';
import { Routes } from '../../../utils/nav';
Expand All @@ -25,6 +31,7 @@ const PipelineDetails = ({ name, namespace }: Props) => {
name,
namespace,
});
const path = `/pipelines/details`;

return (
<Page
Expand All @@ -42,7 +49,21 @@ const PipelineDetails = ({ name, namespace }: Props) => {
<NotificationsWrapper
errors={mappedErrors(data?.errors || [], namespace)}
>
<Workloads pipeline={data?.pipeline || ({} as Pipeline)} />
<SubRouterTabs rootPath={`${path}/status`}>
<RouterTab name="Status" path={`${path}/status`}>
<Workloads pipeline={data?.pipeline || ({} as Pipeline)} />
</RouterTab>
<RouterTab name="Yaml" path={`${path}/yaml`}>
<YamlView
yaml={data?.pipeline?.yaml || ''}
header={createYamlCommand(
'Pipeline',
data?.pipeline?.name,
data?.pipeline?.namespace,
)}
/>
</RouterTab>
</SubRouterTabs>
</NotificationsWrapper>
</Page>
);
Expand Down

0 comments on commit df549e7

Please sign in to comment.