@aglyn/plugins-crm 1.0.0-beta.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +7 -0
- package/package.json +57 -0
- package/src/index.d.ts +21 -0
- package/src/index.js +29 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/activity-list.d.ts +98 -0
- package/src/lib/components/activity-list.js +321 -0
- package/src/lib/components/activity-list.js.map +1 -0
- package/src/lib/components/activity-queries.d.ts +117 -0
- package/src/lib/components/activity-queries.js +198 -0
- package/src/lib/components/activity-queries.js.map +1 -0
- package/src/lib/components/add-to-list-button.d.ts +25 -0
- package/src/lib/components/add-to-list-button.js +64 -0
- package/src/lib/components/add-to-list-button.js.map +1 -0
- package/src/lib/components/add-to-list-dialog.d.ts +24 -0
- package/src/lib/components/add-to-list-dialog.js +327 -0
- package/src/lib/components/add-to-list-dialog.js.map +1 -0
- package/src/lib/components/assignment-rule-drawer.d.ts +43 -0
- package/src/lib/components/assignment-rule-drawer.js +293 -0
- package/src/lib/components/assignment-rule-drawer.js.map +1 -0
- package/src/lib/components/companies-bulk-bar.d.ts +29 -0
- package/src/lib/components/companies-bulk-bar.js +274 -0
- package/src/lib/components/companies-bulk-bar.js.map +1 -0
- package/src/lib/components/companies-section.d.ts +54 -0
- package/src/lib/components/companies-section.js +522 -0
- package/src/lib/components/companies-section.js.map +1 -0
- package/src/lib/components/company-contacts-card.d.ts +49 -0
- package/src/lib/components/company-contacts-card.js +435 -0
- package/src/lib/components/company-contacts-card.js.map +1 -0
- package/src/lib/components/company-deals-card.d.ts +20 -0
- package/src/lib/components/company-deals-card.js +38 -0
- package/src/lib/components/company-deals-card.js.map +1 -0
- package/src/lib/components/company-detail-page.d.ts +20 -0
- package/src/lib/components/company-detail-page.js +165 -0
- package/src/lib/components/company-detail-page.js.map +1 -0
- package/src/lib/components/company-edit-drawer.d.ts +65 -0
- package/src/lib/components/company-edit-drawer.js +433 -0
- package/src/lib/components/company-edit-drawer.js.map +1 -0
- package/src/lib/components/company-import-drawer.d.ts +42 -0
- package/src/lib/components/company-import-drawer.js +99 -0
- package/src/lib/components/company-import-drawer.js.map +1 -0
- package/src/lib/components/company-picker.d.ts +127 -0
- package/src/lib/components/company-picker.js +323 -0
- package/src/lib/components/company-picker.js.map +1 -0
- package/src/lib/components/company-properties-card.d.ts +47 -0
- package/src/lib/components/company-properties-card.js +289 -0
- package/src/lib/components/company-properties-card.js.map +1 -0
- package/src/lib/components/contact-address-fields.d.ts +29 -0
- package/src/lib/components/contact-address-fields.js +149 -0
- package/src/lib/components/contact-address-fields.js.map +1 -0
- package/src/lib/components/contact-associations-card.d.ts +72 -0
- package/src/lib/components/contact-associations-card.js +296 -0
- package/src/lib/components/contact-associations-card.js.map +1 -0
- package/src/lib/components/contact-custom-columns.d.ts +38 -0
- package/src/lib/components/contact-custom-columns.js +102 -0
- package/src/lib/components/contact-custom-columns.js.map +1 -0
- package/src/lib/components/contact-custom-fields-card.d.ts +39 -0
- package/src/lib/components/contact-custom-fields-card.js +204 -0
- package/src/lib/components/contact-custom-fields-card.js.map +1 -0
- package/src/lib/components/contact-deals-card.d.ts +20 -0
- package/src/lib/components/contact-deals-card.js +38 -0
- package/src/lib/components/contact-deals-card.js.map +1 -0
- package/src/lib/components/contact-detail-page.d.ts +46 -0
- package/src/lib/components/contact-detail-page.js +535 -0
- package/src/lib/components/contact-detail-page.js.map +1 -0
- package/src/lib/components/contact-duplicates-card.d.ts +42 -0
- package/src/lib/components/contact-duplicates-card.js +167 -0
- package/src/lib/components/contact-duplicates-card.js.map +1 -0
- package/src/lib/components/contact-field-drawer.d.ts +64 -0
- package/src/lib/components/contact-field-drawer.js +251 -0
- package/src/lib/components/contact-field-drawer.js.map +1 -0
- package/src/lib/components/contact-import-drawer.d.ts +46 -0
- package/src/lib/components/contact-import-drawer.js +149 -0
- package/src/lib/components/contact-import-drawer.js.map +1 -0
- package/src/lib/components/contact-known-by-card.d.ts +39 -0
- package/src/lib/components/contact-known-by-card.js +142 -0
- package/src/lib/components/contact-known-by-card.js.map +1 -0
- package/src/lib/components/contact-list-columns.d.ts +53 -0
- package/src/lib/components/contact-list-columns.js +288 -0
- package/src/lib/components/contact-list-columns.js.map +1 -0
- package/src/lib/components/contact-merge-dialog.d.ts +79 -0
- package/src/lib/components/contact-merge-dialog.js +405 -0
- package/src/lib/components/contact-merge-dialog.js.map +1 -0
- package/src/lib/components/contact-properties-card.d.ts +89 -0
- package/src/lib/components/contact-properties-card.js +492 -0
- package/src/lib/components/contact-properties-card.js.map +1 -0
- package/src/lib/components/contact-timeline-card.d.ts +68 -0
- package/src/lib/components/contact-timeline-card.js +435 -0
- package/src/lib/components/contact-timeline-card.js.map +1 -0
- package/src/lib/components/contacts-bulk-bar.d.ts +91 -0
- package/src/lib/components/contacts-bulk-bar.js +493 -0
- package/src/lib/components/contacts-bulk-bar.js.map +1 -0
- package/src/lib/components/contacts-section.d.ts +26 -0
- package/src/lib/components/contacts-section.js +1025 -0
- package/src/lib/components/contacts-section.js.map +1 -0
- package/src/lib/components/copy-capture-address-button.d.ts +33 -0
- package/src/lib/components/copy-capture-address-button.js +60 -0
- package/src/lib/components/copy-capture-address-button.js.map +1 -0
- package/src/lib/components/crm-attribution-zone.d.ts +38 -0
- package/src/lib/components/crm-attribution-zone.js +36 -0
- package/src/lib/components/crm-attribution-zone.js.map +1 -0
- package/src/lib/components/crm-booking-zone.d.ts +61 -0
- package/src/lib/components/crm-booking-zone.js +50 -0
- package/src/lib/components/crm-booking-zone.js.map +1 -0
- package/src/lib/components/crm-bulk-bar-frame.d.ts +47 -0
- package/src/lib/components/crm-bulk-bar-frame.js +137 -0
- package/src/lib/components/crm-bulk-bar-frame.js.map +1 -0
- package/src/lib/components/crm-call-actions.d.ts +65 -0
- package/src/lib/components/crm-call-actions.js +110 -0
- package/src/lib/components/crm-call-actions.js.map +1 -0
- package/src/lib/components/crm-column-menu.d.ts +21 -0
- package/src/lib/components/crm-column-menu.js +103 -0
- package/src/lib/components/crm-column-menu.js.map +1 -0
- package/src/lib/components/crm-console-page.d.ts +19 -0
- package/src/lib/components/crm-console-page.js +151 -0
- package/src/lib/components/crm-console-page.js.map +1 -0
- package/src/lib/components/crm-console-sections.d.ts +52 -0
- package/src/lib/components/crm-console-sections.js +83 -0
- package/src/lib/components/crm-console-sections.js.map +1 -0
- package/src/lib/components/crm-custom-field-control.d.ts +26 -0
- package/src/lib/components/crm-custom-field-control.js +131 -0
- package/src/lib/components/crm-custom-field-control.js.map +1 -0
- package/src/lib/components/crm-email-template-tools.d.ts +69 -0
- package/src/lib/components/crm-email-template-tools.js +240 -0
- package/src/lib/components/crm-email-template-tools.js.map +1 -0
- package/src/lib/components/crm-export-all-button.d.ts +39 -0
- package/src/lib/components/crm-export-all-button.js +98 -0
- package/src/lib/components/crm-export-all-button.js.map +1 -0
- package/src/lib/components/crm-filter-bar.d.ts +53 -0
- package/src/lib/components/crm-filter-bar.js +294 -0
- package/src/lib/components/crm-filter-bar.js.map +1 -0
- package/src/lib/components/crm-glance-card.d.ts +54 -0
- package/src/lib/components/crm-glance-card.js +219 -0
- package/src/lib/components/crm-glance-card.js.map +1 -0
- package/src/lib/components/crm-next-activity-column.d.ts +35 -0
- package/src/lib/components/crm-next-activity-column.js +100 -0
- package/src/lib/components/crm-next-activity-column.js.map +1 -0
- package/src/lib/components/crm-record-header.d.ts +97 -0
- package/src/lib/components/crm-record-header.js +160 -0
- package/src/lib/components/crm-record-header.js.map +1 -0
- package/src/lib/components/crm-record-insights-zone.d.ts +50 -0
- package/src/lib/components/crm-record-insights-zone.js +169 -0
- package/src/lib/components/crm-record-insights-zone.js.map +1 -0
- package/src/lib/components/crm-record-picker.d.ts +42 -0
- package/src/lib/components/crm-record-picker.js +104 -0
- package/src/lib/components/crm-record-picker.js.map +1 -0
- package/src/lib/components/crm-send-email-button.d.ts +39 -0
- package/src/lib/components/crm-send-email-button.js +81 -0
- package/src/lib/components/crm-send-email-button.js.map +1 -0
- package/src/lib/components/crm-send-email-dialog.d.ts +61 -0
- package/src/lib/components/crm-send-email-dialog.js +851 -0
- package/src/lib/components/crm-send-email-dialog.js.map +1 -0
- package/src/lib/components/crm-site-picker.d.ts +61 -0
- package/src/lib/components/crm-site-picker.js +99 -0
- package/src/lib/components/crm-site-picker.js.map +1 -0
- package/src/lib/components/crm-suite-lock.d.ts +29 -0
- package/src/lib/components/crm-suite-lock.js +114 -0
- package/src/lib/components/crm-suite-lock.js.map +1 -0
- package/src/lib/components/crm-tasks-due-card.d.ts +42 -0
- package/src/lib/components/crm-tasks-due-card.js +225 -0
- package/src/lib/components/crm-tasks-due-card.js.map +1 -0
- package/src/lib/components/crm-views-control.d.ts +65 -0
- package/src/lib/components/crm-views-control.js +518 -0
- package/src/lib/components/crm-views-control.js.map +1 -0
- package/src/lib/components/csv-import-drawer.d.ts +132 -0
- package/src/lib/components/csv-import-drawer.js +746 -0
- package/src/lib/components/csv-import-drawer.js.map +1 -0
- package/src/lib/components/deal-board.d.ts +70 -0
- package/src/lib/components/deal-board.js +478 -0
- package/src/lib/components/deal-board.js.map +1 -0
- package/src/lib/components/deal-detail-page.d.ts +18 -0
- package/src/lib/components/deal-detail-page.js +323 -0
- package/src/lib/components/deal-detail-page.js.map +1 -0
- package/src/lib/components/deal-edit-drawer.d.ts +59 -0
- package/src/lib/components/deal-edit-drawer.js +640 -0
- package/src/lib/components/deal-edit-drawer.js.map +1 -0
- package/src/lib/components/deal-import-drawer.d.ts +24 -0
- package/src/lib/components/deal-import-drawer.js +83 -0
- package/src/lib/components/deal-import-drawer.js.map +1 -0
- package/src/lib/components/deal-products-card.d.ts +48 -0
- package/src/lib/components/deal-products-card.js +614 -0
- package/src/lib/components/deal-products-card.js.map +1 -0
- package/src/lib/components/deal-properties-card.d.ts +29 -0
- package/src/lib/components/deal-properties-card.js +144 -0
- package/src/lib/components/deal-properties-card.js.map +1 -0
- package/src/lib/components/deal-stage-card.d.ts +24 -0
- package/src/lib/components/deal-stage-card.js +199 -0
- package/src/lib/components/deal-stage-card.js.map +1 -0
- package/src/lib/components/deals-bulk-bar.d.ts +31 -0
- package/src/lib/components/deals-bulk-bar.js +340 -0
- package/src/lib/components/deals-bulk-bar.js.map +1 -0
- package/src/lib/components/deals-section.d.ts +49 -0
- package/src/lib/components/deals-section.js +767 -0
- package/src/lib/components/deals-section.js.map +1 -0
- package/src/lib/components/email-capture-card.d.ts +42 -0
- package/src/lib/components/email-capture-card.js +134 -0
- package/src/lib/components/email-capture-card.js.map +1 -0
- package/src/lib/components/email-template-drawer.d.ts +33 -0
- package/src/lib/components/email-template-drawer.js +209 -0
- package/src/lib/components/email-template-drawer.js.map +1 -0
- package/src/lib/components/email-templates-card.d.ts +33 -0
- package/src/lib/components/email-templates-card.js +370 -0
- package/src/lib/components/email-templates-card.js.map +1 -0
- package/src/lib/components/erase-person-action.d.ts +92 -0
- package/src/lib/components/erase-person-action.js +261 -0
- package/src/lib/components/erase-person-action.js.map +1 -0
- package/src/lib/components/fields-section.d.ts +37 -0
- package/src/lib/components/fields-section.js +641 -0
- package/src/lib/components/fields-section.js.map +1 -0
- package/src/lib/components/form-contact-fields-card.d.ts +46 -0
- package/src/lib/components/form-contact-fields-card.js +253 -0
- package/src/lib/components/form-contact-fields-card.js.map +1 -0
- package/src/lib/components/insert-link-at-caret.d.ts +28 -0
- package/src/lib/components/insert-link-at-caret.js +37 -0
- package/src/lib/components/insert-link-at-caret.js.map +1 -0
- package/src/lib/components/lead-convert-dialog.d.ts +32 -0
- package/src/lib/components/lead-convert-dialog.js +493 -0
- package/src/lib/components/lead-convert-dialog.js.map +1 -0
- package/src/lib/components/lead-detail-page.d.ts +16 -0
- package/src/lib/components/lead-detail-page.js +163 -0
- package/src/lib/components/lead-detail-page.js.map +1 -0
- package/src/lib/components/lead-history-card.d.ts +32 -0
- package/src/lib/components/lead-history-card.js +165 -0
- package/src/lib/components/lead-history-card.js.map +1 -0
- package/src/lib/components/lead-import-drawer.d.ts +24 -0
- package/src/lib/components/lead-import-drawer.js +95 -0
- package/src/lib/components/lead-import-drawer.js.map +1 -0
- package/src/lib/components/lead-owner-select.d.ts +35 -0
- package/src/lib/components/lead-owner-select.js +91 -0
- package/src/lib/components/lead-owner-select.js.map +1 -0
- package/src/lib/components/lead-properties-card.d.ts +61 -0
- package/src/lib/components/lead-properties-card.js +395 -0
- package/src/lib/components/lead-properties-card.js.map +1 -0
- package/src/lib/components/lead-status-chip.d.ts +12 -0
- package/src/lib/components/lead-status-chip.js +43 -0
- package/src/lib/components/lead-status-chip.js.map +1 -0
- package/src/lib/components/lead-surfaces-note.d.ts +126 -0
- package/src/lib/components/lead-surfaces-note.js +262 -0
- package/src/lib/components/lead-surfaces-note.js.map +1 -0
- package/src/lib/components/lead-unqualify-dialog.d.ts +24 -0
- package/src/lib/components/lead-unqualify-dialog.js +125 -0
- package/src/lib/components/lead-unqualify-dialog.js.map +1 -0
- package/src/lib/components/leads-bulk-bar.d.ts +58 -0
- package/src/lib/components/leads-bulk-bar.js +307 -0
- package/src/lib/components/leads-bulk-bar.js.map +1 -0
- package/src/lib/components/leads-section.d.ts +23 -0
- package/src/lib/components/leads-section.js +664 -0
- package/src/lib/components/leads-section.js.map +1 -0
- package/src/lib/components/linked-deals-card.d.ts +32 -0
- package/src/lib/components/linked-deals-card.js +163 -0
- package/src/lib/components/linked-deals-card.js.map +1 -0
- package/src/lib/components/log-activity-dialog.d.ts +60 -0
- package/src/lib/components/log-activity-dialog.js +368 -0
- package/src/lib/components/log-activity-dialog.js.map +1 -0
- package/src/lib/components/lost-reason-dialog.d.ts +26 -0
- package/src/lib/components/lost-reason-dialog.js +95 -0
- package/src/lib/components/lost-reason-dialog.js.map +1 -0
- package/src/lib/components/new-contact-drawer.d.ts +78 -0
- package/src/lib/components/new-contact-drawer.js +343 -0
- package/src/lib/components/new-contact-drawer.js.map +1 -0
- package/src/lib/components/org-lead-surfaces-note.d.ts +57 -0
- package/src/lib/components/org-lead-surfaces-note.js +172 -0
- package/src/lib/components/org-lead-surfaces-note.js.map +1 -0
- package/src/lib/components/owner-avatar.d.ts +18 -0
- package/src/lib/components/owner-avatar.js +61 -0
- package/src/lib/components/owner-avatar.js.map +1 -0
- package/src/lib/components/pipeline-stages-dialog.d.ts +43 -0
- package/src/lib/components/pipeline-stages-dialog.js +339 -0
- package/src/lib/components/pipeline-stages-dialog.js.map +1 -0
- package/src/lib/components/pipelines-dialog.d.ts +55 -0
- package/src/lib/components/pipelines-dialog.js +517 -0
- package/src/lib/components/pipelines-dialog.js.map +1 -0
- package/src/lib/components/recent-activity-feed.d.ts +39 -0
- package/src/lib/components/recent-activity-feed.js +103 -0
- package/src/lib/components/recent-activity-feed.js.map +1 -0
- package/src/lib/components/recipes-card.d.ts +39 -0
- package/src/lib/components/recipes-card.js +485 -0
- package/src/lib/components/recipes-card.js.map +1 -0
- package/src/lib/components/record-activity-card.d.ts +26 -0
- package/src/lib/components/record-activity-card.js +121 -0
- package/src/lib/components/record-activity-card.js.map +1 -0
- package/src/lib/components/record-files-card.d.ts +67 -0
- package/src/lib/components/record-files-card.js +290 -0
- package/src/lib/components/record-files-card.js.map +1 -0
- package/src/lib/components/record-tasks-card.d.ts +32 -0
- package/src/lib/components/record-tasks-card.js +306 -0
- package/src/lib/components/record-tasks-card.js.map +1 -0
- package/src/lib/components/reports/activity-card.d.ts +57 -0
- package/src/lib/components/reports/activity-card.js +281 -0
- package/src/lib/components/reports/activity-card.js.map +1 -0
- package/src/lib/components/reports/closed-deals-card.d.ts +20 -0
- package/src/lib/components/reports/closed-deals-card.js +194 -0
- package/src/lib/components/reports/closed-deals-card.js.map +1 -0
- package/src/lib/components/reports/contacts-mix-card.d.ts +27 -0
- package/src/lib/components/reports/contacts-mix-card.js +161 -0
- package/src/lib/components/reports/contacts-mix-card.js.map +1 -0
- package/src/lib/components/reports/contacts-trend-card.d.ts +31 -0
- package/src/lib/components/reports/contacts-trend-card.js +144 -0
- package/src/lib/components/reports/contacts-trend-card.js.map +1 -0
- package/src/lib/components/reports/forecast-card.d.ts +22 -0
- package/src/lib/components/reports/forecast-card.js +251 -0
- package/src/lib/components/reports/forecast-card.js.map +1 -0
- package/src/lib/components/reports/lead-counts.d.ts +32 -0
- package/src/lib/components/reports/lead-counts.js +44 -0
- package/src/lib/components/reports/lead-counts.js.map +1 -0
- package/src/lib/components/reports/lead-funnel-card.d.ts +38 -0
- package/src/lib/components/reports/lead-funnel-card.js +375 -0
- package/src/lib/components/reports/lead-funnel-card.js.map +1 -0
- package/src/lib/components/reports/pipeline-card.d.ts +19 -0
- package/src/lib/components/reports/pipeline-card.js +338 -0
- package/src/lib/components/reports/pipeline-card.js.map +1 -0
- package/src/lib/components/reports/report-bar-chart.d.ts +39 -0
- package/src/lib/components/reports/report-bar-chart.js +133 -0
- package/src/lib/components/reports/report-bar-chart.js.map +1 -0
- package/src/lib/components/reports/report-breakdown.d.ts +32 -0
- package/src/lib/components/reports/report-breakdown.js +105 -0
- package/src/lib/components/reports/report-breakdown.js.map +1 -0
- package/src/lib/components/reports/report-export.d.ts +37 -0
- package/src/lib/components/reports/report-export.js +66 -0
- package/src/lib/components/reports/report-export.js.map +1 -0
- package/src/lib/components/reports/report-format.d.ts +36 -0
- package/src/lib/components/reports/report-format.js +43 -0
- package/src/lib/components/reports/report-format.js.map +1 -0
- package/src/lib/components/reports/report-scope.d.ts +81 -0
- package/src/lib/components/reports/report-scope.js +58 -0
- package/src/lib/components/reports/report-scope.js.map +1 -0
- package/src/lib/components/reports/report-stat-tile.d.ts +47 -0
- package/src/lib/components/reports/report-stat-tile.js +96 -0
- package/src/lib/components/reports/report-stat-tile.js.map +1 -0
- package/src/lib/components/reports/source-conversion-card.d.ts +28 -0
- package/src/lib/components/reports/source-conversion-card.js +205 -0
- package/src/lib/components/reports/source-conversion-card.js.map +1 -0
- package/src/lib/components/reports/tasks-card.d.ts +26 -0
- package/src/lib/components/reports/tasks-card.js +279 -0
- package/src/lib/components/reports/tasks-card.js.map +1 -0
- package/src/lib/components/reports/use-aggregate-read.d.ts +99 -0
- package/src/lib/components/reports/use-aggregate-read.js +195 -0
- package/src/lib/components/reports/use-aggregate-read.js.map +1 -0
- package/src/lib/components/reports/won-lost-by-owner-card.d.ts +30 -0
- package/src/lib/components/reports/won-lost-by-owner-card.js +168 -0
- package/src/lib/components/reports/won-lost-by-owner-card.js.map +1 -0
- package/src/lib/components/reports-section.d.ts +42 -0
- package/src/lib/components/reports-section.js +308 -0
- package/src/lib/components/reports-section.js.map +1 -0
- package/src/lib/components/sending-addresses-card.d.ts +49 -0
- package/src/lib/components/sending-addresses-card.js +262 -0
- package/src/lib/components/sending-addresses-card.js.map +1 -0
- package/src/lib/components/settings-section.d.ts +151 -0
- package/src/lib/components/settings-section.js +783 -0
- package/src/lib/components/settings-section.js.map +1 -0
- package/src/lib/components/task-cells.d.ts +51 -0
- package/src/lib/components/task-cells.js +139 -0
- package/src/lib/components/task-cells.js.map +1 -0
- package/src/lib/components/task-edit-drawer.d.ts +53 -0
- package/src/lib/components/task-edit-drawer.js +483 -0
- package/src/lib/components/task-edit-drawer.js.map +1 -0
- package/src/lib/components/task-import-drawer.d.ts +24 -0
- package/src/lib/components/task-import-drawer.js +82 -0
- package/src/lib/components/task-import-drawer.js.map +1 -0
- package/src/lib/components/task-snooze-menu.d.ts +65 -0
- package/src/lib/components/task-snooze-menu.js +207 -0
- package/src/lib/components/task-snooze-menu.js.map +1 -0
- package/src/lib/components/tasks-bulk-bar.d.ts +25 -0
- package/src/lib/components/tasks-bulk-bar.js +348 -0
- package/src/lib/components/tasks-bulk-bar.js.map +1 -0
- package/src/lib/components/tasks-calendar.d.ts +38 -0
- package/src/lib/components/tasks-calendar.js +228 -0
- package/src/lib/components/tasks-calendar.js.map +1 -0
- package/src/lib/components/tasks-section.d.ts +27 -0
- package/src/lib/components/tasks-section.js +579 -0
- package/src/lib/components/tasks-section.js.map +1 -0
- package/src/lib/components/use-contact-campaign-emails.d.ts +32 -0
- package/src/lib/components/use-contact-campaign-emails.js +83 -0
- package/src/lib/components/use-contact-campaign-emails.js.map +1 -0
- package/src/lib/components/use-crm-api.d.ts +44 -0
- package/src/lib/components/use-crm-api.js +84 -0
- package/src/lib/components/use-crm-api.js.map +1 -0
- package/src/lib/components/use-crm-inbound-address.d.ts +60 -0
- package/src/lib/components/use-crm-inbound-address.js +124 -0
- package/src/lib/components/use-crm-inbound-address.js.map +1 -0
- package/src/lib/components/use-emails-hub-path.d.ts +24 -0
- package/src/lib/components/use-emails-hub-path.js +59 -0
- package/src/lib/components/use-emails-hub-path.js.map +1 -0
- package/src/lib/components/use-member-email-aliases.d.ts +54 -0
- package/src/lib/components/use-member-email-aliases.js +186 -0
- package/src/lib/components/use-member-email-aliases.js.map +1 -0
- package/src/lib/components/use-org-members.d.ts +40 -0
- package/src/lib/components/use-org-members.js +100 -0
- package/src/lib/components/use-org-members.js.map +1 -0
- package/src/lib/constants/api-routes.d.ts +109 -0
- package/src/lib/constants/api-routes.js +74 -0
- package/src/lib/constants/api-routes.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +14 -0
- package/src/lib/constants/bundle-common.js +14 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/constants/company-filters.d.ts +18 -0
- package/src/lib/constants/company-filters.js +51 -0
- package/src/lib/constants/company-filters.js.map +1 -0
- package/src/lib/constants/contact-filters.d.ts +38 -0
- package/src/lib/constants/contact-filters.js +294 -0
- package/src/lib/constants/contact-filters.js.map +1 -0
- package/src/lib/hooks/use-contact-field-definitions.d.ts +48 -0
- package/src/lib/hooks/use-contact-field-definitions.js +72 -0
- package/src/lib/hooks/use-contact-field-definitions.js.map +1 -0
- package/src/lib/hooks/use-contact-update.d.ts +25 -0
- package/src/lib/hooks/use-contact-update.js +80 -0
- package/src/lib/hooks/use-contact-update.js.map +1 -0
- package/src/lib/hooks/use-crm-activity-logger.d.ts +73 -0
- package/src/lib/hooks/use-crm-activity-logger.js +101 -0
- package/src/lib/hooks/use-crm-activity-logger.js.map +1 -0
- package/src/lib/hooks/use-crm-bulk-apply.d.ts +52 -0
- package/src/lib/hooks/use-crm-bulk-apply.js +112 -0
- package/src/lib/hooks/use-crm-bulk-apply.js.map +1 -0
- package/src/lib/hooks/use-crm-default-view.d.ts +24 -0
- package/src/lib/hooks/use-crm-default-view.js +64 -0
- package/src/lib/hooks/use-crm-default-view.js.map +1 -0
- package/src/lib/hooks/use-crm-email-templates.d.ts +59 -0
- package/src/lib/hooks/use-crm-email-templates.js +103 -0
- package/src/lib/hooks/use-crm-email-templates.js.map +1 -0
- package/src/lib/hooks/use-crm-hub-path.d.ts +29 -0
- package/src/lib/hooks/use-crm-hub-path.js +41 -0
- package/src/lib/hooks/use-crm-hub-path.js.map +1 -0
- package/src/lib/hooks/use-crm-org-mount.d.ts +97 -0
- package/src/lib/hooks/use-crm-org-mount.js +215 -0
- package/src/lib/hooks/use-crm-org-mount.js.map +1 -0
- package/src/lib/hooks/use-crm-record-names.d.ts +52 -0
- package/src/lib/hooks/use-crm-record-names.js +126 -0
- package/src/lib/hooks/use-crm-record-names.js.map +1 -0
- package/src/lib/hooks/use-crm-records-quota.d.ts +68 -0
- package/src/lib/hooks/use-crm-records-quota.js +118 -0
- package/src/lib/hooks/use-crm-records-quota.js.map +1 -0
- package/src/lib/hooks/use-crm-saved-view.d.ts +96 -0
- package/src/lib/hooks/use-crm-saved-view.js +329 -0
- package/src/lib/hooks/use-crm-saved-view.js.map +1 -0
- package/src/lib/hooks/use-crm-scope.d.ts +117 -0
- package/src/lib/hooks/use-crm-scope.js +147 -0
- package/src/lib/hooks/use-crm-scope.js.map +1 -0
- package/src/lib/hooks/use-crm-tasks.d.ts +85 -0
- package/src/lib/hooks/use-crm-tasks.js +153 -0
- package/src/lib/hooks/use-crm-tasks.js.map +1 -0
- package/src/lib/hooks/use-crm-view-grid.d.ts +55 -0
- package/src/lib/hooks/use-crm-view-grid.js +170 -0
- package/src/lib/hooks/use-crm-view-grid.js.map +1 -0
- package/src/lib/hooks/use-crm-views.d.ts +42 -0
- package/src/lib/hooks/use-crm-views.js +84 -0
- package/src/lib/hooks/use-crm-views.js.map +1 -0
- package/src/lib/hooks/use-deal-stage-api.d.ts +69 -0
- package/src/lib/hooks/use-deal-stage-api.js +78 -0
- package/src/lib/hooks/use-deal-stage-api.js.map +1 -0
- package/src/lib/hooks/use-deals.d.ts +47 -0
- package/src/lib/hooks/use-deals.js +105 -0
- package/src/lib/hooks/use-deals.js.map +1 -0
- package/src/lib/hooks/use-org-leads.d.ts +53 -0
- package/src/lib/hooks/use-org-leads.js +114 -0
- package/src/lib/hooks/use-org-leads.js.map +1 -0
- package/src/lib/hooks/use-org-member-directory.d.ts +36 -0
- package/src/lib/hooks/use-org-member-directory.js +116 -0
- package/src/lib/hooks/use-org-member-directory.js.map +1 -0
- package/src/lib/hooks/use-org-member-options.d.ts +38 -0
- package/src/lib/hooks/use-org-member-options.js +131 -0
- package/src/lib/hooks/use-org-member-options.js.map +1 -0
- package/src/lib/hooks/use-pipeline.d.ts +71 -0
- package/src/lib/hooks/use-pipeline.js +159 -0
- package/src/lib/hooks/use-pipeline.js.map +1 -0
- package/src/lib/model/companies-bulk-writes.d.ts +40 -0
- package/src/lib/model/companies-bulk-writes.js +103 -0
- package/src/lib/model/companies-bulk-writes.js.map +1 -0
- package/src/lib/model/companies-csv.d.ts +36 -0
- package/src/lib/model/companies-csv.js +38 -0
- package/src/lib/model/companies-csv.js.map +1 -0
- package/src/lib/model/companies.d.ts +99 -0
- package/src/lib/model/companies.js +168 -0
- package/src/lib/model/companies.js.map +1 -0
- package/src/lib/model/company-delete-route.d.ts +43 -0
- package/src/lib/model/company-delete-route.js +31 -0
- package/src/lib/model/company-delete-route.js.map +1 -0
- package/src/lib/model/company-delete.d.ts +42 -0
- package/src/lib/model/company-delete.js +52 -0
- package/src/lib/model/company-delete.js.map +1 -0
- package/src/lib/model/contact-duplicates.d.ts +58 -0
- package/src/lib/model/contact-duplicates.js +67 -0
- package/src/lib/model/contact-duplicates.js.map +1 -0
- package/src/lib/model/contact-record.d.ts +113 -0
- package/src/lib/model/contact-record.js +70 -0
- package/src/lib/model/contact-record.js.map +1 -0
- package/src/lib/model/contact-update.d.ts +93 -0
- package/src/lib/model/contact-update.js +50 -0
- package/src/lib/model/contact-update.js.map +1 -0
- package/src/lib/model/contacts-bulk-writes.d.ts +173 -0
- package/src/lib/model/contacts-bulk-writes.js +196 -0
- package/src/lib/model/contacts-bulk-writes.js.map +1 -0
- package/src/lib/model/contacts-csv.d.ts +54 -0
- package/src/lib/model/contacts-csv.js +67 -0
- package/src/lib/model/contacts-csv.js.map +1 -0
- package/src/lib/model/contacts-list-seed.d.ts +51 -0
- package/src/lib/model/contacts-list-seed.js +63 -0
- package/src/lib/model/contacts-list-seed.js.map +1 -0
- package/src/lib/model/crm-activity-report.d.ts +27 -0
- package/src/lib/model/crm-activity-report.js +56 -0
- package/src/lib/model/crm-activity-report.js.map +1 -0
- package/src/lib/model/crm-api.d.ts +49 -0
- package/src/lib/model/crm-api.js +47 -0
- package/src/lib/model/crm-api.js.map +1 -0
- package/src/lib/model/crm-bulk-writes.d.ts +147 -0
- package/src/lib/model/crm-bulk-writes.js +207 -0
- package/src/lib/model/crm-bulk-writes.js.map +1 -0
- package/src/lib/model/crm-company-import.d.ts +154 -0
- package/src/lib/model/crm-company-import.js +331 -0
- package/src/lib/model/crm-company-import.js.map +1 -0
- package/src/lib/model/crm-custom-draft.d.ts +62 -0
- package/src/lib/model/crm-custom-draft.js +67 -0
- package/src/lib/model/crm-custom-draft.js.map +1 -0
- package/src/lib/model/crm-deal-import.d.ts +112 -0
- package/src/lib/model/crm-deal-import.js +263 -0
- package/src/lib/model/crm-deal-import.js.map +1 -0
- package/src/lib/model/crm-import.d.ts +244 -0
- package/src/lib/model/crm-import.js +466 -0
- package/src/lib/model/crm-import.js.map +1 -0
- package/src/lib/model/crm-lead-import.d.ts +105 -0
- package/src/lib/model/crm-lead-import.js +255 -0
- package/src/lib/model/crm-lead-import.js.map +1 -0
- package/src/lib/model/crm-record-routes.d.ts +21 -0
- package/src/lib/model/crm-record-routes.js +70 -0
- package/src/lib/model/crm-record-routes.js.map +1 -0
- package/src/lib/model/crm-routes.d.ts +101 -0
- package/src/lib/model/crm-routes.js +92 -0
- package/src/lib/model/crm-routes.js.map +1 -0
- package/src/lib/model/crm-task-import.d.ts +94 -0
- package/src/lib/model/crm-task-import.js +275 -0
- package/src/lib/model/crm-task-import.js.map +1 -0
- package/src/lib/model/crm-view-param.d.ts +43 -0
- package/src/lib/model/crm-view-param.js +49 -0
- package/src/lib/model/crm-view-param.js.map +1 -0
- package/src/lib/model/deal-board-model.d.ts +241 -0
- package/src/lib/model/deal-board-model.js +439 -0
- package/src/lib/model/deal-board-model.js.map +1 -0
- package/src/lib/model/deal-form-model.d.ts +114 -0
- package/src/lib/model/deal-form-model.js +218 -0
- package/src/lib/model/deal-form-model.js.map +1 -0
- package/src/lib/model/deals-csv.d.ts +32 -0
- package/src/lib/model/deals-csv.js +37 -0
- package/src/lib/model/deals-csv.js.map +1 -0
- package/src/lib/model/import-column-shapes.d.ts +36 -0
- package/src/lib/model/import-column-shapes.js +76 -0
- package/src/lib/model/import-column-shapes.js.map +1 -0
- package/src/lib/model/lead-company-suggestion.d.ts +61 -0
- package/src/lib/model/lead-company-suggestion.js +65 -0
- package/src/lib/model/lead-company-suggestion.js.map +1 -0
- package/src/lib/model/lead-filters.d.ts +29 -0
- package/src/lib/model/lead-filters.js +39 -0
- package/src/lib/model/lead-filters.js.map +1 -0
- package/src/lib/model/lead-surfaces.d.ts +58 -0
- package/src/lib/model/lead-surfaces.js +67 -0
- package/src/lib/model/lead-surfaces.js.map +1 -0
- package/src/lib/model/leads-csv.d.ts +40 -0
- package/src/lib/model/leads-csv.js +40 -0
- package/src/lib/model/leads-csv.js.map +1 -0
- package/src/lib/model/next-activity-api.d.ts +31 -0
- package/src/lib/model/next-activity-api.js +57 -0
- package/src/lib/model/next-activity-api.js.map +1 -0
- package/src/lib/model/next-activity.d.ts +64 -0
- package/src/lib/model/next-activity.js +47 -0
- package/src/lib/model/next-activity.js.map +1 -0
- package/src/lib/model/person-key-web.d.ts +43 -0
- package/src/lib/model/person-key-web.js +52 -0
- package/src/lib/model/person-key-web.js.map +1 -0
- package/src/lib/model/record-facts.d.ts +282 -0
- package/src/lib/model/record-facts.js +434 -0
- package/src/lib/model/record-facts.js.map +1 -0
- package/src/lib/model/task-api.d.ts +28 -0
- package/src/lib/model/task-api.js +57 -0
- package/src/lib/model/task-api.js.map +1 -0
- package/src/lib/model/task-calendar.d.ts +108 -0
- package/src/lib/model/task-calendar.js +139 -0
- package/src/lib/model/task-calendar.js.map +1 -0
- package/src/lib/model/task-routes.d.ts +177 -0
- package/src/lib/model/task-routes.js +197 -0
- package/src/lib/model/task-routes.js.map +1 -0
- package/src/lib/model/task-scope.d.ts +45 -0
- package/src/lib/model/task-scope.js +51 -0
- package/src/lib/model/task-scope.js.map +1 -0
- package/src/lib/model/task-views.d.ts +149 -0
- package/src/lib/model/task-views.js +286 -0
- package/src/lib/model/task-views.js.map +1 -0
- package/src/lib/model/tasks-csv.d.ts +28 -0
- package/src/lib/model/tasks-csv.js +28 -0
- package/src/lib/model/tasks-csv.js.map +1 -0
- package/src/lib/plugin.d.ts +32 -0
- package/src/lib/plugin.js +208 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/server/companies-import.d.ts +57 -0
- package/src/lib/server/companies-import.js +242 -0
- package/src/lib/server/companies-import.js.map +1 -0
- package/src/lib/server/company-delete.d.ts +59 -0
- package/src/lib/server/company-delete.js +146 -0
- package/src/lib/server/company-delete.js.map +1 -0
- package/src/lib/server/contact-email-history.d.ts +82 -0
- package/src/lib/server/contact-email-history.js +264 -0
- package/src/lib/server/contact-email-history.js.map +1 -0
- package/src/lib/server/contact-profile.d.ts +41 -0
- package/src/lib/server/contact-profile.js +45 -0
- package/src/lib/server/contact-profile.js.map +1 -0
- package/src/lib/server/contact-update.d.ts +92 -0
- package/src/lib/server/contact-update.js +512 -0
- package/src/lib/server/contact-update.js.map +1 -0
- package/src/lib/server/contacts-import.d.ts +73 -0
- package/src/lib/server/contacts-import.js +263 -0
- package/src/lib/server/contacts-import.js.map +1 -0
- package/src/lib/server/contacts-merge.d.ts +86 -0
- package/src/lib/server/contacts-merge.js +206 -0
- package/src/lib/server/contacts-merge.js.map +1 -0
- package/src/lib/server/deals-import.d.ts +76 -0
- package/src/lib/server/deals-import.js +246 -0
- package/src/lib/server/deals-import.js.map +1 -0
- package/src/lib/server/email-send.d.ts +119 -0
- package/src/lib/server/email-send.js +667 -0
- package/src/lib/server/email-send.js.map +1 -0
- package/src/lib/server/email-template-duplicate.d.ts +19 -0
- package/src/lib/server/email-template-duplicate.js +206 -0
- package/src/lib/server/email-template-duplicate.js.map +1 -0
- package/src/lib/server/erase-person.d.ts +108 -0
- package/src/lib/server/erase-person.js +309 -0
- package/src/lib/server/erase-person.js.map +1 -0
- package/src/lib/server/import-context.d.ts +85 -0
- package/src/lib/server/import-context.js +181 -0
- package/src/lib/server/import-context.js.map +1 -0
- package/src/lib/server/inbound-address.d.ts +61 -0
- package/src/lib/server/inbound-address.js +188 -0
- package/src/lib/server/inbound-address.js.map +1 -0
- package/src/lib/server/lead-convert.d.ts +78 -0
- package/src/lib/server/lead-convert.js +250 -0
- package/src/lib/server/lead-convert.js.map +1 -0
- package/src/lib/server/leads-import.d.ts +84 -0
- package/src/lib/server/leads-import.js +261 -0
- package/src/lib/server/leads-import.js.map +1 -0
- package/src/lib/server/next-activity-routes.d.ts +33 -0
- package/src/lib/server/next-activity-routes.js +110 -0
- package/src/lib/server/next-activity-routes.js.map +1 -0
- package/src/lib/server/org-activity.d.ts +61 -0
- package/src/lib/server/org-activity.js +120 -0
- package/src/lib/server/org-activity.js.map +1 -0
- package/src/lib/server/org-caller.d.ts +110 -0
- package/src/lib/server/org-caller.js +154 -0
- package/src/lib/server/org-caller.js.map +1 -0
- package/src/lib/server/recipe-routes.d.ts +75 -0
- package/src/lib/server/recipe-routes.js +442 -0
- package/src/lib/server/recipe-routes.js.map +1 -0
- package/src/lib/server/record-facts.d.ts +65 -0
- package/src/lib/server/record-facts.js +337 -0
- package/src/lib/server/record-facts.js.map +1 -0
- package/src/lib/server/record-timeline.d.ts +51 -0
- package/src/lib/server/record-timeline.js +215 -0
- package/src/lib/server/record-timeline.js.map +1 -0
- package/src/lib/server/suite-gate.d.ts +42 -0
- package/src/lib/server/suite-gate.js +87 -0
- package/src/lib/server/suite-gate.js.map +1 -0
- package/src/lib/server/task-routes.d.ts +132 -0
- package/src/lib/server/task-routes.js +699 -0
- package/src/lib/server/task-routes.js.map +1 -0
- package/src/lib/server/tasks-import.d.ts +54 -0
- package/src/lib/server/tasks-import.js +157 -0
- package/src/lib/server/tasks-import.js.map +1 -0
- package/src/lib/server-deal-stage.d.ts +88 -0
- package/src/lib/server-deal-stage.js +316 -0
- package/src/lib/server-deal-stage.js.map +1 -0
- package/src/lib/server.d.ts +149 -0
- package/src/lib/server.js +615 -0
- package/src/lib/server.js.map +1 -0
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
/**
|
|
20
|
+
* The bar over the contacts table, for whatever rows are ticked (AGL-2603).
|
|
21
|
+
*
|
|
22
|
+
* The table's selection is opt-in and this is what it is for: a chosen set
|
|
23
|
+
* of people, and one act over all of them. Tag or untag them, hand them to
|
|
24
|
+
* an owner, move them along the funnel, put them on an email audience, take
|
|
25
|
+
* them into a spreadsheet, or let them go from this site's CRM.
|
|
26
|
+
*
|
|
27
|
+
* ## The chrome is the shared frame
|
|
28
|
+
*
|
|
29
|
+
* This bar settled how a bar over a table reads — it appears only for a
|
|
30
|
+
* selection and says how many, its actions sit in one wrapping row with
|
|
31
|
+
* Clear at the end, and whatever the last action could not do is listed by
|
|
32
|
+
* name in an alert under it — and the companies, deals and tasks bars were
|
|
33
|
+
* built on that shape as `CrmBulkBarFrame` and `useCrmBulkApply` (AGL-2621).
|
|
34
|
+
* The contacts bar stands on the same two (AGL-2635): what is its own is the
|
|
35
|
+
* actions, the dialog's field, the audience door, and how each act is sent.
|
|
36
|
+
*
|
|
37
|
+
* ## Each act goes where its field is written (AGL-2804)
|
|
38
|
+
*
|
|
39
|
+
* A contact's tags, owner and company live in the holder's facet, which is
|
|
40
|
+
* the server's to write — the rules cannot tell one field of a facet from
|
|
41
|
+
* another — so each of those acts is ONE request to `crm/contact-update` for
|
|
42
|
+
* the rows it reaches (`contacts-bulk-writes.ts` decides which), sent in
|
|
43
|
+
* pieces the route accepts. A stage move is `crm/contact-stage`, row by row:
|
|
44
|
+
* a move is what an automation listens for, and only the route that
|
|
45
|
+
* performed it can announce it. Letting the rows go is the one act written
|
|
46
|
+
* client-direct, because a holder dropping its own facet is the one facet
|
|
47
|
+
* change the rules leave the browser.
|
|
48
|
+
*
|
|
49
|
+
* ## A refused row is named
|
|
50
|
+
*
|
|
51
|
+
* Whatever the server or the store refused comes back by address into the
|
|
52
|
+
* alert under the bar — not into a count, and not into the console. A
|
|
53
|
+
* merchant who tagged four hundred people and got three hundred and
|
|
54
|
+
* ninety-eight needs the two addresses.
|
|
55
|
+
*
|
|
56
|
+
* ## Add to list goes through the audience's own door
|
|
57
|
+
*
|
|
58
|
+
* The membership routes, with the check-then-attest sequence the Emails
|
|
59
|
+
* console runs — see `add-to-list-dialog.tsx`. Nothing here writes a
|
|
60
|
+
* membership document.
|
|
61
|
+
*/ import { CONTACT_LIFECYCLE_STAGE_LABELS, CONTACT_LIFECYCLE_STAGES } from "@aglyn/aglyn";
|
|
62
|
+
import { useConfirmationContext } from "@aglyn/shared-ui-jsx";
|
|
63
|
+
import { Button, MenuItem, TextField } from "@mui/material";
|
|
64
|
+
import { deleteDoc, doc, updateDoc, writeBatch } from "firebase/firestore";
|
|
65
|
+
import { useCallback, useMemo, useState } from "react";
|
|
66
|
+
import { useFirestore, useOrgMemberOptions, useUser } from "@aglyn/tenant-feature-instance";
|
|
67
|
+
import { useContactUpdate } from "../hooks/use-contact-update.js";
|
|
68
|
+
import { useCrmBulkApply } from "../hooks/use-crm-bulk-apply.js";
|
|
69
|
+
import { useCrmScope } from "../hooks/use-crm-scope.js";
|
|
70
|
+
import { CRM_CONTACT_UPDATE_MAX } from "../model/contact-update.js";
|
|
71
|
+
import { setContactStage } from "../model/crm-api.js";
|
|
72
|
+
import { contactBulkAddressOf, normalizeBulkTag, planAddTag, planDetach, planRemoveTag, planSetCompany } from "../model/contacts-bulk-writes.js";
|
|
73
|
+
import { contactsCsv, downloadTextFile } from "../model/contacts-csv.js";
|
|
74
|
+
import { runCrmBulkBatch, runCrmBulkCalls, runCrmBulkWrites } from "../model/crm-bulk-writes.js";
|
|
75
|
+
import AddToListDialog from "./add-to-list-dialog.js";
|
|
76
|
+
import { CompanyPicker, useCompanyOptions, useCreateCompany } from "./company-picker.js";
|
|
77
|
+
import { CrmBulkBarFrame, CrmBulkValueDialog, countNoun } from "./crm-bulk-bar-frame.js";
|
|
78
|
+
import CrmExportAllButton from "./crm-export-all-button.js";
|
|
79
|
+
import { CrmSuiteLockedButton } from "./crm-suite-lock.js";
|
|
80
|
+
const NOUN = {
|
|
81
|
+
singular: 'contact',
|
|
82
|
+
plural: 'contacts'
|
|
83
|
+
};
|
|
84
|
+
const ACTION_TITLES = {
|
|
85
|
+
'add-tag': 'Add a tag',
|
|
86
|
+
'remove-tag': 'Remove a tag',
|
|
87
|
+
owner: 'Set the owner',
|
|
88
|
+
stage: 'Set the lifecycle stage',
|
|
89
|
+
company: 'Set the company'
|
|
90
|
+
};
|
|
91
|
+
/** How a finished action reads, given how many rows it reached. */ const doneSentence = (action, done)=>{
|
|
92
|
+
const people = countNoun(done, NOUN);
|
|
93
|
+
switch(action){
|
|
94
|
+
case 'add-tag':
|
|
95
|
+
return `Tagged ${people}`;
|
|
96
|
+
case 'remove-tag':
|
|
97
|
+
return `Removed the tag from ${people}`;
|
|
98
|
+
case 'owner':
|
|
99
|
+
return `Owner set on ${people}`;
|
|
100
|
+
case 'stage':
|
|
101
|
+
return `Stage set on ${people}`;
|
|
102
|
+
case 'company':
|
|
103
|
+
return `Company set on ${people}`;
|
|
104
|
+
case 'detach':
|
|
105
|
+
return `${people} removed from this site`;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
/** The report's line for a row an act left out on purpose. */ const skippedLine = (row)=>({
|
|
109
|
+
label: row.email,
|
|
110
|
+
reason: row.reason
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* The bar, or nothing.
|
|
114
|
+
*
|
|
115
|
+
* The empty state is a separate component boundary on purpose: with no
|
|
116
|
+
* selection the body below is never mounted, so none of its hooks run — no
|
|
117
|
+
* roster hook armed, no dialog state held — on the visit to the list that
|
|
118
|
+
* every reader makes and most never tick a row on.
|
|
119
|
+
*/ export function ContactsBulkBar(props) {
|
|
120
|
+
if (!props.selected.length) return null;
|
|
121
|
+
return /*#__PURE__*/ _jsx(ContactsBulkBarBody, _extends({}, props));
|
|
122
|
+
}
|
|
123
|
+
ContactsBulkBar.displayName = 'ContactsBulkBar';
|
|
124
|
+
function ContactsBulkBarBody(props) {
|
|
125
|
+
var _team_error, _ref, _ref1;
|
|
126
|
+
const { hostId, org, scope, consentGroup, rows, selected, onSelectedChange, csv, suiteLocked = false } = props;
|
|
127
|
+
const firestore = useFirestore();
|
|
128
|
+
const { data: user } = useUser();
|
|
129
|
+
const { confirm } = useConfirmationContext();
|
|
130
|
+
const { busy, report, apply, dismissReport } = useCrmBulkApply({
|
|
131
|
+
recordKind: 'contact'
|
|
132
|
+
});
|
|
133
|
+
const contactUpdate = useContactUpdate(hostId);
|
|
134
|
+
const selectedRows = useMemo(()=>{
|
|
135
|
+
const chosen = new Set(selected);
|
|
136
|
+
return rows.filter((row)=>chosen.has(row.$id));
|
|
137
|
+
}, [
|
|
138
|
+
rows,
|
|
139
|
+
selected
|
|
140
|
+
]);
|
|
141
|
+
const [pending, setPending] = useState(null);
|
|
142
|
+
const [value, setValue] = useState('');
|
|
143
|
+
const [company, setCompany] = useState(null);
|
|
144
|
+
const [listOpen, setListOpen] = useState(false);
|
|
145
|
+
/*
|
|
146
|
+
* The roster, read only while the owner dialog is open. A bulk bar sits on
|
|
147
|
+
* every visit to the list; the team is a request for a control nobody has
|
|
148
|
+
* opened until they open it. The company list follows the same rule for
|
|
149
|
+
* its own dialog (AGL-2613).
|
|
150
|
+
*/ const team = useOrgMemberOptions(scope == null ? void 0 : scope[1], {
|
|
151
|
+
enabled: pending === 'owner'
|
|
152
|
+
});
|
|
153
|
+
const companies = useCompanyOptions({
|
|
154
|
+
hostId,
|
|
155
|
+
org,
|
|
156
|
+
enabled: pending === 'company'
|
|
157
|
+
});
|
|
158
|
+
const createCompany = useCreateCompany({
|
|
159
|
+
hostId,
|
|
160
|
+
org
|
|
161
|
+
});
|
|
162
|
+
// The site the audiences API is asked from: the mounted one, or at the
|
|
163
|
+
// organization level the one the reader picked (AGL-2630).
|
|
164
|
+
const { createHostId } = useCrmScope({
|
|
165
|
+
hostId,
|
|
166
|
+
org
|
|
167
|
+
});
|
|
168
|
+
const openAction = (action)=>{
|
|
169
|
+
setValue('');
|
|
170
|
+
setCompany(null);
|
|
171
|
+
setPending(action);
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* The Firestore writers for the one act written client-direct: letting the
|
|
175
|
+
* rows go, a batch at a time and a row at a time for a batch that failed.
|
|
176
|
+
*/ const writers = useMemo(()=>{
|
|
177
|
+
const refFor = (id)=>{
|
|
178
|
+
var _ref, _ref1;
|
|
179
|
+
return doc(firestore, (_ref = scope == null ? void 0 : scope[0]) != null ? _ref : 'orgs', (_ref1 = scope == null ? void 0 : scope[1]) != null ? _ref1 : '', 'contacts', id);
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
commitBatch: async (writes)=>{
|
|
183
|
+
const batch = writeBatch(firestore);
|
|
184
|
+
for (const write of writes){
|
|
185
|
+
if (write.kind === 'delete') batch.delete(refFor(write.id));
|
|
186
|
+
else batch.update(refFor(write.id), write.data);
|
|
187
|
+
}
|
|
188
|
+
await batch.commit();
|
|
189
|
+
},
|
|
190
|
+
commitOne: async (write)=>{
|
|
191
|
+
if (write.kind === 'delete') await deleteDoc(refFor(write.id));
|
|
192
|
+
else await updateDoc(refFor(write.id), write.data);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}, [
|
|
196
|
+
firestore,
|
|
197
|
+
scope
|
|
198
|
+
]);
|
|
199
|
+
/** One act's request for the rows it reaches, in the pieces the route accepts. */ const saveThroughRoute = useCallback((targets, set)=>runCrmBulkBatch(targets, (row)=>row.$id, contactBulkAddressOf, (piece)=>contactUpdate.updateMany(piece.map((row)=>row.$id), set), CRM_CONTACT_UPDATE_MAX), [
|
|
200
|
+
contactUpdate
|
|
201
|
+
]);
|
|
202
|
+
const handleApply = useCallback(async ()=>{
|
|
203
|
+
if (!pending || !scope) return;
|
|
204
|
+
/*
|
|
205
|
+
* A row no site holds has no facet to write. Under a site every selected
|
|
206
|
+
* row is the viewing group's; at the organization level (AGL-2630) each
|
|
207
|
+
* row was flattened through its own primary holder and is written back
|
|
208
|
+
* through it, so a row nobody holds yet is left out and says so.
|
|
209
|
+
*/ const held = [];
|
|
210
|
+
const unheld = [];
|
|
211
|
+
for (const row of selectedRows){
|
|
212
|
+
if (consentGroup || row.groupId) held.push(row);
|
|
213
|
+
else {
|
|
214
|
+
unheld.push({
|
|
215
|
+
email: contactBulkAddressOf(row),
|
|
216
|
+
reason: 'no site holds this contact yet'
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const planned = (()=>{
|
|
221
|
+
if (pending === 'add-tag' || pending === 'remove-tag') {
|
|
222
|
+
const tag = normalizeBulkTag(value);
|
|
223
|
+
if (!tag) return null;
|
|
224
|
+
const selection = pending === 'add-tag' ? planAddTag(held, tag) : planRemoveTag(held, tag);
|
|
225
|
+
const set = pending === 'add-tag' ? {
|
|
226
|
+
addTag: tag
|
|
227
|
+
} : {
|
|
228
|
+
removeTag: tag
|
|
229
|
+
};
|
|
230
|
+
return {
|
|
231
|
+
selection,
|
|
232
|
+
job: ()=>saveThroughRoute(selection.rows, set)
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
if (pending === 'owner') {
|
|
236
|
+
return {
|
|
237
|
+
selection: {
|
|
238
|
+
rows: held,
|
|
239
|
+
skipped: []
|
|
240
|
+
},
|
|
241
|
+
job: ()=>saveThroughRoute(held, {
|
|
242
|
+
ownerUid: value
|
|
243
|
+
})
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
if (pending === 'company') {
|
|
247
|
+
var _ref;
|
|
248
|
+
const companyId = (_ref = company == null ? void 0 : company.id) != null ? _ref : null;
|
|
249
|
+
const selection = planSetCompany(held, companyId);
|
|
250
|
+
return {
|
|
251
|
+
selection,
|
|
252
|
+
job: ()=>saveThroughRoute(selection.rows, {
|
|
253
|
+
companyId
|
|
254
|
+
})
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
if (!value) return null;
|
|
258
|
+
const stage = value;
|
|
259
|
+
return {
|
|
260
|
+
selection: {
|
|
261
|
+
rows: held,
|
|
262
|
+
skipped: []
|
|
263
|
+
},
|
|
264
|
+
/*
|
|
265
|
+
* One row at a time through the one writer of a contact's stage, on
|
|
266
|
+
* the site that holds the row: the mounted site, or at the
|
|
267
|
+
* organization level the row's own holder's.
|
|
268
|
+
*/ job: ()=>runCrmBulkCalls(held, contactBulkAddressOf, async (row)=>{
|
|
269
|
+
const site = hostId != null ? hostId : row.holderHostId || null;
|
|
270
|
+
if (!site) throw new Error('no site holds this contact yet');
|
|
271
|
+
await setContactStage(user, site, row.$id, stage);
|
|
272
|
+
})
|
|
273
|
+
};
|
|
274
|
+
})();
|
|
275
|
+
if (!planned) return;
|
|
276
|
+
const action = pending;
|
|
277
|
+
setPending(null);
|
|
278
|
+
await apply({
|
|
279
|
+
attempted: planned.selection.rows.length,
|
|
280
|
+
skipped: [
|
|
281
|
+
...unheld,
|
|
282
|
+
...planned.selection.skipped
|
|
283
|
+
].map(skippedLine),
|
|
284
|
+
job: planned.job,
|
|
285
|
+
done: (count)=>doneSentence(action, count)
|
|
286
|
+
});
|
|
287
|
+
}, [
|
|
288
|
+
pending,
|
|
289
|
+
scope,
|
|
290
|
+
selectedRows,
|
|
291
|
+
consentGroup,
|
|
292
|
+
value,
|
|
293
|
+
company,
|
|
294
|
+
saveThroughRoute,
|
|
295
|
+
hostId,
|
|
296
|
+
user,
|
|
297
|
+
apply
|
|
298
|
+
]);
|
|
299
|
+
const handleExport = useCallback(()=>{
|
|
300
|
+
downloadTextFile('contacts-selected.csv', 'text/csv', contactsCsv(selectedRows, csv));
|
|
301
|
+
}, [
|
|
302
|
+
selectedRows,
|
|
303
|
+
csv
|
|
304
|
+
]);
|
|
305
|
+
const handleDetach = useCallback(async ()=>{
|
|
306
|
+
if (!scope || !selectedRows.length || !consentGroup) return;
|
|
307
|
+
const count = selectedRows.length;
|
|
308
|
+
const confirmed = await confirm({
|
|
309
|
+
title: count === 1 ? 'Remove this contact?' : `Remove ${count} contacts?`,
|
|
310
|
+
description: `${count === 1 ? 'This person is' : `These ${count} people are`} ` + "removed from this site's Contacts, along with their notes, tags and " + 'timeline. Other sites that captured the same people keep their own ' + 'records. Their form submissions, orders, bookings, and membership ' + 'records are separate — delete those from their own pages if the ' + 'request covers them.',
|
|
311
|
+
confirmationText: count === 1 ? 'Remove contact' : 'Remove contacts',
|
|
312
|
+
confirmationButtonProps: {
|
|
313
|
+
color: 'error'
|
|
314
|
+
}
|
|
315
|
+
})// `confirm` resolves with no value and REJECTS on cancel.
|
|
316
|
+
.then(()=>true).catch(()=>false);
|
|
317
|
+
if (!confirmed) return;
|
|
318
|
+
const plan = planDetach(selectedRows, consentGroup, Date.now());
|
|
319
|
+
const outcome = await apply({
|
|
320
|
+
attempted: plan.writes.length,
|
|
321
|
+
skipped: plan.skipped.map(skippedLine),
|
|
322
|
+
job: ()=>runCrmBulkWrites(writers, plan.writes, (write)=>write.email),
|
|
323
|
+
done: (done)=>doneSentence('detach', done)
|
|
324
|
+
});
|
|
325
|
+
// The rows that went are gone from the table; the refused ones stay
|
|
326
|
+
// selected, so the reader can see which they are and try again.
|
|
327
|
+
const refused = new Set(outcome.refused.map((row)=>row.label));
|
|
328
|
+
onSelectedChange(selectedRows.filter((row)=>refused.has(contactBulkAddressOf(row))).map((row)=>row.$id));
|
|
329
|
+
}, [
|
|
330
|
+
scope,
|
|
331
|
+
selectedRows,
|
|
332
|
+
confirm,
|
|
333
|
+
apply,
|
|
334
|
+
writers,
|
|
335
|
+
consentGroup,
|
|
336
|
+
onSelectedChange
|
|
337
|
+
]);
|
|
338
|
+
const emails = selectedRows.map((row)=>{
|
|
339
|
+
var _row_email;
|
|
340
|
+
return String((_row_email = row.email) != null ? _row_email : '').trim();
|
|
341
|
+
}).filter(Boolean);
|
|
342
|
+
return /*#__PURE__*/ _jsxs(CrmBulkBarFrame, {
|
|
343
|
+
count: selected.length,
|
|
344
|
+
noun: NOUN,
|
|
345
|
+
busy: busy,
|
|
346
|
+
onClear: ()=>onSelectedChange([]),
|
|
347
|
+
report: report,
|
|
348
|
+
onDismissReport: dismissReport,
|
|
349
|
+
extras: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
350
|
+
children: [
|
|
351
|
+
/*#__PURE__*/ _jsx(CrmBulkValueDialog, {
|
|
352
|
+
open: pending !== null,
|
|
353
|
+
title: pending ? ACTION_TITLES[pending] : '',
|
|
354
|
+
count: selected.length,
|
|
355
|
+
noun: NOUN,
|
|
356
|
+
busy: busy,
|
|
357
|
+
canApply: !(pending === 'stage' && !value) && !((pending === 'add-tag' || pending === 'remove-tag') && !normalizeBulkTag(value)),
|
|
358
|
+
onClose: ()=>setPending(null),
|
|
359
|
+
onApply: ()=>void handleApply(),
|
|
360
|
+
children: pending === 'add-tag' || pending === 'remove-tag' ? /*#__PURE__*/ _jsx(TextField, {
|
|
361
|
+
autoFocus: true,
|
|
362
|
+
size: "small",
|
|
363
|
+
label: "Tag",
|
|
364
|
+
placeholder: "vip",
|
|
365
|
+
value: value,
|
|
366
|
+
onChange: (event)=>setValue(event.target.value),
|
|
367
|
+
helperText: pending === 'add-tag' ? 'Lowercased, like the tags on a profile' : 'Removed wherever it is present'
|
|
368
|
+
}) : pending === 'owner' ? /*#__PURE__*/ _jsxs(TextField, {
|
|
369
|
+
select: true,
|
|
370
|
+
size: "small",
|
|
371
|
+
label: "Owner",
|
|
372
|
+
value: value,
|
|
373
|
+
onChange: (event)=>setValue(event.target.value),
|
|
374
|
+
error: Boolean(team.error),
|
|
375
|
+
helperText: (_team_error = team.error) != null ? _team_error : team.ready ? undefined : 'Loading the team…',
|
|
376
|
+
children: [
|
|
377
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
378
|
+
value: "",
|
|
379
|
+
children: 'Nobody — clear the owner'
|
|
380
|
+
}),
|
|
381
|
+
team.options.map((member)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
382
|
+
value: member.uid,
|
|
383
|
+
children: member.label
|
|
384
|
+
}, member.uid))
|
|
385
|
+
]
|
|
386
|
+
}) : pending === 'stage' ? /*#__PURE__*/ _jsx(TextField, {
|
|
387
|
+
select: true,
|
|
388
|
+
size: "small",
|
|
389
|
+
label: "Lifecycle stage",
|
|
390
|
+
value: value,
|
|
391
|
+
onChange: (event)=>setValue(event.target.value),
|
|
392
|
+
children: CONTACT_LIFECYCLE_STAGES.map((stage)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
393
|
+
value: stage,
|
|
394
|
+
children: CONTACT_LIFECYCLE_STAGE_LABELS[stage]
|
|
395
|
+
}, stage))
|
|
396
|
+
}) : pending === 'company' ? /*#__PURE__*/ _jsx(CompanyPicker, {
|
|
397
|
+
options: companies.options,
|
|
398
|
+
ready: companies.ready,
|
|
399
|
+
truncated: companies.truncated,
|
|
400
|
+
value: (_ref = company == null ? void 0 : company.id) != null ? _ref : null,
|
|
401
|
+
onChange: (_id, picked)=>setCompany(picked),
|
|
402
|
+
onCreate: createCompany,
|
|
403
|
+
helperText: "Leave it empty to unlink the selected contacts from their companies."
|
|
404
|
+
}) : null
|
|
405
|
+
}),
|
|
406
|
+
listOpen ? /*#__PURE__*/ _jsx(AddToListDialog, {
|
|
407
|
+
open: true,
|
|
408
|
+
onClose: ()=>setListOpen(false),
|
|
409
|
+
hostId: createHostId,
|
|
410
|
+
scope: scope,
|
|
411
|
+
emails: emails
|
|
412
|
+
}) : null
|
|
413
|
+
]
|
|
414
|
+
}),
|
|
415
|
+
children: [
|
|
416
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
417
|
+
size: "small",
|
|
418
|
+
disabled: busy || !scope,
|
|
419
|
+
onClick: ()=>openAction('add-tag'),
|
|
420
|
+
children: 'Add tag'
|
|
421
|
+
}),
|
|
422
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
423
|
+
size: "small",
|
|
424
|
+
disabled: busy || !scope,
|
|
425
|
+
onClick: ()=>openAction('remove-tag'),
|
|
426
|
+
children: 'Remove tag'
|
|
427
|
+
}),
|
|
428
|
+
suiteLocked ? /*#__PURE__*/ _jsxs(_Fragment, {
|
|
429
|
+
children: [
|
|
430
|
+
/*#__PURE__*/ _jsx(CrmSuiteLockedButton, {
|
|
431
|
+
children: 'Set owner'
|
|
432
|
+
}),
|
|
433
|
+
/*#__PURE__*/ _jsx(CrmSuiteLockedButton, {
|
|
434
|
+
children: 'Set stage'
|
|
435
|
+
}),
|
|
436
|
+
/*#__PURE__*/ _jsx(CrmSuiteLockedButton, {
|
|
437
|
+
children: 'Set company'
|
|
438
|
+
})
|
|
439
|
+
]
|
|
440
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
441
|
+
children: [
|
|
442
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
443
|
+
size: "small",
|
|
444
|
+
disabled: busy || !scope,
|
|
445
|
+
onClick: ()=>openAction('owner'),
|
|
446
|
+
children: 'Set owner'
|
|
447
|
+
}),
|
|
448
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
449
|
+
size: "small",
|
|
450
|
+
disabled: busy || !scope,
|
|
451
|
+
onClick: ()=>openAction('stage'),
|
|
452
|
+
children: 'Set stage'
|
|
453
|
+
}),
|
|
454
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
455
|
+
size: "small",
|
|
456
|
+
disabled: busy || !scope,
|
|
457
|
+
onClick: ()=>openAction('company'),
|
|
458
|
+
children: 'Set company'
|
|
459
|
+
})
|
|
460
|
+
]
|
|
461
|
+
}),
|
|
462
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
463
|
+
size: "small",
|
|
464
|
+
disabled: busy || !scope || !emails.length || !createHostId,
|
|
465
|
+
onClick: ()=>setListOpen(true),
|
|
466
|
+
children: 'Add to list'
|
|
467
|
+
}),
|
|
468
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
469
|
+
size: "small",
|
|
470
|
+
disabled: busy,
|
|
471
|
+
onClick: handleExport,
|
|
472
|
+
children: 'Export CSV'
|
|
473
|
+
}),
|
|
474
|
+
/*#__PURE__*/ _jsx(CrmExportAllButton, {
|
|
475
|
+
resource: "contacts",
|
|
476
|
+
orgId: (_ref1 = scope == null ? void 0 : scope[1]) != null ? _ref1 : null,
|
|
477
|
+
hostId: hostId,
|
|
478
|
+
disabled: busy
|
|
479
|
+
}),
|
|
480
|
+
consentGroup ? /*#__PURE__*/ _jsx(Button, {
|
|
481
|
+
size: "small",
|
|
482
|
+
color: "error",
|
|
483
|
+
disabled: busy || !scope,
|
|
484
|
+
onClick: ()=>void handleDetach(),
|
|
485
|
+
children: 'Remove from this site'
|
|
486
|
+
}) : null
|
|
487
|
+
]
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
ContactsBulkBarBody.displayName = 'ContactsBulkBarBody';
|
|
491
|
+
export default ContactsBulkBar;
|
|
492
|
+
|
|
493
|
+
//# sourceMappingURL=contacts-bulk-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/contacts-bulk-bar.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\n/**\n * The bar over the contacts table, for whatever rows are ticked (AGL-2603).\n *\n * The table's selection is opt-in and this is what it is for: a chosen set\n * of people, and one act over all of them. Tag or untag them, hand them to\n * an owner, move them along the funnel, put them on an email audience, take\n * them into a spreadsheet, or let them go from this site's CRM.\n *\n * ## The chrome is the shared frame\n *\n * This bar settled how a bar over a table reads — it appears only for a\n * selection and says how many, its actions sit in one wrapping row with\n * Clear at the end, and whatever the last action could not do is listed by\n * name in an alert under it — and the companies, deals and tasks bars were\n * built on that shape as `CrmBulkBarFrame` and `useCrmBulkApply` (AGL-2621).\n * The contacts bar stands on the same two (AGL-2635): what is its own is the\n * actions, the dialog's field, the audience door, and how each act is sent.\n *\n * ## Each act goes where its field is written (AGL-2804)\n *\n * A contact's tags, owner and company live in the holder's facet, which is\n * the server's to write — the rules cannot tell one field of a facet from\n * another — so each of those acts is ONE request to `crm/contact-update` for\n * the rows it reaches (`contacts-bulk-writes.ts` decides which), sent in\n * pieces the route accepts. A stage move is `crm/contact-stage`, row by row:\n * a move is what an automation listens for, and only the route that\n * performed it can announce it. Letting the rows go is the one act written\n * client-direct, because a holder dropping its own facet is the one facet\n * change the rules leave the browser.\n *\n * ## A refused row is named\n *\n * Whatever the server or the store refused comes back by address into the\n * alert under the bar — not into a count, and not into the console. A\n * merchant who tagged four hundred people and got three hundred and\n * ninety-eight needs the two addresses.\n *\n * ## Add to list goes through the audience's own door\n *\n * The membership routes, with the check-then-attest sequence the Emails\n * console runs — see `add-to-list-dialog.tsx`. Nothing here writes a\n * membership document.\n */\n\nimport {\n type AglynOrgBilling,\n CONTACT_LIFECYCLE_STAGE_LABELS,\n CONTACT_LIFECYCLE_STAGES,\n type ConsentGroup,\n type ContactLifecycleStage,\n} from '@aglyn/aglyn'\nimport { useConfirmationContext } from '@aglyn/shared-ui-jsx'\nimport { Button, MenuItem, TextField } from '@mui/material'\nimport { deleteDoc, doc, updateDoc, writeBatch } from 'firebase/firestore'\nimport { useCallback, useMemo, useState } from 'react'\nimport {\n useFirestore,\n useOrgMemberOptions,\n useUser,\n} from '@aglyn/tenant-feature-instance'\nimport { useContactUpdate } from '../hooks/use-contact-update'\nimport { useCrmBulkApply } from '../hooks/use-crm-bulk-apply'\nimport { useCrmScope } from '../hooks/use-crm-scope'\nimport { CRM_CONTACT_UPDATE_MAX, type ContactUpdateFields } from '../model/contact-update'\nimport { setContactStage } from '../model/crm-api'\nimport {\n contactBulkAddressOf,\n normalizeBulkTag,\n planAddTag,\n planDetach,\n planRemoveTag,\n planSetCompany,\n type ContactBulkRow,\n type ContactBulkSelection,\n type ContactBulkSkip,\n type ContactBulkWrite,\n} from '../model/contacts-bulk-writes'\nimport {\n type ContactCsvOptions,\n type ContactCsvRow,\n contactsCsv,\n downloadTextFile,\n} from '../model/contacts-csv'\nimport {\n type CrmBulkOutcome,\n runCrmBulkBatch,\n runCrmBulkCalls,\n runCrmBulkWrites,\n} from '../model/crm-bulk-writes'\nimport AddToListDialog from './add-to-list-dialog'\nimport {\n CompanyPicker,\n type CompanyOption,\n useCompanyOptions,\n useCreateCompany,\n} from './company-picker'\nimport {\n type CrmBulkNoun,\n CrmBulkBarFrame,\n CrmBulkValueDialog,\n countNoun,\n} from './crm-bulk-bar-frame'\nimport CrmExportAllButton from './crm-export-all-button'\nimport { CrmSuiteLockedButton } from './crm-suite-lock'\n\nexport interface ContactsBulkBarProps {\n /** The site the list is read under, or `null` at the organization level. */\n hostId: string | null\n /** The org document the shell passed, for the company picker's scope. */\n org?: Partial<AglynOrgBilling> | null\n /** `['orgs', orgId]`, or `null` while the org is unresolved. */\n scope: readonly [string, string] | null\n /**\n * The holder these rows are being read AS — whose facet the acts land in.\n * `null` at the organization level (AGL-2630), where each row's own holder\n * (`groupId`) takes the act instead, and \"Remove from this site\" is not\n * offered because there is no site to remove from.\n */\n consentGroup: ConsentGroup | null\n /** The table's rows, already projected through the holder's facet. */\n rows: readonly (ContactBulkRow & ContactCsvRow)[]\n selected: readonly string[]\n onSelectedChange: (ids: string[]) => void\n /**\n * How the export names an owner and which custom fields it carries — the\n * table's own options, so the selection's file and the table's are one\n * format (AGL-2621).\n */\n csv?: ContactCsvOptions\n /**\n * The org's plan lacks the CRM (AGL-2788), which the shell mounts no CRM\n * page for (AGL-2851). The owner, the stage and the company stand locked;\n * tags, the exports, the audience door and removing people from a site\n * draw no lock of their own.\n */\n suiteLocked?: boolean\n}\n\nconst NOUN: CrmBulkNoun = { singular: 'contact', plural: 'contacts' }\n\n/** The one small dialog the value-taking actions share. */\ntype PendingAction = 'add-tag' | 'remove-tag' | 'owner' | 'stage' | 'company'\n\nconst ACTION_TITLES: Record<PendingAction, string> = {\n 'add-tag': 'Add a tag',\n 'remove-tag': 'Remove a tag',\n owner: 'Set the owner',\n stage: 'Set the lifecycle stage',\n company: 'Set the company',\n}\n\n/** How a finished action reads, given how many rows it reached. */\nconst doneSentence = (action: PendingAction | 'detach', done: number): string => {\n const people = countNoun(done, NOUN)\n switch (action) {\n case 'add-tag':\n return `Tagged ${people}`\n case 'remove-tag':\n return `Removed the tag from ${people}`\n case 'owner':\n return `Owner set on ${people}`\n case 'stage':\n return `Stage set on ${people}`\n case 'company':\n return `Company set on ${people}`\n case 'detach':\n return `${people} removed from this site`\n }\n}\n\n/** The report's line for a row an act left out on purpose. */\nconst skippedLine = (row: ContactBulkSkip) => ({ label: row.email, reason: row.reason })\n\n/**\n * The bar, or nothing.\n *\n * The empty state is a separate component boundary on purpose: with no\n * selection the body below is never mounted, so none of its hooks run — no\n * roster hook armed, no dialog state held — on the visit to the list that\n * every reader makes and most never tick a row on.\n */\nexport function ContactsBulkBar(props: ContactsBulkBarProps) {\n if (!props.selected.length) return null\n return <ContactsBulkBarBody {...props} />\n}\nContactsBulkBar.displayName = 'ContactsBulkBar'\n\nfunction ContactsBulkBarBody(props: ContactsBulkBarProps) {\n const {\n hostId,\n org,\n scope,\n consentGroup,\n rows,\n selected,\n onSelectedChange,\n csv,\n suiteLocked = false,\n } = props\n const firestore = useFirestore()\n const { data: user } = useUser()\n const { confirm } = useConfirmationContext()\n const { busy, report, apply, dismissReport } = useCrmBulkApply({ recordKind: 'contact' })\n const contactUpdate = useContactUpdate(hostId)\n\n const selectedRows = useMemo(() => {\n const chosen = new Set(selected)\n return rows.filter((row) => chosen.has(row.$id))\n }, [rows, selected])\n\n const [pending, setPending] = useState<PendingAction | null>(null)\n const [value, setValue] = useState('')\n const [company, setCompany] = useState<CompanyOption | null>(null)\n const [listOpen, setListOpen] = useState(false)\n\n /*\n * The roster, read only while the owner dialog is open. A bulk bar sits on\n * every visit to the list; the team is a request for a control nobody has\n * opened until they open it. The company list follows the same rule for\n * its own dialog (AGL-2613).\n */\n const team = useOrgMemberOptions(scope?.[1], { enabled: pending === 'owner' })\n const companies = useCompanyOptions({\n hostId,\n org,\n enabled: pending === 'company',\n })\n const createCompany = useCreateCompany({ hostId, org })\n // The site the audiences API is asked from: the mounted one, or at the\n // organization level the one the reader picked (AGL-2630).\n const { createHostId } = useCrmScope({ hostId, org })\n\n const openAction = (action: PendingAction) => {\n setValue('')\n setCompany(null)\n setPending(action)\n }\n\n /**\n * The Firestore writers for the one act written client-direct: letting the\n * rows go, a batch at a time and a row at a time for a batch that failed.\n */\n const writers = useMemo(() => {\n const refFor = (id: string) =>\n doc(firestore, scope?.[0] ?? 'orgs', scope?.[1] ?? '', 'contacts', id)\n return {\n commitBatch: async (writes: readonly ContactBulkWrite[]) => {\n const batch = writeBatch(firestore)\n for (const write of writes) {\n if (write.kind === 'delete') batch.delete(refFor(write.id))\n else batch.update(refFor(write.id), write.data)\n }\n await batch.commit()\n },\n commitOne: async (write: ContactBulkWrite) => {\n if (write.kind === 'delete') await deleteDoc(refFor(write.id))\n else await updateDoc(refFor(write.id), write.data)\n },\n }\n }, [firestore, scope])\n\n /** One act's request for the rows it reaches, in the pieces the route accepts. */\n const saveThroughRoute = useCallback(\n (targets: readonly ContactBulkRow[], set: ContactUpdateFields) =>\n runCrmBulkBatch(\n targets,\n (row) => row.$id,\n contactBulkAddressOf,\n (piece) => contactUpdate.updateMany(piece.map((row) => row.$id), set),\n CRM_CONTACT_UPDATE_MAX,\n ),\n [contactUpdate],\n )\n\n const handleApply = useCallback(async () => {\n if (!pending || !scope) return\n /*\n * A row no site holds has no facet to write. Under a site every selected\n * row is the viewing group's; at the organization level (AGL-2630) each\n * row was flattened through its own primary holder and is written back\n * through it, so a row nobody holds yet is left out and says so.\n */\n const held: ContactBulkRow[] = []\n const unheld: ContactBulkSkip[] = []\n for (const row of selectedRows) {\n if (consentGroup || row.groupId) held.push(row)\n else {\n unheld.push({\n email: contactBulkAddressOf(row),\n reason: 'no site holds this contact yet',\n })\n }\n }\n\n const planned = ((): { selection: ContactBulkSelection; job: () => Promise<CrmBulkOutcome> } | null => {\n if (pending === 'add-tag' || pending === 'remove-tag') {\n const tag = normalizeBulkTag(value)\n if (!tag) return null\n const selection =\n pending === 'add-tag' ? planAddTag(held, tag) : planRemoveTag(held, tag)\n const set: ContactUpdateFields =\n pending === 'add-tag' ? { addTag: tag } : { removeTag: tag }\n return { selection, job: () => saveThroughRoute(selection.rows, set) }\n }\n if (pending === 'owner') {\n return {\n selection: { rows: held, skipped: [] },\n job: () => saveThroughRoute(held, { ownerUid: value }),\n }\n }\n if (pending === 'company') {\n const companyId = company?.id ?? null\n const selection = planSetCompany(held, companyId)\n return { selection, job: () => saveThroughRoute(selection.rows, { companyId }) }\n }\n if (!value) return null\n const stage = value as ContactLifecycleStage\n return {\n selection: { rows: held, skipped: [] },\n /*\n * One row at a time through the one writer of a contact's stage, on\n * the site that holds the row: the mounted site, or at the\n * organization level the row's own holder's.\n */\n job: () =>\n runCrmBulkCalls(held, contactBulkAddressOf, async (row) => {\n const site = hostId ?? (row.holderHostId || null)\n if (!site) throw new Error('no site holds this contact yet')\n await setContactStage(user, site, row.$id, stage)\n }),\n }\n })()\n if (!planned) return\n const action = pending\n setPending(null)\n await apply({\n attempted: planned.selection.rows.length,\n skipped: [...unheld, ...planned.selection.skipped].map(skippedLine),\n job: planned.job,\n done: (count) => doneSentence(action, count),\n })\n }, [\n pending,\n scope,\n selectedRows,\n consentGroup,\n value,\n company,\n saveThroughRoute,\n hostId,\n user,\n apply,\n ])\n\n const handleExport = useCallback(() => {\n downloadTextFile(\n 'contacts-selected.csv',\n 'text/csv',\n contactsCsv(selectedRows, csv),\n )\n }, [selectedRows, csv])\n\n const handleDetach = useCallback(async () => {\n if (!scope || !selectedRows.length || !consentGroup) return\n const count = selectedRows.length\n const confirmed = await confirm({\n title: count === 1 ? 'Remove this contact?' : `Remove ${count} contacts?`,\n description:\n `${count === 1 ? 'This person is' : `These ${count} people are`} ` +\n \"removed from this site's Contacts, along with their notes, tags and \" +\n 'timeline. Other sites that captured the same people keep their own ' +\n 'records. Their form submissions, orders, bookings, and membership ' +\n 'records are separate — delete those from their own pages if the ' +\n 'request covers them.',\n confirmationText: count === 1 ? 'Remove contact' : 'Remove contacts',\n confirmationButtonProps: { color: 'error' },\n })\n // `confirm` resolves with no value and REJECTS on cancel.\n .then(() => true)\n .catch(() => false)\n if (!confirmed) return\n const plan = planDetach(selectedRows, consentGroup, Date.now())\n const outcome = await apply({\n attempted: plan.writes.length,\n skipped: plan.skipped.map(skippedLine),\n job: () => runCrmBulkWrites(writers, plan.writes, (write) => write.email),\n done: (done) => doneSentence('detach', done),\n })\n // The rows that went are gone from the table; the refused ones stay\n // selected, so the reader can see which they are and try again.\n const refused = new Set(outcome.refused.map((row) => row.label))\n onSelectedChange(\n selectedRows\n .filter((row) => refused.has(contactBulkAddressOf(row)))\n .map((row) => row.$id),\n )\n }, [scope, selectedRows, confirm, apply, writers, consentGroup, onSelectedChange])\n\n const emails = selectedRows\n .map((row) => String(row.email ?? '').trim())\n .filter(Boolean)\n\n return (\n <CrmBulkBarFrame\n count={selected.length}\n noun={NOUN}\n busy={busy}\n onClear={() => onSelectedChange([])}\n report={report}\n onDismissReport={dismissReport}\n extras={\n <>\n <CrmBulkValueDialog\n open={pending !== null}\n title={pending ? ACTION_TITLES[pending] : ''}\n count={selected.length}\n noun={NOUN}\n busy={busy}\n canApply={\n !(pending === 'stage' && !value) &&\n !(\n (pending === 'add-tag' || pending === 'remove-tag') &&\n !normalizeBulkTag(value)\n )\n }\n onClose={() => setPending(null)}\n onApply={() => void handleApply()}\n >\n {pending === 'add-tag' || pending === 'remove-tag' ? (\n <TextField\n autoFocus\n size=\"small\"\n label=\"Tag\"\n placeholder=\"vip\"\n value={value}\n onChange={(event) => setValue(event.target.value)}\n helperText={\n pending === 'add-tag'\n ? 'Lowercased, like the tags on a profile'\n : 'Removed wherever it is present'\n }\n />\n ) : pending === 'owner' ? (\n <TextField\n select\n size=\"small\"\n label=\"Owner\"\n value={value}\n onChange={(event) => setValue(event.target.value)}\n error={Boolean(team.error)}\n helperText={team.error ?? (team.ready ? undefined : 'Loading the team…')}\n >\n <MenuItem value=\"\">{'Nobody — clear the owner'}</MenuItem>\n {team.options.map((member) => (\n <MenuItem key={member.uid} value={member.uid}>\n {member.label}\n </MenuItem>\n ))}\n </TextField>\n ) : pending === 'stage' ? (\n <TextField\n select\n size=\"small\"\n label=\"Lifecycle stage\"\n value={value}\n onChange={(event) => setValue(event.target.value)}\n >\n {CONTACT_LIFECYCLE_STAGES.map((stage) => (\n <MenuItem key={stage} value={stage}>\n {CONTACT_LIFECYCLE_STAGE_LABELS[stage]}\n </MenuItem>\n ))}\n </TextField>\n ) : pending === 'company' ? (\n <CompanyPicker\n options={companies.options}\n ready={companies.ready}\n truncated={companies.truncated}\n value={company?.id ?? null}\n onChange={(_id, picked) => setCompany(picked)}\n onCreate={createCompany}\n helperText=\"Leave it empty to unlink the selected contacts from their companies.\"\n />\n ) : null}\n </CrmBulkValueDialog>\n {listOpen ? (\n <AddToListDialog\n open\n onClose={() => setListOpen(false)}\n hostId={createHostId}\n scope={scope}\n emails={emails}\n />\n ) : null}\n </>\n }\n >\n <Button size=\"small\" disabled={busy || !scope} onClick={() => openAction('add-tag')}>\n {'Add tag'}\n </Button>\n <Button\n size=\"small\"\n disabled={busy || !scope}\n onClick={() => openAction('remove-tag')}\n >\n {'Remove tag'}\n </Button>\n {suiteLocked ? (\n <>\n <CrmSuiteLockedButton>{'Set owner'}</CrmSuiteLockedButton>\n <CrmSuiteLockedButton>{'Set stage'}</CrmSuiteLockedButton>\n <CrmSuiteLockedButton>{'Set company'}</CrmSuiteLockedButton>\n </>\n ) : (\n <>\n <Button size=\"small\" disabled={busy || !scope} onClick={() => openAction('owner')}>\n {'Set owner'}\n </Button>\n <Button size=\"small\" disabled={busy || !scope} onClick={() => openAction('stage')}>\n {'Set stage'}\n </Button>\n <Button\n size=\"small\"\n disabled={busy || !scope}\n onClick={() => openAction('company')}\n >\n {'Set company'}\n </Button>\n </>\n )}\n <Button\n size=\"small\"\n disabled={busy || !scope || !emails.length || !createHostId}\n onClick={() => setListOpen(true)}\n >\n {'Add to list'}\n </Button>\n <Button size=\"small\" disabled={busy} onClick={handleExport}>\n {'Export CSV'}\n </Button>\n {/*\n The selection's file is the rows on screen; this one is the whole\n collection, streamed by the server (AGL-2662).\n */}\n <CrmExportAllButton\n resource=\"contacts\"\n orgId={scope?.[1] ?? null}\n hostId={hostId}\n disabled={busy}\n />\n {/*\n Only under a site. The act is a DETACH from the viewing site's\n CRM, and at the organization level there is no viewing site — an\n org-wide member removes a person from a site by opening the record\n under that site.\n */}\n {consentGroup ? (\n <Button\n size=\"small\"\n color=\"error\"\n disabled={busy || !scope}\n onClick={() => void handleDetach()}\n >\n {'Remove from this site'}\n </Button>\n ) : null}\n </CrmBulkBarFrame>\n )\n}\nContactsBulkBarBody.displayName = 'ContactsBulkBarBody'\n\nexport default ContactsBulkBar\n"],"names":["CONTACT_LIFECYCLE_STAGE_LABELS","CONTACT_LIFECYCLE_STAGES","useConfirmationContext","Button","MenuItem","TextField","deleteDoc","doc","updateDoc","writeBatch","useCallback","useMemo","useState","useFirestore","useOrgMemberOptions","useUser","useContactUpdate","useCrmBulkApply","useCrmScope","CRM_CONTACT_UPDATE_MAX","setContactStage","contactBulkAddressOf","normalizeBulkTag","planAddTag","planDetach","planRemoveTag","planSetCompany","contactsCsv","downloadTextFile","runCrmBulkBatch","runCrmBulkCalls","runCrmBulkWrites","AddToListDialog","CompanyPicker","useCompanyOptions","useCreateCompany","CrmBulkBarFrame","CrmBulkValueDialog","countNoun","CrmExportAllButton","CrmSuiteLockedButton","NOUN","singular","plural","ACTION_TITLES","owner","stage","company","doneSentence","action","done","people","skippedLine","row","label","email","reason","ContactsBulkBar","props","selected","length","ContactsBulkBarBody","displayName","team","hostId","org","scope","consentGroup","rows","onSelectedChange","csv","suiteLocked","firestore","data","user","confirm","busy","report","apply","dismissReport","recordKind","contactUpdate","selectedRows","chosen","Set","filter","has","$id","pending","setPending","value","setValue","setCompany","listOpen","setListOpen","enabled","companies","createCompany","createHostId","openAction","writers","refFor","id","commitBatch","writes","batch","write","kind","delete","update","commit","commitOne","saveThroughRoute","targets","set","piece","updateMany","map","handleApply","held","unheld","groupId","push","planned","tag","selection","addTag","removeTag","job","skipped","ownerUid","companyId","site","holderHostId","Error","attempted","count","handleExport","handleDetach","confirmed","title","description","confirmationText","confirmationButtonProps","color","then","catch","plan","Date","now","outcome","refused","emails","String","trim","Boolean","noun","onClear","onDismissReport","extras","open","canApply","onClose","onApply","autoFocus","size","placeholder","onChange","event","target","helperText","select","error","ready","undefined","options","member","uid","truncated","_id","picked","onCreate","disabled","onClick","resource","orgId"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CC,GAED,SAEEA,8BAA8B,EAC9BC,wBAAwB,QAGnB,eAAc;AACrB,SAASC,sBAAsB,QAAQ,uBAAsB;AAC7D,SAASC,MAAM,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,gBAAe;AAC3D,SAASC,SAAS,EAAEC,GAAG,EAAEC,SAAS,EAAEC,UAAU,QAAQ,qBAAoB;AAC1E,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AACtD,SACEC,YAAY,EACZC,mBAAmB,EACnBC,OAAO,QACF,iCAAgC;AACvC,SAASC,gBAAgB,QAAQ,iCAA6B;AAC9D,SAASC,eAAe,QAAQ,iCAA6B;AAC7D,SAASC,WAAW,QAAQ,4BAAwB;AACpD,SAASC,sBAAsB,QAAkC,6BAAyB;AAC1F,SAASC,eAAe,QAAQ,sBAAkB;AAClD,SACEC,oBAAoB,EACpBC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,aAAa,EACbC,cAAc,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V;gBAAOqH,SAAS,IAAMpF,WAAW;0BACtE;;0BAEH,KAAChG;gBACCkK,MAAK;gBACLiB,UAAU1G,QAAQ,CAACV;gBACnBqH,SAAS,IAAMpF,WAAW;0BAEzB;;YAEF5B,4BACC;;kCACE,KAAC/B;kCAAsB;;kCACvB,KAACA;kCAAsB;;kCACvB,KAACA;kCAAsB;;;+BAGzB;;kCACE,KAACrC;wBAAOkK,MAAK;wBAAQiB,UAAU1G,QAAQ,CAACV;wBAAOqH,SAAS,IAAMpF,WAAW;kCACtE;;kCAEH,KAAChG;wBAAOkK,MAAK;wBAAQiB,UAAU1G,QAAQ,CAACV;wBAAOqH,SAAS,IAAMpF,WAAW;kCACtE;;kCAEH,KAAChG;wBACCkK,MAAK;wBACLiB,UAAU1G,QAAQ,CAACV;wBACnBqH,SAAS,IAAMpF,WAAW;kCAEzB;;;;0BAIP,KAAChG;gBACCkK,MAAK;gBACLiB,UAAU1G,QAAQ,CAACV,SAAS,CAACsF,OAAO5F,MAAM,IAAI,CAACsC;gBAC/CqF,SAAS,IAAMzF,YAAY;0BAE1B;;0BAEH,KAAC3F;gBAAOkK,MAAK;gBAAQiB,UAAU1G;gBAAM2G,SAAS9C;0BAC3C;;0BAMH,KAAClG;gBACCiJ,UAAS;gBACTC,KAAK,WAAEvH,yBAAAA,KAAO,CAAC,EAAE,oBAAI;gBACrBF,QAAQA;gBACRsH,UAAU1G;;YAQXT,6BACC,KAAChE;gBACCkK,MAAK;gBACLrB,OAAM;gBACNsC,UAAU1G,QAAQ,CAACV;gBACnBqH,SAAS,IAAM,KAAK7C;0BAEnB;iBAED;;;AAGV;AACA7E,oBAAoBC,WAAW,GAAG;AAElC,eAAeL,gBAAe"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ConsolePluginPageProps } from '@aglyn/aglyn';
|
|
2
|
+
/**
|
|
3
|
+
* Contacts CRM (AGL-198): the unified people list fed by AGL-197's
|
|
4
|
+
* ingestion — search, source badges, a profile drawer with the
|
|
5
|
+
* interaction timeline plus tags/notes editing, and CSV export. Part of
|
|
6
|
+
* the CRM, included from Starter (AGL-2851); the contactsPerHost band
|
|
7
|
+
* counts the records in it.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Contacts CRM (AGL-109 → AGL-395): the unified contacts list, segments,
|
|
11
|
+
* and profile drawer, owned by the contacts plugin and rendered by the
|
|
12
|
+
* shell's generic plugin route. The shell applies the `release_crm`
|
|
13
|
+
* gate (via the nav tab) and passes the resolved `org` doc for the
|
|
14
|
+
* `contactsPerHost` quota check.
|
|
15
|
+
*
|
|
16
|
+
* Since AGL-2595 this is the `people` SECTION of the Contacts hub rather
|
|
17
|
+
* than the whole page: `crm-console-page.tsx` routes to it, and the
|
|
18
|
+
* companies, deals, tasks, reports and fields sections sit beside it. The
|
|
19
|
+
* body is the v1 page unchanged, and it takes the shell's full prop bag so
|
|
20
|
+
* nothing the v1 page read has to be threaded through the hub by name.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ContactsPeopleSection(props: ConsolePluginPageProps): import("react").JSX.Element;
|
|
23
|
+
export declare namespace ContactsPeopleSection {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
26
|
+
export default ContactsPeopleSection;
|