Skip to content

Commit c21b3a8

Browse files
FWF-5405: [Feature] Flow History Page merge changes
1 parent b6177cf commit c21b3a8

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

forms-flow-web/src/routes/Design/Forms/FlowEdit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React, {
88
import {
99
CustomButton,
1010
ConfirmModal,
11-
HistoryPage,
11+
// HistoryPage,
1212
// HistoryModal,
1313
//CurlyBracketsIcon,
1414
VariableSelection,
@@ -69,7 +69,6 @@ const FlowEdit = forwardRef(
6969
const bpmnRef = useRef();
7070
const processData = useSelector((state) => state.process?.processData);
7171
const [lintErrors, setLintErrors] = useState([]);
72-
const { createDesigns } = userRoles();
7372

7473
// Initialize default BPMN for create route
7574
const [defaultBpmnXml] = useState(() => {
@@ -80,6 +79,7 @@ const FlowEdit = forwardRef(
8079
});
8180
const [showDiscardModal, setShowDiscardModal] = useState(false);
8281
const [isReverted, setIsReverted] = useState(false);
82+
const { createDesigns } = userRoles();
8383
const [showVariableModal, setShowVariableModal] = useState(false);
8484
const [showUnsavedChangesModal, setShowUnsavedChangesModal] =
8585
useState(false);
@@ -471,7 +471,7 @@ const enableWorkflowChange = async () => {
471471
/>
472472
)}
473473

474-
<HistoryPage
474+
{/* <HistoryPage
475475
show={showHistoryModal}
476476
onClose={handleToggleHistoryModal}
477477
title={t("History")}

forms-flow-web/src/routes/Design/Forms/FormEdit.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)