@@ -162,10 +162,13 @@ export const Table: React.FC<TableProps> = ({
162162 // itemsPerPage: itemPerPage,
163163 // items: tableRows,
164164 // });
165+ const validFilters = filters ?. filter ( ( item ) => item . value ) ;
166+ console . log ( 'checkFilter' , validFilters , filters ) ;
165167
166168 const isValidFilterFroValue : any = filters ?. map ( ( f ) => f . value ) . join ( '' ) ;
167- const isValidFilterForCategory : any =
168- isValidFilterFroValue && filters ?. map ( ( f ) => f . type . value ) . join ( '' ) ;
169+ const isValidFilterForCategory : any = filters
170+ ?. map ( ( f ) => f . value && f . type . value )
171+ . join ( '' ) ;
169172 const checkValidFilter = isValidFilterFroValue + isValidFilterForCategory ;
170173
171174 const { dispatchStackData } = callActionForStacksForPagination ( ) ;
@@ -204,15 +207,15 @@ export const Table: React.FC<TableProps> = ({
204207 id ,
205208 1 ,
206209 itemPerPage ,
207- checkValidFilter . length ? ( filters as any ) : [ ] ,
210+ checkValidFilter . length ? ( validFilters as any ) : [ ] ,
208211 activeSorting ,
209212 ) ;
210213 break ;
211214 } else {
212215 dispatchStackData (
213216 1 ,
214217 itemPerPage ,
215- checkValidFilter . length ? ( filters as any ) : [ ] ,
218+ checkValidFilter . length ? ( validFilters as any ) : [ ] ,
216219 activeSorting ,
217220 ) ;
218221 break ;
@@ -223,15 +226,15 @@ export const Table: React.FC<TableProps> = ({
223226 id ,
224227 1 ,
225228 itemPerPage ,
226- checkValidFilter . length ? ( filters as any ) : [ ] ,
229+ checkValidFilter . length ? ( validFilters as any ) : [ ] ,
227230 activeSorting ,
228231 ) ;
229232 break ;
230233 } else {
231234 dispatchStackComponentsData (
232235 1 ,
233236 itemPerPage ,
234- checkValidFilter . length ? ( filters as any ) : [ ] ,
237+ checkValidFilter . length ? ( validFilters as any ) : [ ] ,
235238 activeSorting ,
236239 ) ;
237240 break ;
@@ -242,17 +245,17 @@ export const Table: React.FC<TableProps> = ({
242245 id ,
243246 1 ,
244247 itemPerPage ,
245- checkValidFilter . length ? ( filters as any ) : [ ] ,
248+ checkValidFilter . length ? ( validFilters as any ) : [ ] ,
246249 activeSorting ,
247250 ) ;
248251 break ;
249252 } else {
250- console . log ( checkValidFilter , 'checkValidFilter' ) ;
253+ // console.log(checkValidFilter, 'checkValidFilter');
251254 if ( ! renderAfterRow ) break ;
252255 dispatchPipelineData (
253256 1 ,
254257 itemPerPage ,
255- checkValidFilter . length ? ( filters as any ) : [ ] ,
258+ checkValidFilter . length ? ( validFilters as any ) : [ ] ,
256259 activeSorting ,
257260 ) ;
258261 break ;
@@ -262,7 +265,7 @@ export const Table: React.FC<TableProps> = ({
262265 dispatchAllrunsData (
263266 1 ,
264267 itemPerPage ,
265- checkValidFilter . length ? ( filters as any ) : [ ] ,
268+ checkValidFilter . length ? ( validFilters as any ) : [ ] ,
266269 activeSorting ,
267270 ) ;
268271 break ;
@@ -302,12 +305,12 @@ export const Table: React.FC<TableProps> = ({
302305 if ( fetchingMembers ) {
303306 return < FullWidthSpinner color = "black" size = "md" /> ;
304307 }
305- console . log ( fetchingMembers , activeSorting , 'fetchingMembers' ) ;
308+ // console.log(fetchingMembers, activeSorting, 'fetchingMembers');
306309 const onChangePagePerItem = ( p : number , size : number ) => {
307310 // onChange(p + 1, size);
308311 setItemPerPage ( size ) ;
309312 } ;
310- console . log ( 'pages11' , itemPerPage , ITEMS_PER_PAGE ) ;
313+ // console.log('pages11', itemPerPage, ITEMS_PER_PAGE);
311314 return (
312315 < FlexBox . Column className = { styles . tableWrapper } fullWidth >
313316 < IfElse
@@ -392,7 +395,7 @@ export const Table: React.FC<TableProps> = ({
392395 ref = { childRef }
393396 // getFetchedState={getFetchedState}
394397 activeSorting = { activeSorting }
395- filters = { filters }
398+ filters = { validFilters }
396399 itemPerPage = { itemPerPage }
397400 pageIndex = { pageIndex }
398401 setPageIndex = { setPageIndex }
@@ -473,7 +476,7 @@ export const Table: React.FC<TableProps> = ({
473476 childRef ?. current ?. callOnChange (
474477 1 ,
475478 parseInt ( `${ option } ` ) ,
476- filters ,
479+ validFilters ,
477480 activeSorting ,
478481 ) ;
479482 setShowItems ( false ) ;
@@ -509,7 +512,7 @@ export const Table: React.FC<TableProps> = ({
509512 </ FlexBox >
510513 ) }
511514 </ If >
512- { console . log ( paginated , 'paginated' ) }
515+ { /* { console.log(paginated, 'paginated')} */ }
513516 </ >
514517 ) }
515518 renderWhenFalse = { ( ) => (
0 commit comments