11import * as React from 'react' ;
22import { RouteComponentProps } from 'react-router' ;
33
4+ import { useArgoServer } from '@gitops/hooks/useArgoServer' ;
45import { ApplicationKind , ApplicationSource } from '@gitops/models/ApplicationModel' ;
56import ExternalLink from '@gitops/utils/components/ExternalLink/ExternalLink' ;
67import { GitIcon } from '@gitops/utils/components/Icons/GitIcon' ;
78import { HelmIcon } from '@gitops/utils/components/Icons/HelmIcon' ;
89import { OciIcon } from '@gitops/utils/components/Icons/OciIcon' ;
9- import { useArgoServer } from '@gitops/hooks/useArgoServer' ;
1010import { ArgoServer , getApplicationArgoUrl } from '@gitops/utils/gitops' ;
1111import { t } from '@gitops/utils/hooks/useGitOpsTranslation' ;
1212import { repoUrl , revisionUrl } from '@gitops/utils/urls' ;
@@ -182,6 +182,7 @@ export const useRowsDV = (sources: ApplicationSource[]): DataViewTr[] => {
182182export const SourceList : React . FC < SourceListProps > = ( { sources, obj, argoServer } ) => {
183183 const columns = useColumnsDV ( ) ;
184184 const rows = useRowsDV ( sources ) ;
185+ const argoUrl = getApplicationArgoUrl ( argoServer , obj ) ;
185186 const empty = (
186187 < Tbody >
187188 < Tr key = "loading" ouiaId = "table-tr-loading" >
@@ -197,17 +198,19 @@ export const SourceList: React.FC<SourceListProps> = ({ sources, obj, argoServer
197198 ) ;
198199 return (
199200 < >
200- < ArgoCDLink
201- href = {
202- getApplicationArgoUrl ( argoServer , obj ) +
203- '?resource=&node=argoproj.io%2FApplication%2F' +
204- obj ?. metadata ?. namespace +
205- '%2F' +
206- obj ?. metadata ?. name +
207- '%2F' +
208- '&tab=parameters'
209- }
210- />
201+ { argoUrl && (
202+ < ArgoCDLink
203+ href = {
204+ argoUrl +
205+ '?resource=&node=argoproj.io%2FApplication%2F' +
206+ obj ?. metadata ?. namespace +
207+ '%2F' +
208+ obj ?. metadata ?. name +
209+ '%2F' +
210+ '&tab=parameters'
211+ }
212+ />
213+ ) }
211214 < GitOpsDataViewTable
212215 rows = { rows }
213216 columns = { columns }
0 commit comments