diff --git a/src/containers/Operations/columns.tsx b/src/containers/Operations/columns.tsx index 6db4452c34..b90b5f1a89 100644 --- a/src/containers/Operations/columns.tsx +++ b/src/containers/Operations/columns.tsx @@ -18,7 +18,31 @@ import {getOperationProgress, isIndexBuildMetadata} from './utils'; import './Operations.scss'; -const IMPORT_EXPORT_KINDS: OperationKind[] = ['import/s3', 'export/s3', 'export/yt']; +function renderStatusCell(row: TOperation) { + const progress = getOperationProgress(row, i18n); + + if (row.ready) { + if (!row.status) { + return EMPTY_DATA_PLACEHOLDER; + } + + return ( + + {row.status} + + ); + } + + if (row.status && row.status !== EStatusCode.SUCCESS) { + return {row.status}; + } + + if (progress !== null) { + return progress; + } + + return i18n('label_in-progress'); +} export function getColumns({ database, @@ -30,7 +54,6 @@ export function getColumns({ kind: OperationKind; }): DataTableColumn[] { const isBuildIndex = kind === 'buildindex'; - const isImportOrExport = IMPORT_EXPORT_KINDS.includes(kind); // Helper function to get description tooltip content (buildindex-only) const getDescriptionTooltip = (operation: TOperation): string => { @@ -66,14 +89,7 @@ export function getColumns({ name: COLUMNS_NAMES.STATUS, header: COLUMNS_TITLES[COLUMNS_NAMES.STATUS], render: ({row}) => { - if (!row.status) { - return EMPTY_DATA_PLACEHOLDER; - } - return ( - - {row.status} - - ); + return renderStatusCell(row); }, }, ]; @@ -93,21 +109,6 @@ export function getColumns({ }); } - // Add progress column for operations that have progress data - if (isBuildIndex || isImportOrExport) { - columns.push({ - name: COLUMNS_NAMES.PROGRESS, - header: COLUMNS_TITLES[COLUMNS_NAMES.PROGRESS], - render: ({row}) => { - const progress = getOperationProgress(row, i18n); - if (progress === null) { - return EMPTY_DATA_PLACEHOLDER; - } - return progress; - }, - }); - } - // Add standard columns for non-buildindex operations if (!isBuildIndex) { columns.push( diff --git a/src/containers/Operations/constants.ts b/src/containers/Operations/constants.ts index b252b3d33b..9c21c99428 100644 --- a/src/containers/Operations/constants.ts +++ b/src/containers/Operations/constants.ts @@ -12,7 +12,6 @@ export const COLUMNS_NAMES = { END_TIME: 'end_time', DURATION: 'duration', STATE: 'state', - PROGRESS: 'progress', } as const; export const COLUMNS_TITLES = { @@ -23,7 +22,6 @@ export const COLUMNS_TITLES = { [COLUMNS_NAMES.END_TIME]: i18n('column_endTime'), [COLUMNS_NAMES.DURATION]: i18n('column_duration'), [COLUMNS_NAMES.STATE]: i18n('column_state'), - [COLUMNS_NAMES.PROGRESS]: i18n('column_progress'), } as const; export const BASE_COLUMNS = [ diff --git a/src/containers/Operations/i18n/en.json b/src/containers/Operations/i18n/en.json index 8a02cdcbdf..1ff8798457 100644 --- a/src/containers/Operations/i18n/en.json +++ b/src/containers/Operations/i18n/en.json @@ -14,8 +14,8 @@ "column_endTime": "End Time", "column_duration": "Duration", "column_state": "State", - "column_progress": "Progress", "label_duration-ongoing": "{{value}} (ongoing)", + "label_in-progress": "In progress", "value_progress_unspecified": "Unspecified", "value_progress_preparing": "Preparing", "value_progress_transfer_data": "Transferring Data", diff --git a/tests/suites/tenant/diagnostics/tabs/operations.test.ts b/tests/suites/tenant/diagnostics/tabs/operations.test.ts index 19a313e479..e20d7645e1 100644 --- a/tests/suites/tenant/diagnostics/tabs/operations.test.ts +++ b/tests/suites/tenant/diagnostics/tabs/operations.test.ts @@ -51,7 +51,6 @@ test.describe('Operations Tab - Infinite Query', () => { firstRowData['Status'], ); expect(firstRowData['State']).toBeTruthy(); - expect(firstRowData['Progress']).toBeTruthy(); // Verify loading more indicator is not visible initially const isLoadingVisible = await diagnostics.operations.isLoadingMoreVisible();