@@ -191,84 +191,99 @@ export const Table: React.FC<TableProps> = ({
191191 : locationPath . pathname . split ( '/' ) [ 4 ] ;
192192 const checkForLocationPath = locationPath . pathname . split ( '/' ) [ 4 ] ;
193193 useEffect ( ( ) => {
194- // console.log(locationPath.pathname.split('/')[4] , 'locationPath1');
194+ // console.log(checkValidFilter , 'locationPath1');
195195 setItemPerPage ( itemPerPage ) ;
196196 if ( filters ) {
197197 setPageIndex ( 0 ) ;
198198 }
199- if ( checkValidFilter || activeSorting || checkForLocationPath ) {
200- switch ( componentName ) {
201- case 'stacks' :
202- if ( CheckIfRun ) {
203- dispatchStackRunsData (
204- id ,
205- 1 ,
206- itemPerPage ,
207- filters as any ,
208- activeSorting ,
209- ) ;
210- break ;
211- } else {
212- dispatchStackData ( 1 , itemPerPage , filters as any , activeSorting ) ;
213- break ;
214- }
215- case 'components' :
216- if ( CheckIfRun ) {
217- dispatchStackComponentRunsData (
218- id ,
219- 1 ,
220- itemPerPage ,
221- filters as any ,
222- activeSorting ,
223- ) ;
224- break ;
225- } else {
226- dispatchStackComponentsData (
227- 1 ,
228- itemPerPage ,
229- filters as any ,
230- activeSorting ,
231- ) ;
232- break ;
233- }
234- case 'pipelines' :
235- if ( CheckIfRun ) {
236- dispatchPipelineRunsData (
237- id ,
238- 1 ,
239- itemPerPage ,
240- filters as any ,
241- activeSorting ,
242- ) ;
243- break ;
244- } else {
245- console . log ( itemPerPage , 'itemPerPage' ) ;
246- if ( ! renderAfterRow ) break ;
247- dispatchPipelineData ( 1 , itemPerPage , filters as any , activeSorting ) ;
248- break ;
249- }
250-
251- case 'all-runs' :
252- dispatchAllrunsData ( 1 , itemPerPage , filters as any , activeSorting ) ;
199+ // if (checkValidFilter || activeSorting) {
200+ switch ( componentName ) {
201+ case 'stacks' :
202+ if ( CheckIfRun ) {
203+ dispatchStackRunsData (
204+ id ,
205+ 1 ,
206+ itemPerPage ,
207+ checkValidFilter . length ? ( filters as any ) : [ ] ,
208+ activeSorting ,
209+ ) ;
253210 break ;
254-
255- default :
211+ } else {
212+ dispatchStackData (
213+ 1 ,
214+ itemPerPage ,
215+ checkValidFilter . length ? ( filters as any ) : [ ] ,
216+ activeSorting ,
217+ ) ;
218+ break ;
219+ }
220+ case 'components' :
221+ if ( CheckIfRun ) {
222+ dispatchStackComponentRunsData (
223+ id ,
224+ 1 ,
225+ itemPerPage ,
226+ checkValidFilter . length ? ( filters as any ) : [ ] ,
227+ activeSorting ,
228+ ) ;
229+ break ;
230+ } else {
231+ dispatchStackComponentsData (
232+ 1 ,
233+ itemPerPage ,
234+ checkValidFilter . length ? ( filters as any ) : [ ] ,
235+ activeSorting ,
236+ ) ;
237+ break ;
238+ }
239+ case 'pipelines' :
240+ if ( CheckIfRun ) {
241+ dispatchPipelineRunsData (
242+ id ,
243+ 1 ,
244+ itemPerPage ,
245+ checkValidFilter . length ? ( filters as any ) : [ ] ,
246+ activeSorting ,
247+ ) ;
256248 break ;
257- }
258- if ( locationPath . pathname . split ( '/' ) [ 2 ] === 'organization' ) {
259- // debugger;
260- setFetchingMembers ( true ) ;
261- dispatch (
262- organizationActions . getMembers ( {
263- page : 1 ,
264- size : ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE ,
265- sort_by : activeSorting ,
266- onSuccess : ( ) => setFetchingMembers ( false ) ,
267- onFailure : ( ) => setFetchingMembers ( false ) ,
268- } ) ,
249+ } else {
250+ console . log ( checkValidFilter , 'checkValidFilter' ) ;
251+ if ( ! renderAfterRow ) break ;
252+ dispatchPipelineData (
253+ 1 ,
254+ itemPerPage ,
255+ checkValidFilter . length ? ( filters as any ) : [ ] ,
256+ activeSorting ,
257+ ) ;
258+ break ;
259+ }
260+
261+ case 'all-runs' :
262+ dispatchAllrunsData (
263+ 1 ,
264+ itemPerPage ,
265+ checkValidFilter . length ? ( filters as any ) : [ ] ,
266+ activeSorting ,
269267 ) ;
270- }
268+ break ;
269+
270+ default :
271+ break ;
272+ }
273+ if ( locationPath . pathname . split ( '/' ) [ 2 ] === 'organization' ) {
274+ // debugger;
275+ setFetchingMembers ( true ) ;
276+ dispatch (
277+ organizationActions . getMembers ( {
278+ page : 1 ,
279+ size : ITEMS_PER_PAGE ? ITEMS_PER_PAGE : DEFAULT_ITEMS_PER_PAGE ,
280+ sort_by : activeSorting ,
281+ onSuccess : ( ) => setFetchingMembers ( false ) ,
282+ onFailure : ( ) => setFetchingMembers ( false ) ,
283+ } ) ,
284+ ) ;
271285 }
286+ // }
272287
273288 // eslint-disable-next-line react-hooks/exhaustive-deps
274289 } , [ checkForLocationPath , checkValidFilter , activeSorting ] ) ;
0 commit comments