Skip to content

Commit

Permalink
Merge pull request #2525 from AOT-Technologies/release/7.0.0
Browse files Browse the repository at this point in the history
Release/7.0.0 changes to master
  • Loading branch information
arun-s-aot authored Jan 16, 2025
2 parents e4e18e1 + 90cb1b9 commit a5c880a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
18 changes: 14 additions & 4 deletions forms-flow-web/src/components/Modals/ActionModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,30 @@ const ActionModal = React.memo(
onAction,
published,
isCreate,
isMigrated
isMigrated,
diagramType
}) => {
const handleAction = (actionType) => {
onAction(actionType);
onClose();
};
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(),


};
}

Expand All @@ -57,7 +66,7 @@ const ActionModal = React.memo(
variant="secondary"
size="sm"
label="Duplicate"
disabled={published || !isMigrated}
disabled={!isMigrated}
icon={<DuplicateIcon color="#253DF4" />}
className=""
dataTestid="duplicate-form-button"
Expand Down Expand Up @@ -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;
9 changes: 8 additions & 1 deletion forms-flow-web/src/components/Modals/ImportProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions forms-flow-web/src/components/Modeler/ProcessCreateEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,8 @@ const ProcessCreateEdit = ({ type }) => {
setSelectedAction(action);
}}
isCreate={isCreate}
published={isPublished}
diagramType={diagramType}
/>

<ExportDiagram
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-web/src/components/PrivateRoute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}
Expand Down

0 comments on commit a5c880a

Please sign in to comment.