diff --git a/forms-flow-web/src/components/Modals/ActionModal.js b/forms-flow-web/src/components/Modals/ActionModal.js index e9f1ffa5c..a3aee6c92 100644 --- a/forms-flow-web/src/components/Modals/ActionModal.js +++ b/forms-flow-web/src/components/Modals/ActionModal.js @@ -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 ( <> @@ -57,7 +69,7 @@ const ActionModal = React.memo( variant="secondary" size="sm" label="Duplicate" - disabled={published || !isMigrated} + disabled={!isMigrated} icon={} className="" dataTestid="duplicate-form-button" @@ -117,7 +129,7 @@ const ActionModal = React.memo( } diff --git a/forms-flow-web/src/components/Modeler/ProcessCreateEdit.js b/forms-flow-web/src/components/Modeler/ProcessCreateEdit.js index 8116149f5..a3cc84da1 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} + diagramType={diagramType} + isPublished={isPublished} />