Fixed legacy token support
X-Lovable-Edit-ID: edt-7cc37f8e-ea94-42e8-8018-17d45b7893a3 Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
@@ -65,33 +65,55 @@ export function buildVarMap(ctx: LoadedContext): VarMap {
|
||||
const c = ctx.client;
|
||||
if (c) {
|
||||
m["client.name"] = c.name || "";
|
||||
m["clientName"] = c.name || "";
|
||||
m["client.address"] = fmtAddress(c);
|
||||
m["clientAddress"] = fmtAddress(c);
|
||||
m["client.address_line1"] = c.address_line1 || "";
|
||||
m["clientAddressLine1"] = c.address_line1 || "";
|
||||
m["client.address_line2"] = c.address_line2 || "";
|
||||
m["clientAddressLine2"] = c.address_line2 || "";
|
||||
m["client.city"] = c.city || "";
|
||||
m["client.state"] = c.state || "";
|
||||
m["client.postal_code"] = c.postal_code || "";
|
||||
m["client.contact_name"] = c.primary_contact_name || "";
|
||||
m["clientContactName"] = c.primary_contact_name || "";
|
||||
m["client.contact_email"] = c.primary_contact_email || "";
|
||||
m["clientContactEmail"] = c.primary_contact_email || "";
|
||||
m["client.contact_phone"] = c.primary_contact_phone || "";
|
||||
m["clientContactPhone"] = c.primary_contact_phone || "";
|
||||
m["client.management_company"] = c.management_company || "";
|
||||
m["managementCompany"] = c.management_company || "";
|
||||
}
|
||||
const k = ctx.cases;
|
||||
if (k) {
|
||||
m["case.number"] = k.case_number || "";
|
||||
m["caseNumber"] = k.case_number || "";
|
||||
m["case.title"] = k.title || "";
|
||||
m["caseTitle"] = k.title || "";
|
||||
m["case.caption"] = k.case_caption || "";
|
||||
m["caseCaption"] = k.case_caption || "";
|
||||
m["case.court"] = k.court || "";
|
||||
m["court"] = k.court || "";
|
||||
m["case.court_case_number"] = k.court_case_number || "";
|
||||
m["courtCaseNumber"] = k.court_case_number || "";
|
||||
m["case.judge"] = k.judge || "";
|
||||
m["judge"] = k.judge || "";
|
||||
m["case.jurisdiction"] = k.jurisdiction || "";
|
||||
m["jurisdiction"] = k.jurisdiction || "";
|
||||
m["case.opposing_party"] = k.opposing_party || "";
|
||||
m["opposingParty"] = k.opposing_party || "";
|
||||
m["case.opposing_counsel"] = k.opposing_counsel || "";
|
||||
m["opposingCounsel"] = k.opposing_counsel || "";
|
||||
m["case.opposing_counsel_firm"] = k.opposing_counsel_firm || "";
|
||||
m["opposingCounselFirm"] = k.opposing_counsel_firm || "";
|
||||
m["case.opposing_counsel_email"] = k.opposing_counsel_email || "";
|
||||
m["opposingCounselEmail"] = k.opposing_counsel_email || "";
|
||||
m["case.opposing_counsel_phone"] = k.opposing_counsel_phone || "";
|
||||
m["opposingCounselPhone"] = k.opposing_counsel_phone || "";
|
||||
m["case.filing_date"] = k.filing_date || "";
|
||||
m["filingDate"] = k.filing_date || "";
|
||||
m["case.next_hearing_date"] = k.next_hearing_date || "";
|
||||
m["nextHearingDate"] = k.next_hearing_date || "";
|
||||
}
|
||||
ctx.clientFields.forEach((f) => {
|
||||
m[`client.field.${f.key}`] = f.value;
|
||||
@@ -110,22 +132,39 @@ export function buildChips(ctx: LoadedContext): VarChip[] {
|
||||
const out: VarChip[] = [];
|
||||
const labelMap: Record<string, string> = {
|
||||
"client.name": "Client name",
|
||||
clientName: "Client name",
|
||||
"client.address": "Client address (full)",
|
||||
clientAddress: "Client address (full)",
|
||||
"client.contact_name": "Client primary contact",
|
||||
clientContactName: "Client primary contact",
|
||||
"client.contact_email": "Client contact email",
|
||||
clientContactEmail: "Client contact email",
|
||||
"client.contact_phone": "Client contact phone",
|
||||
clientContactPhone: "Client contact phone",
|
||||
"client.management_company": "Management company",
|
||||
managementCompany: "Management company",
|
||||
"case.number": "Case number",
|
||||
caseNumber: "Case number",
|
||||
"case.title": "Case title",
|
||||
caseTitle: "Case title",
|
||||
"case.caption": "Case caption",
|
||||
caseCaption: "Case caption",
|
||||
"case.court": "Court",
|
||||
court: "Court",
|
||||
"case.court_case_number": "Court case number",
|
||||
courtCaseNumber: "Court case number",
|
||||
"case.judge": "Judge",
|
||||
judge: "Judge",
|
||||
"case.opposing_party": "Opposing party",
|
||||
opposingParty: "Opposing party",
|
||||
"case.opposing_counsel": "Opposing counsel",
|
||||
opposingCounsel: "Opposing counsel",
|
||||
"case.opposing_counsel_firm": "Opposing counsel firm",
|
||||
opposingCounselFirm: "Opposing counsel firm",
|
||||
"case.filing_date": "Filing date",
|
||||
filingDate: "Filing date",
|
||||
"case.next_hearing_date": "Next hearing date",
|
||||
nextHearingDate: "Next hearing date",
|
||||
};
|
||||
for (const key of Object.keys(m)) {
|
||||
let label = labelMap[key];
|
||||
|
||||
Reference in New Issue
Block a user