Skip to content

Commit

Permalink
FWF-4248: [Bugfix] Updated publish and migration note, Enabled duplic…
Browse files Browse the repository at this point in the history
…ate if publshed
  • Loading branch information
Bonymol-aot committed Jan 15, 2025
1 parent e4e18e1 commit 92e359e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 17 additions & 5 deletions forms-flow-web/src/components/Modals/ActionModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,37 @@ const ActionModal = React.memo(
onAction,
published,
isCreate,
isMigrated
isMigrated,
diagramType,
isPublished
}) => {
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" && isPublished) {
customInfo = {
heading: "Note",
content: `Importing and deleting is not available when the ${diagramType} is published.` +
`You must unpublish the ${diagramType} first if you wish to make any changes.`.trim(),


};
}



return (
<>
<Modal show={newActionModal} onHide={onClose} centered={true} size="sm">
Expand All @@ -57,7 +69,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 @@ -117,7 +129,7 @@ const ActionModal = React.memo(

<CustomButton
variant="secondary"
disabled={published}
disabled={isPublished}
size="sm"
label="Import"
icon={<ImportIcon />}
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}
diagramType={diagramType}
isPublished={isPublished}
/>

<ExportDiagram
Expand Down

0 comments on commit 92e359e

Please sign in to comment.