@@ -18,7 +18,31 @@ import {getOperationProgress, isIndexBuildMetadata} from './utils';
1818
1919import './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
2347export 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 (
0 commit comments