Skip to content

Commit

Permalink
feat: use address object for lead address (#867)
Browse files Browse the repository at this point in the history
* RM#89399
  • Loading branch information
gca-axelor authored Jan 16, 2025
1 parent c16d973 commit 136ba5f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
5 changes: 5 additions & 0 deletions changelogs/unreleased/89399.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "Lead: manage address through the address field",
"type": "feat",
"packages": "crm"
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const EventLeadCard = ({}) => {
style={styles.item}
leadsFullname={lead.simpleFullName}
leadsCompany={lead.enterpriseName}
leadsAddress={lead.primaryAddress}
leadsAddress={lead.address?.fullName}
leadsFixedPhone={lead.fixedPhone}
leadsPhoneNumber={lead.mobilePhone}
leadsEmail={lead.emailAddress?.address}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const LeadDropdownCards = ({}) => {
key: 1,
childrenComp: (
<DropdownContactView
address={lead.primaryAddress}
address={lead.address?.fullName}
fixedPhone={lead.fixedPhone}
mobilePhone={lead.mobilePhone}
emailAddress={lead.emailAddress?.address}
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/crm/src/hooks/use-crm-header-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const useLeadDetailsActions = () => {
fixedPhone: lead.fixedPhone,
email: lead.emailAddress?.address,
address: {
street: lead.primaryAddress,
street: lead.address?.fullName,
},
notes: lead.description,
}),
Expand Down
5 changes: 0 additions & 5 deletions packages/apps/crm/src/models/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ export const crm_formsRegister: FormConfigs = {
widget: 'custom',
customComponent: FunctionSearchBar,
},
primaryAddress: {
titleKey: 'Crm_Address',
type: 'string',
widget: 'default',
},
fixedPhone: {
titleKey: 'Crm_Phone',
type: 'phone',
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/crm/src/models/objectFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const crm_modelAPI: ObjectFields = {
firstName: schemaContructor.string(),
simpleFullName: schemaContructor.string(),
leadStatus: schemaContructor.subObject('name'),
primaryAddress: schemaContructor.string(),
address: schemaContructor.subObject('fullName'),
emailAddress: schemaContructor.subObject('address'),
mobilePhone: schemaContructor.string(),
fixedPhone: schemaContructor.string(),
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/crm/src/models/searchFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const crm_searchFields: SearchFields = {
crm_lead: [
'simpleFullName',
'enterpriseName',
'primaryAddress',
'address.fullName',
'mobilePhone',
'fixedPhone',
'emailAddress.name',
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/crm/src/screens/lead/LeadListScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const LeadListScreen = ({navigation}) => {
style={styles.item}
leadsFullname={item.simpleFullName}
leadsCompany={item.enterpriseName}
leadsAddress={item.primaryAddress}
leadsAddress={item.address?.fullName}
leadsFixedPhone={item.fixedPhone}
leadsPhoneNumber={item.mobilePhone}
leadsEmail={item.emailAddress?.address}
Expand Down

0 comments on commit 136ba5f

Please sign in to comment.