@@ -12,7 +12,8 @@ import {
1212import { callActionForPipelineRunsForPagination } from '../../pipelines/PipelineDetail/useService' ;
1313import { callActionForStackRunsForPagination } from '../../stacks/StackDetail/useService' ;
1414import { callActionForStackComponentRunsForPagination } from '../../stackComponents/StackDetail/useService' ;
15- import { usePagination , DOTS } from '../../../hooks' ;
15+ import { usePagination , DOTS , useDispatch } from '../../../hooks' ;
16+ import { organizationActions } from '../../../../redux/actions' ;
1617// const PaginationItem = (props: {
1718// isActive: boolean;
1819// index: string;
@@ -73,7 +74,7 @@ export const Pagination: React.FC<Props> = forwardRef((props, ref) => {
7374 const {
7475 dispatchStackComponentsData,
7576 } = callActionForStackComponentsForPagination ( ) ;
76-
77+ const dispatch = useDispatch ( ) ;
7778 const { dispatchPipelineData } = callActionForPipelinesForPagination ( ) ;
7879 const { dispatchAllrunsData } = callActionForAllrunsForPagination ( ) ;
7980 const { dispatchPipelineRunsData } = callActionForPipelineRunsForPagination ( ) ;
@@ -92,7 +93,7 @@ export const Pagination: React.FC<Props> = forwardRef((props, ref) => {
9293 ? locationPath . pathname . split ( '/' ) [ 5 ]
9394 : locationPath . pathname . split ( '/' ) [ 4 ] ;
9495 // const isValidFilter = props.filters?.map((f) => f.value).join('');
95-
96+ // const [fetchingMembers, setFetchingMembers] = useState(true);
9697 useImperativeHandle ( ref , ( ) => ( {
9798 callOnChange ( page : number , size : number , filters : any , activeSorting : any ) {
9899 props . setPageIndex ( page - 1 ) ;
@@ -101,6 +102,9 @@ export const Pagination: React.FC<Props> = forwardRef((props, ref) => {
101102 } ,
102103 } ) ) ;
103104
105+ // eslint-disable-next-line react-hooks/exhaustive-deps
106+ // }, [fetchingMembers]);
107+
104108 const paginationRange = usePagination ( {
105109 currentPage : props . pageIndex + 1 ,
106110 totalCount : props . totalCount ,
@@ -166,6 +170,20 @@ export const Pagination: React.FC<Props> = forwardRef((props, ref) => {
166170 default :
167171 break ;
168172 }
173+
174+ if ( locationPath . pathname . split ( '/' ) [ 2 ] === 'organization' ) {
175+ // debugger;
176+ // setFetchingMembers(true);
177+ dispatch (
178+ organizationActions . getMembers ( {
179+ page : page ,
180+ size : size ,
181+ sort_by : activeSorting ,
182+ // onSuccess: () => setFetchingMembers(false),
183+ // onFailure: () => setFetchingMembers(false),
184+ } ) ,
185+ ) ;
186+ }
169187 } ;
170188 // console.log(itemPerPage, 'itemPerPage');
171189 const pageNumbers = [ ] ;
@@ -323,16 +341,7 @@ export const Pagination: React.FC<Props> = forwardRef((props, ref) => {
323341 } }
324342 icon = { icons . paginationLast }
325343 />
326-
327344 </ FlexBox >
328-
329-
330-
331-
332-
333-
334-
335-
336345 </ FlexBox . Column >
337346 ) ;
338347} ) ;
0 commit comments