diff --git a/ui/src/app/applications/components/application-summary/application-summary.tsx b/ui/src/app/applications/components/application-summary/application-summary.tsx
index 1747e943af69f..af98824f97b7b 100644
--- a/ui/src/app/applications/components/application-summary/application-summary.tsx
+++ b/ui/src/app/applications/components/application-summary/application-summary.tsx
@@ -172,7 +172,7 @@ export const ApplicationSummary = (props: ApplicationSummaryProps) => {
},
!hasMultipleSources && {
title: 'REPO URL',
- view:
,
+ view:
,
edit: (formApi: FormApi) =>
},
...(!hasMultipleSources
@@ -180,11 +180,7 @@ export const ApplicationSummary = (props: ApplicationSummaryProps) => {
? [
{
title: 'CHART',
- view: (
-
- {source.chart}:{source.targetRevision}
-
- ),
+ view:
{source && `${source.chart}:${source.targetRevision}`},
edit: (formApi: FormApi) =>
hasMultipleSources ? (
helpTip('CHART is not editable for applications with multiple sources. You can edit them in the "Manifest" tab.')
diff --git a/ui/src/app/applications/components/applications-list/applications-source.tsx b/ui/src/app/applications/components/applications-list/applications-source.tsx
index 0a5fbe51f37c0..d0fe9d096444a 100644
--- a/ui/src/app/applications/components/applications-list/applications-source.tsx
+++ b/ui/src/app/applications/components/applications-list/applications-source.tsx
@@ -5,7 +5,7 @@ import {ApplicationSource as ApplicationSourceType} from '../../../shared/models
import './applications-source.scss';
export const ApplicationsSource = ({source}: {source: ApplicationSourceType}) => {
- const sourceString = `${source.repoURL}/${source.path || source.chart}`;
+ const sourceString = source ? `${source.repoURL}/${source.path || source.chart}` : '';
return (
{sourceString}
diff --git a/ui/src/app/applications/components/applications-list/applications-tiles.tsx b/ui/src/app/applications/components/applications-list/applications-tiles.tsx
index 3467d3b952a87..0c6f63b66e460 100644
--- a/ui/src/app/applications/components/applications-list/applications-tiles.tsx
+++ b/ui/src/app/applications/components/applications-list/applications-tiles.tsx
@@ -108,6 +108,7 @@ export const ApplicationTiles = ({applications, syncApplication, refreshApplicat
{applications.map((app, i) => {
const source = getAppDefaultSource(app);
+ const targetRevision = source ? source.targetRevision || 'HEAD' : 'Unknown';
return (
0 ? 'columns small-10' : 'columns small-11'}>
-
+
{AppUtils.appQualifiedName(app, useAuthSettingsCtx?.appsInAnyNamespaceEnabled)}
@@ -208,8 +209,8 @@ export const ApplicationTiles = ({applications, syncApplication, refreshApplicat
Repository:
-
- {source.repoURL}
+
+ {source?.repoURL}
@@ -217,22 +218,22 @@ export const ApplicationTiles = ({applications, syncApplication, refreshApplicat
Target Revision:
-
{source.targetRevision || 'HEAD'}
+
{targetRevision}
- {source.path && (
+ {source?.path && (
Path:
-
{source.path}
+
{source?.path}
)}
- {source.chart && (
+ {source?.chart && (
Chart:
-
{source.chart}
+
{source?.chart}
)}
diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx
index e4625bde7c9d4..d660242d2196d 100644
--- a/ui/src/app/applications/components/utils.tsx
+++ b/ui/src/app/applications/components/utils.tsx
@@ -706,10 +706,10 @@ export function renderResourceButtons(
export function syncStatusMessage(app: appModels.Application) {
const source = getAppDefaultSource(app);
const revision = getAppDefaultSyncRevision(app);
- const rev = app.status.sync.revision || source.targetRevision || 'HEAD';
- let message = source.targetRevision || 'HEAD';
+ const rev = app.status.sync.revision || (source ? source.targetRevision || 'HEAD' : 'Unknown');
+ let message = source ? source?.targetRevision || 'HEAD' : 'Unknown';
- if (revision) {
+ if (revision && source) {
if (source.chart) {
message += ' (' + revision + ')';
} else if (revision.length >= 7 && !revision.startsWith(source.targetRevision)) {
@@ -1080,7 +1080,7 @@ export const getPodReadinessGatesState = (pod: appModels.State): {nonExistingCon
for (const condition of podStatusConditions) {
existingConditions.set(condition.type, true);
// priority order of conditions
- // eg. if there are multiple conditions set with same name then the one which comes first is evaluated
+ // e.g. if there are multiple conditions set with same name then the one which comes first is evaluated
if (podConditions.has(condition.type)) {
continue;
}
@@ -1127,10 +1127,10 @@ export function isAppNode(node: appModels.ResourceNode) {
export function getAppOverridesCount(app: appModels.Application) {
const source = getAppDefaultSource(app);
- if (source.kustomize && source.kustomize.images) {
+ if (source?.kustomize?.images) {
return source.kustomize.images.length;
}
- if (source.helm && source.helm.parameters) {
+ if (source?.helm?.parameters) {
return source.helm.parameters.length;
}
return 0;