From 8e9ce935913e9531c1385045d8f473fe4d35933e Mon Sep 17 00:00:00 2001 From: Abil P Raju <83952803+abilpraju-aot@users.noreply.github.com> Date: Wed, 15 Jan 2025 19:34:06 -0800 Subject: [PATCH 1/3] update process on edit fix (#2522) --- forms-flow-web/src/components/Modals/ImportProcess.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/forms-flow-web/src/components/Modals/ImportProcess.js b/forms-flow-web/src/components/Modals/ImportProcess.js index c686a4e31..5e05728ed 100644 --- a/forms-flow-web/src/components/Modals/ImportProcess.js +++ b/forms-flow-web/src/components/Modals/ImportProcess.js @@ -2,10 +2,11 @@ import React, { useState, useEffect } from "react"; import PropTypes from "prop-types"; import { ImportModal } from "@formsflow/components"; import FileService from "../../services/FileService"; -import { createProcess } from "../../apiManager/services/processServices"; +import { createProcess,updateProcess } from "../../apiManager/services/processServices"; import { useSelector, useDispatch } from "react-redux"; import { push } from "connected-react-router"; import { MULTITENANCY_ENABLED } from "../../constants/constants"; +import {setProcessData} from "../../actions/processActions"; const ImportProcess = React.memo(({ showModal, @@ -75,6 +76,12 @@ const ImportProcess = React.memo(({ if(!xml) return; if (processId) { // Update an existing process + const response = await updateProcess({ + id: processId, + data:xml, + type: fileType === ".bpmn" ? "bpmn" : "dmn" + }); + dispatch(setProcessData(response?.data)); setImportXml(xml); closeImport(); } else { From bf7746049aaa2cc4d4c597d99bcec78fa35cc828 Mon Sep 17 00:00:00 2001 From: Bonymol Baby <88372115+Bonymol-aot@users.noreply.github.com> Date: Wed, 15 Jan 2025 19:34:55 -0800 Subject: [PATCH 2/3] Fixed publish and migrate note issues, enabled duplicate option (#2523) * Fixed publish and migrate note issues, enabled duplicate option * Updated content text --- .../src/components/Modals/ActionModal.js | 18 ++++++++++++++---- .../components/Modeler/ProcessCreateEdit.js | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/forms-flow-web/src/components/Modals/ActionModal.js b/forms-flow-web/src/components/Modals/ActionModal.js index e9f1ffa5c..2ca6ecbb7 100644 --- a/forms-flow-web/src/components/Modals/ActionModal.js +++ b/forms-flow-web/src/components/Modals/ActionModal.js @@ -19,7 +19,8 @@ const ActionModal = React.memo( onAction, published, isCreate, - isMigrated + isMigrated, + diagramType }) => { const handleAction = (actionType) => { onAction(actionType); @@ -27,13 +28,21 @@ const ActionModal = React.memo( }; let customInfo = null; - if (published || !isMigrated) { + if (CategoryType === "FORM" && (published || !isMigrated)) { customInfo = { heading: "Note", content: ` - ${published ? "Importing and deleting is not available when the form is published. You must unpublish the form first if you wish to make any changes." : ""} + ${published ? `Importing and deleting is not available when the form is published. You must unpublish the form first if you wish to make any changes.` : ""} ${!isMigrated ? "\nSome actions are disabled as this form has not been migrated to the new 1 to 1 relationship structure. To migrate this form exit this popup and click \"Save layout\" or \"Save flow\"." : ""} `.trim(), + }; + } else if (CategoryType === "WORKFLOW" && published) { + customInfo = { + heading: "Note", + content: `Importing is not available when the ${diagramType} is published.` + + `You must unpublish the ${diagramType} first if you wish to make any changes.`.trim(), + + }; } @@ -57,7 +66,7 @@ const ActionModal = React.memo( variant="secondary" size="sm" label="Duplicate" - disabled={published || !isMigrated} + disabled={!isMigrated} icon={} className="" dataTestid="duplicate-form-button" @@ -154,6 +163,7 @@ ActionModal.propTypes = { published: PropTypes.bool.isRequired, isCreate: PropTypes.bool, isMigrated: PropTypes.bool, // Adding validation for isMigrated + diagramType: PropTypes.string, }; export default ActionModal; diff --git a/forms-flow-web/src/components/Modeler/ProcessCreateEdit.js b/forms-flow-web/src/components/Modeler/ProcessCreateEdit.js index 8116149f5..ec7e7b839 100644 --- a/forms-flow-web/src/components/Modeler/ProcessCreateEdit.js +++ b/forms-flow-web/src/components/Modeler/ProcessCreateEdit.js @@ -682,6 +682,8 @@ const ProcessCreateEdit = ({ type }) => { setSelectedAction(action); }} isCreate={isCreate} + published={isPublished} + diagramType={diagramType} /> Date: Thu, 16 Jan 2025 09:05:20 +0530 Subject: [PATCH 3/3] Fixed: logout button issue (#2524) --- forms-flow-web/src/components/PrivateRoute.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms-flow-web/src/components/PrivateRoute.jsx b/forms-flow-web/src/components/PrivateRoute.jsx index 5d1ceda3f..68b98a3db 100644 --- a/forms-flow-web/src/components/PrivateRoute.jsx +++ b/forms-flow-web/src/components/PrivateRoute.jsx @@ -160,8 +160,8 @@ const PrivateRoute = React.memo((props) => { if (!authenticated) { setAuthError(true); } else { - authenticate(instance, props.store); publish("FF_AUTH", instance); + authenticate(instance, props.store); } }); }