diff --git a/.changeset/2003-lead-case-empty-groups.md b/.changeset/2003-lead-case-empty-groups.md new file mode 100644 index 00000000..ea1a341a --- /dev/null +++ b/.changeset/2003-lead-case-empty-groups.md @@ -0,0 +1,24 @@ +--- +'hotcrm': patch +--- + +A lead's and a case's Details tab now keep the sections you are expected to fill on screen while they are empty + +A section with nothing filled in used to disappear from the Details tab. On a +new lead that carries only its required fields, that hid Contact Information, +Address and Additional Info, so there was no place to see, or fill in, the +lead's **Mobile**, **Website**, **Address**, **Annual Revenue**, **Number of +Employees**, **Description** or **Notes**. On a new case it hid Origin & +Routing, and with it **Case Origin**. + +These four sections now always show, with an empty row for each field. Address +and Additional Info still start collapsed: click the heading to open them. A +section that has at least one value looks the same as before, with its empty +fields behind **Show N empty fields**. The opportunity page already worked this +way. + +Sections that are filled in later, or by the app, still appear only once they +hold a value. On a lead that is Duplicate Management, which the duplicate check +fills in. On a case it is SLA & Priority, whose dates are recorded for you, and +Resolution, which **Close Case** records. Assignment is unchanged: the lead +owner is shown in the strip at the top of the page. diff --git a/src/sales/pages/lead_detail.page.ts b/src/sales/pages/lead_detail.page.ts index 447f47a7..e45cd08b 100644 --- a/src/sales/pages/lead_detail.page.ts +++ b/src/sales/pages/lead_detail.page.ts @@ -378,23 +378,36 @@ export const LeadDetailPage: Page = { // - it lays out its own column count (the page-level // `columns` above does not reach it); // - a group whose members are all empty renders nothing - // (`address` on a lead with no address); + // (`duplicates` on a clean lead), unless the section + // says `hideEmpty: false`; // - members the highlights strip registered are dropped, // so `assignment` (only `owner_id`) renders nothing on // this page — the owner is in the strip; // - a group declared `collapse: 'collapsed'` starts // collapsed; changing that is a `fieldGroups` decision // in lead.object.ts, not a key on this page. + // + // `hideEmpty: false` (#2003, the #1211 reasoning) sits on + // the groups whose every member a rep types and the + // create form asks for: `contact_info` (`mobile` and + // `website` once the strip takes `email` and `phone`), + // `address`, and `additional` (revenue, headcount, + // description, notes). Without it all three vanish on a + // fresh lead, so a rep cannot see what is left to fill. + // Not on `assignment`: its derived list is empty, and the + // renderer draws nothing for an empty list whatever + // `hideEmpty` says. Not on `duplicates`: the + // `lead_duplicate_check` hook writes it. sections: [ { group: 'identity' }, { group: 'company_info' }, - { group: 'contact_info' }, + { group: 'contact_info', hideEmpty: false }, // Do Not Call / Email Opt Out, right under the numbers // a rep is about to dial (#806). { group: 'preferences' }, { group: 'qualification' }, { group: 'assignment' }, - { group: 'address' }, + { group: 'address', hideEmpty: false }, { group: 'conversion' }, // The LINK half of the duplicate banners (#1207): the // group carries both survivor lookups, because @@ -405,7 +418,7 @@ export const LeadDetailPage: Page = { { group: 'duplicates' }, // Description and Notes — kept last, where the page's // Description section always sat. - { group: 'additional' }, + { group: 'additional', hideEmpty: false }, ], }, }, diff --git a/src/service/pages/case_detail.page.ts b/src/service/pages/case_detail.page.ts index 68165b08..8d73fa80 100644 --- a/src/service/pages/case_detail.page.ts +++ b/src/service/pages/case_detail.page.ts @@ -165,9 +165,18 @@ export const CaseDetailPage: Page = { // `resolution` / `resolved_by_article` render once the case // carries one; `close_case` is the flow that collects the // resolution. + // + // `hideEmpty: false` (#2003, the #1211 reasoning) only on + // `origin`: with `owner_id` in the strip, its one member is + // the channel an agent picks, and without the key the + // section vanishes on a new case. Not on `sla`: outside + // the strip its members are stamps no one types + // (`closed_date` and `resolution_time_hours` at close, + // `first_response_date` by `event.hook.ts`), so the key + // would draw empty rows to look at, not to fill. sections: [ { group: 'basic' }, - { group: 'origin' }, + { group: 'origin', hideEmpty: false }, { group: 'sla' }, { group: 'escalation' }, { group: 'resolution' },