Skip to content

Commit 525f7c5

Browse files
committed
feat: Add link to workload in resources tab
1 parent adaa24b commit 525f7c5

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/components/camel-app-resources/CamelAppOwnerResource.tsx

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import * as React from 'react';
2-
import { Card, CardBody, CardTitle } from '@patternfly/react-core';
2+
import { Card, CardBody, CardTitle, TextContent } from '@patternfly/react-core';
33
import {
44
K8sGroupVersionKind,
55
K8sResourceKind,
66
ResourceLink,
77
} from '@openshift-console/dynamic-plugin-sdk';
8+
import { Link } from 'react-router-dom-v5-compat';
9+
import { useTranslation } from 'react-i18next';
810

911
type CamelAppOwnerResourceProps = {
1012
obj: K8sResourceKind;
@@ -15,17 +17,32 @@ const CamelAppOwnerResource: React.FC<CamelAppOwnerResourceProps> = ({
1517
obj: camelAppOwner,
1618
gvk: ownerGvk,
1719
}) => {
20+
const { t } = useTranslation('plugin__camel-openshift-console-plugin');
21+
1822
return (
1923
<Card>
2024
<CardTitle>{camelAppOwner.kind}</CardTitle>
2125
<CardBody>
2226
<ul className="list-group">
2327
<li className="list-group-item">
24-
<ResourceLink
25-
groupVersionKind={ownerGvk}
26-
name={camelAppOwner.metadata.name}
27-
namespace={camelAppOwner.metadata.namespace}
28-
/>
28+
<div className="row">
29+
<span className="col-xs-5">
30+
<ResourceLink
31+
groupVersionKind={ownerGvk}
32+
name={camelAppOwner.metadata.name}
33+
namespace={camelAppOwner.metadata.namespace}
34+
/>
35+
</span>
36+
<span className="col-xs-4 text-right">
37+
<TextContent>
38+
<Link
39+
to={`/dev-monitoring/ns/${camelAppOwner.metadata.namespace}?dashboard=dashboard-k8s-resources-workload&workload=${camelAppOwner.metadata.name}&type=ALL_OPTIONS_KEY`}
40+
>
41+
{t('View dashboards')}
42+
</Link>
43+
</TextContent>
44+
</span>
45+
</div>
2946
</li>
3047
</ul>
3148
</CardBody>

0 commit comments

Comments
 (0)