From bb839b3cdc09f15ed7dc1c3628fc2dbe83dde3a4 Mon Sep 17 00:00:00 2001 From: alaa-yahia Date: Mon, 20 Jan 2025 11:04:55 +0200 Subject: [PATCH] fix: prevent saving in profile widget when validation errors are present --- .../components/WidgetProfile/DataEntry/dataEntry.actions.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core_modules/capture-core/components/WidgetProfile/DataEntry/dataEntry.actions.js b/src/core_modules/capture-core/components/WidgetProfile/DataEntry/dataEntry.actions.js index f326ab200c..dccc04badc 100644 --- a/src/core_modules/capture-core/components/WidgetProfile/DataEntry/dataEntry.actions.js +++ b/src/core_modules/capture-core/components/WidgetProfile/DataEntry/dataEntry.actions.js @@ -19,6 +19,7 @@ import { loadNewDataEntry } from '../../DataEntry/actions/dataEntryLoadNew.actio import { rulesExecutedPostUpdateField } from '../../DataEntry/actions/dataEntry.actions'; import { getRulesActionsForTEIAsync } from './ProgramRules'; import { addFormData } from '../../D2Form/actions/form.actions'; +import { updateFieldUIOnly } from '../../D2Form/FormBuilder/formBuilder.actions'; import type { Geometry } from './helpers/types'; import type { QuerySingleResource } from '../../../utils/api'; @@ -112,12 +113,14 @@ export const getUpdateFieldActions = async ({ querySingleResource, onGetValidationContext, }); + const updateFieldUIAction = updateFieldUIOnly(uiState, elementId, formId); return batchActions( [ innerAction, rulesActions, rulesExecutedPostUpdateField(dataEntryId, itemId, uid), + updateFieldUIAction, ], dataEntryActionTypes.UPDATE_FIELD_PROFILE_ACTION_BATCH, );