From cba52c9e6c67ae2ee723c76f0c9ed165b657df63 Mon Sep 17 00:00:00 2001 From: aribeiro Date: Mon, 12 Jul 2021 15:10:19 +0100 Subject: Fix security vulnerabilities Issue-ID: SDC-3634 Signed-off-by: aribeiro Change-Id: I2ad864179cea8021773a9ea80953d995d75d36d0 --- .../licenseKeyGroups/LicenseKeyGroupsEditorReducer.js | 18 ++++++++++++++---- .../licenseKeyGroups/components/FormContent.jsx | 4 ++++ 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups') diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorReducer.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorReducer.js index 68953169c1..d3af8bea5c 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorReducer.js +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/LicenseKeyGroupsEditorReducer.js @@ -49,14 +49,18 @@ export default (state = {}, action) => { description: { isValid: true, errorText: '', - validations: [{ type: 'maxLength', data: 1000 }] + validations: [ + { type: 'maxLength', data: 1000 }, + { type: 'validateName', data: true } + ] }, name: { isValid: true, errorText: '', validations: [ { type: 'required', data: true }, - { type: 'maxLength', data: 120 } + { type: 'maxLength', data: 120 }, + { type: 'validateName', data: true } ] }, type: { @@ -77,7 +81,10 @@ export default (state = {}, action) => { increments: { isValid: true, errorText: '', - validations: [{ type: 'maxLength', data: 120 }] + validations: [ + { type: 'maxLength', data: 120 }, + { type: 'validateName', data: true } + ] }, startDate: { isValid: true, @@ -92,7 +99,10 @@ export default (state = {}, action) => { manufacturerReferenceNumber: { isValid: true, errorText: '', - validations: [{ type: 'maxLength', data: 100 }] + validations: [ + { type: 'maxLength', data: 100 }, + { type: 'validateName', data: true } + ] } } }; diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/components/FormContent.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/components/FormContent.jsx index 24864289e1..fe7873ff2e 100644 --- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/components/FormContent.jsx +++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseKeyGroups/components/FormContent.jsx @@ -207,6 +207,9 @@ const LicenseKeyGroupFormContent = ({ LKG_FORM_NAME ) } + errorText={ + genericFieldInfo.manufacturerReferenceNumber.errorText + } label={i18n('Manufacturer Reference Number')} value={manufacturerReferenceNumber} data-test-id="create-ep-mrn" @@ -219,6 +222,7 @@ const LicenseKeyGroupFormContent = ({ onChange={increments => onDataChanged({ increments }, LKG_FORM_NAME) } + errorText={genericFieldInfo.increments.errorText} label={i18n('Increments')} value={increments} data-test-id="create-ep-increments" -- cgit 1.2.3-korg