Fix security vulnerabilities

Issue-ID: SDC-3634
Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
Change-Id: I2ad864179cea8021773a9ea80953d995d75d36d0
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelReducer.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelReducer.js
index f102d28..05c6654 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/LicenseModelReducer.js
@@ -90,7 +90,8 @@
                             errorText: '',
                             validations: [
                                 { type: 'required', data: true },
-                                { type: 'maxLength', data: 1000 }
+                                { type: 'maxLength', data: 1000 },
+                                { type: 'validateName', data: true }
                             ]
                         }
                     }
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreationReducer.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreationReducer.js
index 5922a47..cbd192d 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreationReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/creation/LicenseModelCreationReducer.js
@@ -32,7 +32,8 @@
                         errorText: '',
                         validations: [
                             { type: 'required', data: true },
-                            { type: 'maxLength', data: 1000 }
+                            { type: 'maxLength', data: 1000 },
+                            { type: 'validateName', data: true }
                         ]
                     },
                     vendorName: {
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorReducer.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorReducer.js
index 674a8eb..c66cbbc 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/EntitlementPoolsEditorReducer.js
@@ -48,13 +48,17 @@
                         errorText: '',
                         validations: [
                             { type: 'required', data: true },
-                            { type: 'maxLength', data: 120 }
+                            { type: 'maxLength', data: 120 },
+                            { type: 'validateName', data: true }
                         ]
                     },
                     description: {
                         isValid: true,
                         errorText: '',
-                        validations: [{ type: 'maxLength', data: 1000 }]
+                        validations: [
+                            { type: 'maxLength', data: 1000 },
+                            { type: 'validateName', data: true }
+                        ]
                     },
                     type: {
                         isValid: true,
@@ -64,7 +68,10 @@
                     increments: {
                         isValid: true,
                         errorText: '',
-                        validations: [{ type: 'maxLength', data: 120 }]
+                        validations: [
+                            { type: 'maxLength', data: 120 },
+                            { type: 'validateName', data: true }
+                        ]
                     },
                     thresholdUnits: {
                         isValid: true,
@@ -91,7 +98,8 @@
                         errorText: '',
                         validations: [
                             { type: 'required', data: true },
-                            { type: 'maxLength', data: 100 }
+                            { type: 'maxLength', data: 100 },
+                            { type: 'validateName', data: true }
                         ]
                     }
                 },
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/components/FormContent.jsx b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/components/FormContent.jsx
index 9eb38de..cc8a6e8 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/components/FormContent.jsx
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/entitlementPools/components/FormContent.jsx
@@ -232,6 +232,7 @@
                     onChange={increments =>
                         onDataChanged({ increments }, SP_ENTITLEMENT_POOL_FORM)
                     }
