Skip to content

Commit 114d92d

Browse files
authored
fix: success workaround for operations list (#3176)
1 parent 0ded083 commit 114d92d

File tree

4 files changed

+27
-29
lines changed

4 files changed

+27
-29
lines changed

src/containers/Operations/columns.tsx

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,31 @@ import {getOperationProgress, isIndexBuildMetadata} from './utils';
1818

1919
import './Operations.scss';
2020

21-
const IMPORT_EXPORT_KINDS: OperationKind[] = ['import/s3', 'export/s3', 'export/yt'];
21+
function renderStatusCell(row: TOperation) {
22+
const progress = getOperationProgress(row, i18n);
23+
24+
if (row.ready) {
25+
if (!row.status) {
26+
return EMPTY_DATA_PLACEHOLDER;
27+
}
28+
29+
return (
30+
<Text color={row.status === EStatusCode.SUCCESS ? 'positive' : 'danger'}>
31+
{row.status}
32+
</Text>
33+
);
34+
}
35+
36+
if (row.status && row.status !== EStatusCode.SUCCESS) {
37+
return <Text color="danger">{row.status}</Text>;
38+
}
39+
40+
if (progress !== null) {
41+
return progress;
42+
}
43+
44+
return i18n('label_in-progress');
45+
}
2246

2347
export function getColumns({
2448
database,
@@ -30,7 +54,6 @@ export function getColumns({
3054
kind: OperationKind;
3155
}): DataTableColumn<TOperation>[] {
3256
const isBuildIndex = kind === 'buildindex';
33-
const isImportOrExport = IMPORT_EXPORT_KINDS.includes(kind);
3457

3558
// Helper function to get description tooltip content (buildindex-only)
3659
const getDescriptionTooltip = (operation: TOperation): string => {
@@ -66,14 +89,7 @@ export function getColumns({
6689
name: COLUMNS_NAMES.STATUS,
6790
header: COLUMNS_TITLES[COLUMNS_NAMES.STATUS],
6891
render: ({row}) => {
69-
if (!row.status) {
70-
return EMPTY_DATA_PLACEHOLDER;
71-
}
72-
return (
73-
<Text color={row.status === EStatusCode.SUCCESS ? 'positive' : 'danger'}>
74-
{row.status}
75-
</Text>
76-
);
92+
return renderStatusCell(row);
7793
},
7894
},
7995
];
@@ -93,21 +109,6 @@ export function getColumns({
93109
});
94110
}
95111

96-
// Add progress column for operations that have progress data
97-
if (isBuildIndex || isImportOrExport) {
98-
columns.push({
99-
name: COLUMNS_NAMES.PROGRESS,
100-
header: COLUMNS_TITLES[COLUMNS_NAMES.PROGRESS],
101-
render: ({row}) => {
102-
const progress = getOperationProgress(row, i18n);
103-
if (progress === null) {
104-
return EMPTY_DATA_PLACEHOLDER;
105-
}
106-
return progress;
107-
},
108-
});
109-
}
110-
111112
// Add standard columns for non-buildindex operations
112113
if (!isBuildIndex) {
113114
columns.push(

src/containers/Operations/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export const COLUMNS_NAMES = {
1212
END_TIME: 'end_time',
1313
DURATION: 'duration',
1414
STATE: 'state',
15-
PROGRESS: 'progress',
1615
} as const;
1716

1817
export const COLUMNS_TITLES = {
@@ -23,7 +22,6 @@ export const COLUMNS_TITLES = {
2322
[COLUMNS_NAMES.END_TIME]: i18n('column_endTime'),
2423
[COLUMNS_NAMES.DURATION]: i18n('column_duration'),
2524
[COLUMNS_NAMES.STATE]: i18n('column_state'),
26-
[COLUMNS_NAMES.PROGRESS]: i18n('column_progress'),
2725
} as const;
2826

2927
export const BASE_COLUMNS = [

src/containers/Operations/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"column_endTime": "End Time",
1515
"column_duration": "Duration",
1616
"column_state": "State",
17-
"column_progress": "Progress",
1817
"label_duration-ongoing": "{{value}} (ongoing)",
18+
"label_in-progress": "In progress",
1919
"value_progress_unspecified": "Unspecified",
2020
"value_progress_preparing": "Preparing",
2121
"value_progress_transfer_data": "Transferring Data",

tests/suites/tenant/diagnostics/tabs/operations.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ test.describe('Operations Tab - Infinite Query', () => {
5151
firstRowData['Status'],
5252
);
5353
expect(firstRowData['State']).toBeTruthy();
54-
expect(firstRowData['Progress']).toBeTruthy();
5554

5655
// Verify loading more indicator is not visible initially
5756
const isLoadingVisible = await diagnostics.operations.isLoadingMoreVisible();

0 commit comments

Comments
 (0)