Skip to content

Commit 3cdcb9d

Browse files
Merge pull request #1484 from TimothyAsirJeyasing/bz-2294374-last-sync-status-on-app-vols
Update Sync Status Message for Application Volumes (PVCs)
2 parents 4ed2b85 + 55713eb commit 3cdcb9d

File tree

4 files changed

+37
-20
lines changed

4 files changed

+37
-20
lines changed

locales/en/plugin__odf-console.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@
382382
"<0>You do not have any <1>discovered applications</1> that are protected yet. For details about your <4>protected managed applications</4>, navigate to the <7>Applications</7> page, as this information is not maintained here.</0><1></1><2>Click <1>Enroll applications</1> to add disaster recovery protection to your applications.</2>": "<0>You do not have any <1>discovered applications</1> that are protected yet. For details about your <4>protected managed applications</4>, navigate to the <7>Applications</7> page, as this information is not maintained here.</0><1></1><2>Click <1>Enroll applications</1> to add disaster recovery protection to your applications.</2>",
383383
"Activity description": "Activity description",
384384
"Application volumes (PVCs)": "Application volumes (PVCs)",
385-
"Kubernetes objects": "Kubernetes objects",
386385
"No data available": "No data available",
386+
"Kubernetes objects": "Kubernetes objects",
387387
"Sync resource type": "Sync resource type",
388388
"Sync status": "Sync status",
389389
"Last synced on": "Last synced on",

packages/mco/components/protected-applications/components.tsx

+34-19
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ import {
2929
Text,
3030
} from '@patternfly/react-core';
3131
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
32-
import { ENROLLED_APP_QUERY_PARAMS_KEY, DR_BASE_ROUTE } from '../../constants';
32+
import {
33+
ENROLLED_APP_QUERY_PARAMS_KEY,
34+
DR_BASE_ROUTE,
35+
REPLICATION_TYPE,
36+
} from '../../constants';
3337
import { DRPlacementControlModel } from '../../models';
3438
import { DRPlacementControlKind } from '../../types';
3539
import EmptyPage from '../empty-state-page/empty-page';
@@ -365,33 +369,44 @@ export const StatusDetails: React.FC<ExpandableComponentProps> = ({
365369
syncStatusInfo,
366370
}) => {
367371
const { t } = useCustomTranslation();
372+
const syncType = [];
373+
const syncStatus = [];
374+
const lastSyncOn = [];
368375

369-
const syncType = [t('Application volumes (PVCs)'), t('Kubernetes objects')];
370-
const { icon: volIcon, title: volTitle } = replicationHealthMap(
371-
syncStatusInfo.volumeReplicationStatus,
372-
t
373-
);
376+
if (syncStatusInfo.replicationType === REPLICATION_TYPE.ASYNC) {
377+
syncType.push(t('Application volumes (PVCs)'));
378+
const { icon: volIcon, title: volTitle } = replicationHealthMap(
379+
syncStatusInfo.volumeReplicationStatus,
380+
t
381+
);
382+
syncStatus.push(
383+
<>
384+
{volIcon} {volTitle}
385+
</>
386+
);
387+
lastSyncOn.push(
388+
syncStatusInfo.volumeLastGroupSyncTime || (
389+
<Text className="text-muted">{t('No data available')}</Text>
390+
)
391+
);
392+
}
393+
394+
syncType.push(t('Kubernetes objects'));
374395
const { icon: kubeIcon, title: kubeTitle } = replicationHealthMap(
375396
syncStatusInfo.kubeObjectReplicationStatus,
376397
t
377398
);
378-
const syncStatus = [
379-
<>
380-
{volIcon} {volTitle}
381-
</>,
399+
syncStatus.push(
382400
<>
383401
{kubeIcon} {kubeTitle}
384-
</>,
385-
];
386-
387-
const lastSyncOn = [
388-
syncStatusInfo.volumeLastGroupSyncTime || (
389-
<Text className="text-muted"> {t('No data available')}</Text>
390-
),
402+
</>
403+
);
404+
lastSyncOn.push(
391405
syncStatusInfo.kubeObjectLastProtectionTime || (
392406
<Text className="text-muted"> {t('No data available')}</Text>
393-
),
394-
];
407+
)
408+
);
409+
395410
return (
396411
<DescriptionList_ columnModifier={'3Col'}>
397412
<Description term={t('Sync resource type')} descriptions={syncType} />

packages/mco/components/protected-applications/list-page.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export const ProtectedApplicationsListPage: React.FC = () => {
282282
kubeObjectLastProtectionTime: formatTime(
283283
kubeObjectLastProtectionTime
284284
),
285+
replicationType,
285286
};
286287

287288
return acc;

packages/mco/components/protected-applications/utils.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ export type SyncStatusInfo = {
145145
volumeLastGroupSyncTime: string;
146146
kubeObjectReplicationStatus: VOLUME_REPLICATION_HEALTH;
147147
kubeObjectLastProtectionTime: string;
148+
replicationType: REPLICATION_TYPE;
148149
};
149150

150151
export const getAppWorstSyncStatus = (

0 commit comments

Comments
 (0)