+                    errorText={genericFieldInfo.increments.errorText}
                     label={i18n('Increments')}
                     value={increments}
                     data-test-id="create-ep-increments"
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsEditorReducer.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsEditorReducer.js
index f6b9a86..c2135ec 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsEditorReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/featureGroups/FeatureGroupsEditorReducer.js
@@ -32,7 +32,10 @@
                     description: {
                         isValid: true,
                         errorText: '',
-                        validations: [{ type: 'maxLength', data: 1000 }],
+                        validations: [
+                            { type: 'maxLength', data: 1000 },
+                            { type: 'validateName', data: true }
+                        ],
                         tabId:
                             FeatureGroupStateConstants
                                 .SELECTED_FEATURE_GROUP_TAB.GENERAL
@@ -40,7 +43,10 @@
                     partNumber: {
                         isValid: true,
                         errorText: '',
-                        validations: [{ type: 'required', data: true }],
+                        validations: [
+                            { type: 'required', data: true },
+                            { type: 'validateName', data: true }
+                        ],
                         tabId:
                             FeatureGroupStateConstants
                                 .SELECTED_FEATURE_GROUP_TAB.GENERAL
@@ -50,7 +56,8 @@
                         errorText: '',
                         validations: [
                             { type: 'required', data: true },
-                            { type: 'maxLength', data: 120 }
+                            { type: 'maxLength', data: 120 },
+                            { type: 'validateName', data: true }
                         ],
                         tabId:
                             FeatureGroupStateConstants
diff --git a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementEditorReducer.js b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementEditorReducer.js
index 03157cb..bca06a8 100644
--- a/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementEditorReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/licenseModel/licenseAgreement/LicenseAgreementEditorReducer.js
@@ -32,7 +32,10 @@
                     description: {
                         isValid: true,
                         errorText: '',
-                        validations: [{ type: 'maxLength', data: 1000 }],
+                        validations: [
+                            { type: 'maxLength', data: 1000 },
+                            { type: 'validateName', data: true }
+                        ],
                         tabId:
                             LicenseAgreementEnums.SELECTED_LICENSE_AGREEMENT_TAB
                                 .GENERAL
@@ -56,7 +59,8 @@
                         errorText: '',
                         validations: [
                             { type: 'required', data: true },
-                            { type: 'maxLength', data: 25 }
+                            { type: 'maxLength', data: 25 },
+                            { type: 'validateName', data: true }
                         ],
                         tabId:
                             LicenseAgreementEnums.SELECTED_LICENSE_AGREEMENT_TAB
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 6895316..d3af8be 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 @@
                     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 @@
                     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 @@
                     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 2486428..fe7873f 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 @@
                             LKG_FORM_NAME
                         )
                     }
+                    errorText={
+                        genericFieldInfo.manufacturerReferenceNumber.errorText
+                    }
                     label={i18n('Manufacturer Reference Number')}
                     value={manufacturerReferenceNumber}
                     data-test-id="create-ep-mrn"
@@ -219,6 +222,7 @@
                     onChange={increments =>
                         onDataChanged({ increments }, LKG_FORM_NAME)
                     }
+                    errorText={genericFieldInfo.increments.errorText}
                     label={i18n('Increments')}
                     value={increments}
                     data-test-id="create-ep-increments"
diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsReducer.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsReducer.js
index 1e4a0df..fb8dbe4 100644
--- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsReducer.js
+++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/details/SoftwareProductDetailsReducer.js
@@ -42,7 +42,10 @@
                     description: {
                         isValid: true,
                         errorText: '',
-                        validations: [{ type: 'required', data: true }]
+                        validations: [
+                            { type: 'validateName', data: true },
+                            { type: 'required', data: true }
+                        ]
                     }
                 },
                 data: action.response
diff --git a/openecomp-ui/test/softwareProduct/details/detailsView.test.js b/openecomp-ui/test/softwareProduct/details/detailsView.test.js
index 46983f5..136ecde 100644
--- a/openecomp-ui/test/softwareProduct/details/detailsView.test.js
+++ b/openecomp-ui/test/softwareProduct/details/detailsView.test.js
@@ -77,7 +77,7 @@
 			'description': {
 				isValid: true,
 				errorText: '',
-				validations: [{type: 'required', data: true}]
+				validations: [{type: 'validateName', data: true}, {type: 'required', data: true}]
 			}
 		};
 		qGenericFieldInfo = SchemaGenericFieldInfoFactory.build();
@@ -151,7 +151,7 @@
 					dataMap
 				}
 			},
-			finalizedLicenseModelList: finalizedLicenseModelList,			
+			finalizedLicenseModelList: finalizedLicenseModelList,
 			archivedLicenseModelList: [],
 			archivedSoftwareProductList: [],
 			licenseModel: {
diff --git a/openecomp-ui/test/softwareProduct/details/test.js b/openecomp-ui/test/softwareProduct/details/test.js
index 6050624..92390f6 100644
--- a/openecomp-ui/test/softwareProduct/details/test.js
+++ b/openecomp-ui/test/softwareProduct/details/test.js
@@ -67,8 +67,8 @@
 		await SoftwareProductActionHelper.fetchSoftwareProductList(store.dispatch);
 		await SoftwareProductActionHelper.fetchFinalizedSoftwareProductList(store.dispatch);
 		await SoftwareProductActionHelper.fetchArchivedSoftwareProductList(store.dispatch);
-		
-		expect(store.getState()).toEqual(expectedStore);		
+
+		expect(store.getState()).toEqual(expectedStore);
 	});
 
 	it('Add Software Product', () => {
@@ -116,7 +116,7 @@
 			'description': {
 				isValid: true,
 				errorText: '',
-				validations: [{type: 'required', data: true}]
+				validations: [{type: 'validateName', data: true}, {type: 'required', data: true}]
 			}
 		};
 		const expectedFormName = forms.VENDOR_SOFTWARE_PRODUCT_DETAILS;