diff --git a/portals/admin/src/main/webapp/source/src/app/components/Governance/Policies/ActionConfigDialog.jsx b/portals/admin/src/main/webapp/source/src/app/components/Governance/Policies/ActionConfigDialog.jsx index ddd658b0a71..f25ce940d40 100644 --- a/portals/admin/src/main/webapp/source/src/app/components/Governance/Policies/ActionConfigDialog.jsx +++ b/portals/admin/src/main/webapp/source/src/app/components/Governance/Policies/ActionConfigDialog.jsx @@ -34,6 +34,7 @@ import { Radio, Grid, Alert, + FormHelperText, } from '@mui/material'; import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined'; import { FormattedMessage, useIntl } from 'react-intl'; @@ -51,6 +52,7 @@ export default function ActionConfigDialog({ info: CONSTS.GOVERNANCE_ACTIONS.NOTIFY, }, }); + const [isSubmitted, setIsSubmitted] = useState(false); useEffect(() => { setFormState(editAction || { @@ -76,8 +78,11 @@ export default function ActionConfigDialog({ }; const handleSave = () => { - onSave(formState); - handleClose(); // Reset the form after saving + setIsSubmitted(true); + if (isValid()) { + onSave(formState); + handleClose(); // Reset the form after saving + } }; const isValid = () => { @@ -101,7 +106,11 @@ export default function ActionConfigDialog({ - + ))} + {isSubmitted && !formState.governedState && ( + + + + )}