From 1afcb4cd4649bf6f3cfd621fd96147140144525f Mon Sep 17 00:00:00 2001 From: alaa-yahia Date: Tue, 7 Jan 2025 02:16:24 +0200 Subject: [PATCH] chore: delete redundant validator --- i18n/en.pot | 7 ++----- .../categoryOptions.validatorContainersGetter.js | 2 +- .../DataEntry/fieldValidators/index.js | 1 - .../note.validatorContainersGetter.js | 14 -------------- 4 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 src/core_modules/capture-core/components/WidgetEventEdit/DataEntry/fieldValidators/note.validatorContainersGetter.js diff --git a/i18n/en.pot b/i18n/en.pot index ac41841fe7..509a2d0608 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-12-19T09:18:35.465Z\n" -"PO-Revision-Date: 2024-12-19T09:18:35.466Z\n" +"POT-Creation-Date: 2025-01-07T00:10:53.592Z\n" +"PO-Revision-Date: 2025-01-07T00:10:53.593Z\n" msgid "Choose one or more dates..." msgstr "Choose one or more dates..." @@ -1210,9 +1210,6 @@ msgstr "Add coordinates" msgid "Add area" msgstr "Add area" -msgid "Please selectoo {{categoryName}}" -msgstr "Please selectoo {{categoryName}}" - msgid "organisation unit could not be retrieved. Please try again later." msgstr "organisation unit could not be retrieved. Please try again later." diff --git a/src/core_modules/capture-core/components/WidgetEnrollmentEventNew/DataEntry/fieldValidators/categoryOptions.validatorContainersGetter.js b/src/core_modules/capture-core/components/WidgetEnrollmentEventNew/DataEntry/fieldValidators/categoryOptions.validatorContainersGetter.js index 8cf825ad1a..181fa34de5 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollmentEventNew/DataEntry/fieldValidators/categoryOptions.validatorContainersGetter.js +++ b/src/core_modules/capture-core/components/WidgetEnrollmentEventNew/DataEntry/fieldValidators/categoryOptions.validatorContainersGetter.js @@ -9,7 +9,7 @@ const validateCategories = (value?: ?string, props?: Object, fieldId?: string) = return { valid: hasValue(value), - errorMessage: i18n.t('Please selectoo {{categoryName}}', { categoryName }), + errorMessage: i18n.t('Please select {{categoryName}}', { categoryName }), }; }; diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/DataEntry/fieldValidators/index.js b/src/core_modules/capture-core/components/WidgetEventEdit/DataEntry/fieldValidators/index.js index 1d1e26c9a9..a205630880 100644 --- a/src/core_modules/capture-core/components/WidgetEventEdit/DataEntry/fieldValidators/index.js +++ b/src/core_modules/capture-core/components/WidgetEventEdit/DataEntry/fieldValidators/index.js @@ -1,5 +1,4 @@ // @flow export { getCategoryOptionsValidatorContainers } from './categoryOptions.validatorContainersGetter'; export { getEventDateValidatorContainers } from './eventDate.validatorContainersGetter'; -export { getNoteValidatorContainers } from './note.validatorContainersGetter'; export { getOrgUnitValidatorContainers } from './orgUnit.validatorContainersGetter'; diff --git a/src/core_modules/capture-core/components/WidgetEventEdit/DataEntry/fieldValidators/note.validatorContainersGetter.js b/src/core_modules/capture-core/components/WidgetEventEdit/DataEntry/fieldValidators/note.validatorContainersGetter.js deleted file mode 100644 index 046f671511..0000000000 --- a/src/core_modules/capture-core/components/WidgetEventEdit/DataEntry/fieldValidators/note.validatorContainersGetter.js +++ /dev/null @@ -1,14 +0,0 @@ -// @flow -import i18n from '@dhis2/d2-i18n'; - -const validateNote = (value?: ?string) => !value; - -export const getNoteValidatorContainers = () => { - const validatorContainers = [ - { - validator: validateNote, - errorMessage: i18n.t('Please add or cancel the note before saving the event'), - }, - ]; - return validatorContainers; -};