@@ -456,7 +456,7 @@ const EditComponent = () => {
456456 }
457457 }
458458 ) ;
459- const [ paginationModel ] = useState ( { page : 0 , pageSize : 10 } ) ;
459+ const [ paginationModel , setPaginationModel ] = useState ( { page : 0 , pageSize : 10 } ) ;
460460
461461 const UploadActionType = {
462462 IMPORT : "import" ,
@@ -669,6 +669,7 @@ const EditComponent = () => {
669669 /* ------------------------- form history variables ------------------------- */
670670 const [ isNewVersionLoading , setIsNewVersionLoading ] = useState ( false ) ;
671671 const [ restoreFormDataLoading , setRestoreFormDataLoading ] = useState ( false ) ;
672+
672673 const {
673674 formHistoryData = { } ,
674675 restoredFormId,
@@ -1235,12 +1236,14 @@ const saveFormWithWorkflow = async () => {
12351236 // setShowHistoryModal(false);
12361237 // };
12371238 const fetchFormHistory = ( parentFormId , page , limit ) => {
1239+ setFormHistoryLoading ( true ) ;
12381240 parentFormId = parentFormId && typeof parentFormId === 'string' ? parentFormId : processListData ?. parentFormId ;
12391241 page = page ? page : paginationModel . page + 1 ;
12401242 limit = limit ? limit : paginationModel . pageSize ;
12411243 getFormHistory ( parentFormId , page , limit )
12421244 . then ( ( res ) => {
12431245 dispatch ( setFormHistories ( res . data ) ) ;
1246+ setFormHistoryLoading ( false ) ;
12441247 } )
12451248 . catch ( ( ) => {
12461249 setFormHistories ( [ ] ) ;
@@ -1267,16 +1270,7 @@ const saveFormWithWorkflow = async () => {
12671270 return ;
12681271 }
12691272 setBpmnHistoryData ( { processHistory : [ ] , totalCount : 0 } ) ;
1270- if ( processData ?. parentProcessKey ) {
1271- fetchBpmnHistory ( processData . parentProcessKey , 1 , 4 ) ;
1272- }
12731273 setFlowHistoryLoading ( true ) ;
1274- // setShowBpmnHistoryModal(true);
1275- // setBpmnHistoryData({ processHistory: [], totalCount: 0 });
1276- // if (processData?.parentProcessKey) {
1277- // fetchBpmnHistory(processData.parentProcessKey, paginationModel.page + 1,
1278- // paginationModel.pageSize);
1279- // }
12801274 fetchBpmnHistory ( parentKey , paginationModel . page + 1 , paginationModel . pageSize ) ;
12811275 } ;
12821276
@@ -1314,8 +1308,6 @@ const saveFormWithWorkflow = async () => {
13141308 }
13151309 } ;
13161310
1317-
1318-
13191311 const revertFormBtnAction = ( cloneId ) => {
13201312 dispatch ( setRestoreFormId ( cloneId ) ) ;
13211313 fetchRestoredFormData ( cloneId ) ;
@@ -1932,7 +1924,7 @@ const saveFormWithWorkflow = async () => {
19321924 revertBtnAction = { revertFormBtnAction }
19331925 historyCount = { formHistoryData . totalCount }
19341926 disableAllRevertButton = { isPublished }
1935- loading = { false }
1927+ loading = { formHistoryLoading }
19361928 refreshBtnAction = { fetchFormHistory }
19371929 paginationModel = { paginationModel }
19381930 handlePaginationModelChange = { handlePaginationModelChange }
0 commit comments