Skip to content

Commit 3a72c30

Browse files
committed
Provide link back to AppSet from applications && update owner DetailsDescription
Signed-off-by: Atif Ali <atali@redhat.com>
1 parent 24540f6 commit 3a72c30

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

src/gitops/Revision/Revision.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import * as React from 'react';
22
import { createRevisionURL } from 'src/gitops/utils/gitops';
33

4-
import ExternalLink from '../utils/components/ExternalLink/ExternalLink';
54
import { isSHA, revisionUrl } from '@gitops/utils/urls';
65

6+
import ExternalLink from '../utils/components/ExternalLink/ExternalLink';
7+
78
interface RevisionProps {
89
repoURL: string;
910
revision: string;

src/gitops/components/shared/BaseDetailsSummary/BaseDetailsSummary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export const BaseDetailsSummary: React.FC<BaseDetailsSummaryProps> = ({ obj, mod
221221
<DetailsDescriptionGroup
222222
title={t('Owner')}
223223
help={t(
224-
'Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.',
224+
'Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.',
225225
)}
226226
>
227227
<OwnerReferences resource={obj} />

src/gitops/utils/components/OwnerReferences/owner-references.tsx

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,38 @@ import {
66
OwnerReference,
77
ResourceLink,
88
} from '@openshift-console/dynamic-plugin-sdk';
9+
import { Tooltip } from '@patternfly/react-core';
910

1011
import { useGitOpsTranslation } from '../../hooks/useGitOpsTranslation';
1112

1213
export const OwnerReferences: React.FC<OwnerReferencesProps> = ({ resource }) => {
1314
const { t } = useGitOpsTranslation();
14-
const owners = (_.get(resource.metadata, 'ownerReferences') || []).map((o: OwnerReference) => (
15-
<ResourceLink key={o.uid} kind={o.kind} name={o.name} namespace={resource.metadata.namespace} />
16-
));
15+
const owners = (_.get(resource.metadata, 'ownerReferences') || []).map((o: OwnerReference) => {
16+
if (o.kind === 'ApplicationSet') {
17+
return (
18+
<Tooltip key={o.uid} content={<div>Back to ApplicationSet</div>} position="top">
19+
<ResourceLink
20+
namespace={resource.metadata.namespace}
21+
groupVersionKind={{
22+
group: 'argoproj.io',
23+
version: 'v1alpha1',
24+
kind: 'ApplicationSet',
25+
}}
26+
name={o.name}
27+
/>
28+
</Tooltip>
29+
);
30+
}
31+
32+
return (
33+
<ResourceLink
34+
key={o.uid}
35+
kind={o.kind}
36+
name={o.name}
37+
namespace={resource.metadata.namespace}
38+
/>
39+
);
40+
});
1741
return owners.length ? (
1842
<>{owners}</>
1943
) : (

0 commit comments

Comments
 (0)