@@ -20,29 +20,33 @@ import { ITableColumnsProps, MyData, spec } from './TableColumnsConstans';
20
20
import TableColumnsHeader from './TableColumnsHeader' ;
21
21
import { renderValue } from './TableColumnsUtils' ;
22
22
23
- const getSeverityLevel = ( severity : CheckCurrentDataQualityStatusModelCurrentSeverityEnum | undefined ) => {
23
+ const getSeverityLevel = (
24
+ severity : CheckCurrentDataQualityStatusModelCurrentSeverityEnum | undefined
25
+ ) => {
24
26
switch ( severity ) {
25
- case 'execution_error' :
27
+ case 'execution_error' :
26
28
return 4 ;
27
- case 'fatal' :
29
+ case 'fatal' :
28
30
return 3 ;
29
- case 'error' :
31
+ case 'error' :
30
32
return 2 ;
31
- case 'warning' :
33
+ case 'warning' :
32
34
return 1 ;
33
35
case 'valid' :
34
- return 0 ;
36
+ return 0 ;
35
37
}
36
38
return 4 ;
37
- }
39
+ } ;
38
40
39
- const rewriteDimensions = ( columnStatus : { [ key : string ] : ColumnCurrentDataQualityStatusModel } ) => {
40
- const obj : any = { } ;
41
+ const rewriteDimensions = ( columnStatus : {
42
+ [ key : string ] : ColumnCurrentDataQualityStatusModel ;
43
+ } ) => {
44
+ const obj : any = { } ;
41
45
Object . entries ( columnStatus ) . forEach ( ( [ key , value ] ) => {
42
46
obj [ key ] = value . dimensions ;
43
- } ) ;
47
+ } ) ;
44
48
return obj ;
45
- }
49
+ } ;
46
50
47
51
const prepareLabel = ( label : string | undefined ) => {
48
52
if ( ! label ) return ;
@@ -67,16 +71,18 @@ const TableColumns = ({
67
71
onChangeSelectedColumns,
68
72
refreshListFunc
69
73
} : ITableColumnsProps ) => {
70
- const { checkTypes} : { checkTypes : CheckTypes } = useDecodedParams ( )
74
+ const { checkTypes } : { checkTypes : CheckTypes } = useDecodedParams ( ) ;
71
75
const [ isOpen , setIsOpen ] = useState ( false ) ;
72
76
const [ selectedColumn , setSelectedColumn ] = useState < ColumnStatisticsModel > ( ) ;
73
77
const [ sortedArray , setSortedArray ] = useState < MyData [ ] > ( ) ;
74
78
const [ objectStates , setObjectStates ] = useState < { [ key : string ] : boolean } > (
75
79
{ }
76
80
) ;
77
81
const [ shouldResetCheckboxes , setShouldResetCheckboxes ] = useState ( false ) ;
78
- const [ status , setStatus ] = useState < { [ key : string ] : ColumnCurrentDataQualityStatusModel } > ( { } )
79
- const [ columns , setColumns ] = useState < ColumnListModel [ ] > ( [ ] )
82
+ const [ status , setStatus ] = useState < {
83
+ [ key : string ] : ColumnCurrentDataQualityStatusModel ;
84
+ } > ( { } ) ;
85
+ const [ columns , setColumns ] = useState < ColumnListModel [ ] > ( [ ] ) ;
80
86
81
87
const handleButtonClick = ( name : string ) => {
82
88
setObjectStates ( ( prevStates ) => ( {
@@ -275,15 +281,26 @@ const TableColumns = ({
275
281
</ div >
276
282
) ;
277
283
}
278
- const handleSorting = ( data : MyData [ ] ) => {
279
- const arr = [ ...data ]
284
+ const handleSorting = ( data : MyData [ ] ) => {
285
+ const arr = [ ...data ] ;
280
286
setSortedArray ( arr ) ;
281
- }
287
+ } ;
282
288
283
289
useEffect ( ( ) => {
284
- CheckResultApi . getTableDataQualityStatus ( connectionName , schemaName , tableName , undefined , undefined , checkTypes === CheckTypes . PROFILING ? true : undefined ) . then ( ( res ) => setStatus ( res . data . columns ?? { } ) ) ;
285
- ColumnApiClient . getColumns ( connectionName , schemaName , tableName ) . then ( ( res ) => setColumns ( res . data ) )
286
- } , [ connectionName , schemaName , tableName ] ) ;
290
+ CheckResultApi . getTableDataQualityStatus (
291
+ connectionName ,
292
+ schemaName ,
293
+ tableName ,
294
+ undefined ,
295
+ undefined ,
296
+ checkTypes === CheckTypes . PROFILING ? true : undefined ,
297
+ checkTypes === CheckTypes . MONITORING ? true : undefined ,
298
+ checkTypes === CheckTypes . PARTITIONED ? true : undefined
299
+ ) . then ( ( res ) => setStatus ( res . data . columns ?? { } ) ) ;
300
+ ColumnApiClient . getColumns ( connectionName , schemaName , tableName ) . then (
301
+ ( res ) => setColumns ( res . data )
302
+ ) ;
303
+ } , [ checkTypes , connectionName , schemaName , tableName ] ) ;
287
304
288
305
return (
289
306
< div className = "p-4 relative" >
0 commit comments