Compare commits

...

1 Commits

2 changed files with 17 additions and 3 deletions
+16 -2
View File
@@ -76,6 +76,20 @@ function mapRatingNameToInterest(
return null;
}
function formatOpportunityContactName(
firstName?: string | null,
lastName?: string | null
): string {
const first = (firstName ?? "").trim();
const last = (lastName ?? "").trim();
if (first && last.toLowerCase() === "contact") {
return first;
}
return `${first} ${last}`.trim();
}
/**
* Opportunity Controller
*
@@ -290,7 +304,7 @@ export class OpportunityController {
| null
| undefined;
this.contactName = (data as any).contactName ?? (contactRel
? `${contactRel.firstName} ${contactRel.lastName}`.trim()
? formatOpportunityContactName(contactRel.firstName, contactRel.lastName)
: null);
// Site
@@ -674,7 +688,7 @@ export class OpportunityController {
id: contact.id,
contact: {
id: contact.id,
name: `${contact.firstName} ${contact.lastName}`.trim(),
name: formatOpportunityContactName(contact.firstName, contact.lastName),
},
company: contact.company
? {
+1 -1
View File
@@ -46,7 +46,7 @@ export const contactTranslation: Translation<CwContact, ApiContact> = {
{
from: "lastName",
to: "lastName",
process: (value) => (value ? value : "Contact"),
process: (value) => (value ? value : ""),
},
{ from: "nickName", to: "nickname" },
{ from: "title", to: "title" },