From 0150433a94476f6a15030021eb4310bf9d929397 Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Fri, 27 Sep 2024 11:26:11 +0530 Subject: [PATCH 1/2] chore: added data cy attributes for orgs person form --- src/constants/formFields.js | 31 ++++++++++++------- .../CreateNewOrganization.jsx | 3 ++ .../CreateNewPerson/CreateNewPerson.jsx | 1 + 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/constants/formFields.js b/src/constants/formFields.js index 2ddcee06..9e25bb78 100644 --- a/src/constants/formFields.js +++ b/src/constants/formFields.js @@ -356,11 +356,12 @@ export const formFieldValue = [ mappedField, isEntitiesFetching, isExternalSourceFetching, + fieldName, }) => { return ( <> setIsPopoverOpen(open)} overlayClassName="event-popover" @@ -372,7 +373,9 @@ export const formFieldValue = [
<> -
+
{t('dashboard.organization.createNew.search.footlightSectionHeading')}
@@ -395,7 +398,7 @@ export const formFieldValue = [ form.setFieldValue(name, place?.value); setIsPopoverOpen(false); }} - data-cy={`div-${mappedField}-footlight-place-${index}`}> + data-cy={`div-${mappedField ?? fieldName}-footlight-place-${index}`}> {place?.label}
)) @@ -405,7 +408,9 @@ export const formFieldValue = [
-
+
{t('dashboard.organization.createNew.search.importsFromFootlight')}
@@ -427,7 +432,7 @@ export const formFieldValue = [ form.setFieldValue(name, place?.value); setIsPopoverOpen(false); }} - data-cy={`div-${mappedField}-footlight-place-${index}`}> + data-cy={`div-${mappedField ?? fieldName}-footlight-place-${index}`}> {place?.label}
)) @@ -436,7 +441,9 @@ export const formFieldValue = [ ))}
-
+
{t('dashboard.organization.createNew.search.artsDataSectionHeading')}
@@ -456,7 +463,7 @@ export const formFieldValue = [ form.setFieldValue(name, place?.uri); setIsPopoverOpen(false); }} - data-cy={`div-${mappedField}-artsdata-place-${index}`}> + data-cy={`div-${mappedField ?? fieldName}-artsdata-place-${index}`}> {place?.label}
)) @@ -477,7 +484,7 @@ export const formFieldValue = [ onClick={() => { setIsPopoverOpen(true); }} - data-cy={`input-${mappedField}`} + data-cy={`input-${mappedField ?? fieldName}`} /> {locationPlace && ( @@ -550,12 +557,13 @@ export const renderFormFields = ({ mappedField, t, validations, + fieldName, }) => { return ( <> {position === 'top' && datatype !== dataTypes.IMAGE &&

{userTips}

}