@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,340 @@
|
|
|
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 deals table, for whatever rows are ticked (AGL-2621).
|
|
21
|
+
*
|
|
22
|
+
* Move them to a stage, mark them lost, hand them to an owner, take them
|
|
23
|
+
* into a spreadsheet, or delete them. The owner and the delete are
|
|
24
|
+
* document writes and go through the shared runner in batches; the stage
|
|
25
|
+
* and the loss go through `crm/deal-stage`, ONE REQUEST PER DEAL, because
|
|
26
|
+
* a stage change is what an automation listens for and only the route
|
|
27
|
+
* emits the event — a batch that wrote `stageId` would move forty deals
|
|
28
|
+
* and tell no workflow. Each refusal carries the route's own sentence,
|
|
29
|
+
* named by the deal.
|
|
30
|
+
*
|
|
31
|
+
* ## Set stage needs one pipeline
|
|
32
|
+
*
|
|
33
|
+
* A stage belongs to a pipeline, and a selection that spans two has no
|
|
34
|
+
* one list of stages to offer. The dialog says so rather than offering the
|
|
35
|
+
* first pipeline's stages to a deal in the second, which the route would
|
|
36
|
+
* refuse one row at a time.
|
|
37
|
+
*/ import { CRM_COLLECTIONS, dealStageById } from "@aglyn/aglyn";
|
|
38
|
+
import { useConfirmationContext } from "@aglyn/shared-ui-jsx";
|
|
39
|
+
import { useFirestore, useHostActivityLogger } from "@aglyn/tenant-feature-instance";
|
|
40
|
+
import { Button, MenuItem, TextField, Typography } from "@mui/material";
|
|
41
|
+
import { deleteField, doc } from "firebase/firestore";
|
|
42
|
+
import { useCallback, useMemo, useState } from "react";
|
|
43
|
+
import { useCrmBulkApply } from "../hooks/use-crm-bulk-apply.js";
|
|
44
|
+
import { downloadTextFile } from "../model/contacts-csv.js";
|
|
45
|
+
import { crmBulkWriters, runCrmBulkCalls, runCrmBulkWrites } from "../model/crm-bulk-writes.js";
|
|
46
|
+
import { closingStage, openStages } from "../model/deal-board-model.js";
|
|
47
|
+
import { dealsCsv } from "../model/deals-csv.js";
|
|
48
|
+
import { CrmBulkBarFrame, CrmBulkValueDialog, countNoun } from "./crm-bulk-bar-frame.js";
|
|
49
|
+
import CrmExportAllButton from "./crm-export-all-button.js";
|
|
50
|
+
import { LostReasonDialog } from "./lost-reason-dialog.js";
|
|
51
|
+
const NOUN = {
|
|
52
|
+
singular: 'deal',
|
|
53
|
+
plural: 'deals'
|
|
54
|
+
};
|
|
55
|
+
const ACTION_TITLES = {
|
|
56
|
+
stage: 'Set the stage',
|
|
57
|
+
owner: 'Set the owner'
|
|
58
|
+
};
|
|
59
|
+
/** The label a report lists a deal under. */ const labelOf = (deal)=>deal.title || 'Untitled deal';
|
|
60
|
+
export function DealsBulkBar(props) {
|
|
61
|
+
if (!props.selected.length) return null;
|
|
62
|
+
return /*#__PURE__*/ _jsx(DealsBulkBarBody, _extends({}, props));
|
|
63
|
+
}
|
|
64
|
+
DealsBulkBar.displayName = 'DealsBulkBar';
|
|
65
|
+
function DealsBulkBarBody(props) {
|
|
66
|
+
var _roster_error, _ref, _ref1;
|
|
67
|
+
var _selectedRows_;
|
|
68
|
+
const { hostId, scope, rows, selected, onSelectedChange, pipelineById, roster, api, csv } = props;
|
|
69
|
+
const firestore = useFirestore();
|
|
70
|
+
const { confirm } = useConfirmationContext();
|
|
71
|
+
const logActivity = useHostActivityLogger(hostId != null ? hostId : undefined);
|
|
72
|
+
const { busy, report, apply, dismissReport } = useCrmBulkApply({
|
|
73
|
+
recordKind: 'deal'
|
|
74
|
+
});
|
|
75
|
+
const selectedRows = useMemo(()=>{
|
|
76
|
+
const chosen = new Set(selected);
|
|
77
|
+
return rows.filter((row)=>chosen.has(row.$id));
|
|
78
|
+
}, [
|
|
79
|
+
rows,
|
|
80
|
+
selected
|
|
81
|
+
]);
|
|
82
|
+
/*
|
|
83
|
+
* The one pipeline the selection is in, or `null` when it spans more
|
|
84
|
+
* than one — in which case Set stage has no list to offer.
|
|
85
|
+
*/ const pipeline = useMemo(()=>{
|
|
86
|
+
const ids = new Set(selectedRows.map((deal)=>{
|
|
87
|
+
var _deal_pipelineId;
|
|
88
|
+
return String((_deal_pipelineId = deal.pipelineId) != null ? _deal_pipelineId : '');
|
|
89
|
+
}));
|
|
90
|
+
return ids.size === 1 ? pipelineById([
|
|
91
|
+
...ids
|
|
92
|
+
][0]) : null;
|
|
93
|
+
}, [
|
|
94
|
+
selectedRows,
|
|
95
|
+
pipelineById
|
|
96
|
+
]);
|
|
97
|
+
const stages = useMemo(()=>{
|
|
98
|
+
if (!pipeline) return [];
|
|
99
|
+
const won = closingStage(pipeline, 'won');
|
|
100
|
+
return [
|
|
101
|
+
...openStages(pipeline),
|
|
102
|
+
...won ? [
|
|
103
|
+
won
|
|
104
|
+
] : []
|
|
105
|
+
];
|
|
106
|
+
}, [
|
|
107
|
+
pipeline
|
|
108
|
+
]);
|
|
109
|
+
const [pending, setPending] = useState(null);
|
|
110
|
+
const [value, setValue] = useState('');
|
|
111
|
+
const [losing, setLosing] = useState(false);
|
|
112
|
+
const writers = useMemo(()=>crmBulkWriters(firestore, (id)=>{
|
|
113
|
+
var _ref, _ref1;
|
|
114
|
+
return doc(firestore, (_ref = scope == null ? void 0 : scope[0]) != null ? _ref : 'orgs', (_ref1 = scope == null ? void 0 : scope[1]) != null ? _ref1 : '', CRM_COLLECTIONS.deals, id);
|
|
115
|
+
}), [
|
|
116
|
+
firestore,
|
|
117
|
+
scope
|
|
118
|
+
]);
|
|
119
|
+
const openAction = (action)=>{
|
|
120
|
+
setValue('');
|
|
121
|
+
setPending(action);
|
|
122
|
+
};
|
|
123
|
+
const runPlan = useCallback((plan, done)=>apply({
|
|
124
|
+
attempted: plan.writes.length,
|
|
125
|
+
skipped: plan.skipped,
|
|
126
|
+
job: ()=>runCrmBulkWrites(writers, plan.writes, (write)=>write.label),
|
|
127
|
+
done
|
|
128
|
+
}), [
|
|
129
|
+
apply,
|
|
130
|
+
writers
|
|
131
|
+
]);
|
|
132
|
+
/** One route request per deal, in order, named by title. */ const runCalls = useCallback((call, done)=>apply({
|
|
133
|
+
attempted: selectedRows.length,
|
|
134
|
+
skipped: [],
|
|
135
|
+
job: ()=>runCrmBulkCalls(selectedRows, labelOf, call),
|
|
136
|
+
done,
|
|
137
|
+
// The stage route writes the org's line per deal (AGL-2634).
|
|
138
|
+
loggedByRoute: true
|
|
139
|
+
}), [
|
|
140
|
+
apply,
|
|
141
|
+
selectedRows
|
|
142
|
+
]);
|
|
143
|
+
const handleApply = useCallback(async ()=>{
|
|
144
|
+
if (!pending || !scope) return;
|
|
145
|
+
const action = pending;
|
|
146
|
+
setPending(null);
|
|
147
|
+
if (action === 'stage') {
|
|
148
|
+
const stage = dealStageById(pipeline, value);
|
|
149
|
+
if (!stage) return;
|
|
150
|
+
await runCalls((deal)=>api.moveToStage(deal, stage.id), (count)=>`Moved ${countNoun(count, NOUN)} to ${stage.name}`);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const nowMs = Date.now();
|
|
154
|
+
const writes = selectedRows.map((deal)=>({
|
|
155
|
+
id: deal.$id,
|
|
156
|
+
label: labelOf(deal),
|
|
157
|
+
kind: 'update',
|
|
158
|
+
data: {
|
|
159
|
+
ownerUid: value ? value : deleteField(),
|
|
160
|
+
updatedAt: new Date(nowMs)
|
|
161
|
+
}
|
|
162
|
+
}));
|
|
163
|
+
await runPlan({
|
|
164
|
+
writes,
|
|
165
|
+
skipped: []
|
|
166
|
+
}, (count)=>`Owner set on ${countNoun(count, NOUN)}`);
|
|
167
|
+
}, [
|
|
168
|
+
pending,
|
|
169
|
+
scope,
|
|
170
|
+
value,
|
|
171
|
+
pipeline,
|
|
172
|
+
selectedRows,
|
|
173
|
+
api,
|
|
174
|
+
runCalls,
|
|
175
|
+
runPlan
|
|
176
|
+
]);
|
|
177
|
+
const handleLost = useCallback(async (reason)=>{
|
|
178
|
+
setLosing(false);
|
|
179
|
+
await runCalls((deal)=>api.markLost(deal, reason), (count)=>`Marked ${countNoun(count, NOUN)} lost`);
|
|
180
|
+
}, [
|
|
181
|
+
api,
|
|
182
|
+
runCalls
|
|
183
|
+
]);
|
|
184
|
+
const handleExport = useCallback(()=>{
|
|
185
|
+
downloadTextFile('deals-selected.csv', 'text/csv', dealsCsv(selectedRows, csv));
|
|
186
|
+
}, [
|
|
187
|
+
selectedRows,
|
|
188
|
+
csv
|
|
189
|
+
]);
|
|
190
|
+
const handleDelete = useCallback(async ()=>{
|
|
191
|
+
if (!scope || !selectedRows.length) return;
|
|
192
|
+
const count = selectedRows.length;
|
|
193
|
+
const confirmed = await confirm({
|
|
194
|
+
title: count === 1 ? 'Delete this deal?' : `Delete ${count} deals?`,
|
|
195
|
+
description: `${count === 1 ? 'It is' : 'They are'} removed from the pipeline along ` + 'with their notes. The contacts and the companies they name are not ' + 'touched.',
|
|
196
|
+
confirmationText: count === 1 ? 'Delete deal' : 'Delete deals',
|
|
197
|
+
confirmationButtonProps: {
|
|
198
|
+
color: 'error'
|
|
199
|
+
}
|
|
200
|
+
})// `confirm` resolves with no value and REJECTS on cancel.
|
|
201
|
+
.then(()=>true).catch(()=>false);
|
|
202
|
+
if (!confirmed) return;
|
|
203
|
+
const writes = selectedRows.map((deal)=>({
|
|
204
|
+
id: deal.$id,
|
|
205
|
+
label: labelOf(deal),
|
|
206
|
+
kind: 'delete'
|
|
207
|
+
}));
|
|
208
|
+
const outcome = await runPlan({
|
|
209
|
+
writes,
|
|
210
|
+
skipped: []
|
|
211
|
+
}, (done)=>`Deleted ${countNoun(done, NOUN)}`);
|
|
212
|
+
// One line per deal that went, as its own page would write.
|
|
213
|
+
const refused = new Set(outcome.refused.map((row)=>row.label));
|
|
214
|
+
for (const deal of selectedRows){
|
|
215
|
+
if (!refused.has(labelOf(deal))) {
|
|
216
|
+
logActivity('Deleted deal', {
|
|
217
|
+
type: 'deal',
|
|
218
|
+
id: deal.$id,
|
|
219
|
+
name: deal.title
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
onSelectedChange(selectedRows.filter((deal)=>refused.has(labelOf(deal))).map((deal)=>deal.$id));
|
|
224
|
+
}, [
|
|
225
|
+
scope,
|
|
226
|
+
selectedRows,
|
|
227
|
+
confirm,
|
|
228
|
+
runPlan,
|
|
229
|
+
logActivity,
|
|
230
|
+
onSelectedChange
|
|
231
|
+
]);
|
|
232
|
+
return /*#__PURE__*/ _jsxs(CrmBulkBarFrame, {
|
|
233
|
+
count: selected.length,
|
|
234
|
+
noun: NOUN,
|
|
235
|
+
busy: busy,
|
|
236
|
+
onClear: ()=>onSelectedChange([]),
|
|
237
|
+
report: report,
|
|
238
|
+
onDismissReport: dismissReport,
|
|
239
|
+
extras: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
240
|
+
children: [
|
|
241
|
+
/*#__PURE__*/ _jsx(CrmBulkValueDialog, {
|
|
242
|
+
open: pending !== null,
|
|
243
|
+
title: pending ? ACTION_TITLES[pending] : '',
|
|
244
|
+
count: selected.length,
|
|
245
|
+
noun: NOUN,
|
|
246
|
+
busy: busy,
|
|
247
|
+
canApply: pending === 'owner' || Boolean(value),
|
|
248
|
+
onClose: ()=>setPending(null),
|
|
249
|
+
onApply: ()=>void handleApply(),
|
|
250
|
+
children: pending === 'stage' ? pipeline ? /*#__PURE__*/ _jsx(TextField, {
|
|
251
|
+
select: true,
|
|
252
|
+
size: "small",
|
|
253
|
+
label: "Stage",
|
|
254
|
+
value: value,
|
|
255
|
+
onChange: (event)=>setValue(event.target.value),
|
|
256
|
+
helperText: `${pipeline.name} — each move fires its event, as a drag does`,
|
|
257
|
+
children: stages.map((stage)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
258
|
+
value: stage.id,
|
|
259
|
+
children: stage.name
|
|
260
|
+
}, stage.id))
|
|
261
|
+
}) : /*#__PURE__*/ _jsx(Typography, {
|
|
262
|
+
variant: "body2",
|
|
263
|
+
color: "text.secondary",
|
|
264
|
+
children: 'The selected deals are in different pipelines, so there is ' + 'no one list of stages to move them to. Select deals from ' + 'one pipeline.'
|
|
265
|
+
}) : pending === 'owner' ? /*#__PURE__*/ _jsxs(TextField, {
|
|
266
|
+
select: true,
|
|
267
|
+
size: "small",
|
|
268
|
+
label: "Owner",
|
|
269
|
+
value: value,
|
|
270
|
+
onChange: (event)=>setValue(event.target.value),
|
|
271
|
+
disabled: roster.loading,
|
|
272
|
+
error: Boolean(roster.error),
|
|
273
|
+
helperText: (_roster_error = roster.error) != null ? _roster_error : roster.loading ? 'Loading the team…' : undefined,
|
|
274
|
+
children: [
|
|
275
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
276
|
+
value: "",
|
|
277
|
+
children: 'Nobody — clear the owner'
|
|
278
|
+
}),
|
|
279
|
+
roster.members.map((member)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
280
|
+
value: member.uid,
|
|
281
|
+
children: member.label
|
|
282
|
+
}, member.uid))
|
|
283
|
+
]
|
|
284
|
+
}) : null
|
|
285
|
+
}),
|
|
286
|
+
/*#__PURE__*/ _jsx(LostReasonDialog, {
|
|
287
|
+
open: losing,
|
|
288
|
+
dealTitle: (_ref = (_selectedRows_ = selectedRows[0]) == null ? void 0 : _selectedRows_.title) != null ? _ref : '',
|
|
289
|
+
count: selectedRows.length,
|
|
290
|
+
busy: busy,
|
|
291
|
+
onClose: ()=>setLosing(false),
|
|
292
|
+
onConfirm: (reason)=>void handleLost(reason)
|
|
293
|
+
})
|
|
294
|
+
]
|
|
295
|
+
}),
|
|
296
|
+
children: [
|
|
297
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
298
|
+
size: "small",
|
|
299
|
+
disabled: busy || !scope,
|
|
300
|
+
onClick: ()=>openAction('stage'),
|
|
301
|
+
children: 'Set stage'
|
|
302
|
+
}),
|
|
303
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
304
|
+
size: "small",
|
|
305
|
+
disabled: busy || !scope,
|
|
306
|
+
onClick: ()=>openAction('owner'),
|
|
307
|
+
children: 'Set owner'
|
|
308
|
+
}),
|
|
309
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
310
|
+
size: "small",
|
|
311
|
+
disabled: busy || !scope,
|
|
312
|
+
onClick: ()=>setLosing(true),
|
|
313
|
+
children: 'Mark lost'
|
|
314
|
+
}),
|
|
315
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
316
|
+
size: "small",
|
|
317
|
+
disabled: busy,
|
|
318
|
+
onClick: handleExport,
|
|
319
|
+
children: 'Export CSV'
|
|
320
|
+
}),
|
|
321
|
+
/*#__PURE__*/ _jsx(CrmExportAllButton, {
|
|
322
|
+
resource: "deals",
|
|
323
|
+
orgId: (_ref1 = scope == null ? void 0 : scope[1]) != null ? _ref1 : null,
|
|
324
|
+
hostId: hostId,
|
|
325
|
+
disabled: busy
|
|
326
|
+
}),
|
|
327
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
328
|
+
size: "small",
|
|
329
|
+
color: "error",
|
|
330
|
+
disabled: busy || !scope,
|
|
331
|
+
onClick: ()=>void handleDelete(),
|
|
332
|
+
children: 'Delete'
|
|
333
|
+
})
|
|
334
|
+
]
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
DealsBulkBarBody.displayName = 'DealsBulkBarBody';
|
|
338
|
+
export default DealsBulkBar;
|
|
339
|
+
|
|
340
|
+
//# sourceMappingURL=deals-bulk-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/deals-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 deals table, for whatever rows are ticked (AGL-2621).\n *\n * Move them to a stage, mark them lost, hand them to an owner, take them\n * into a spreadsheet, or delete them. The owner and the delete are\n * document writes and go through the shared runner in batches; the stage\n * and the loss go through `crm/deal-stage`, ONE REQUEST PER DEAL, because\n * a stage change is what an automation listens for and only the route\n * emits the event — a batch that wrote `stageId` would move forty deals\n * and tell no workflow. Each refusal carries the route's own sentence,\n * named by the deal.\n *\n * ## Set stage needs one pipeline\n *\n * A stage belongs to a pipeline, and a selection that spans two has no\n * one list of stages to offer. The dialog says so rather than offering the\n * first pipeline's stages to a deal in the second, which the route would\n * refuse one row at a time.\n */\n\nimport { CRM_COLLECTIONS, dealStageById } from '@aglyn/aglyn'\nimport { useConfirmationContext } from '@aglyn/shared-ui-jsx'\nimport { useFirestore, useHostActivityLogger } from '@aglyn/tenant-feature-instance'\nimport { Button, MenuItem, TextField, Typography } from '@mui/material'\nimport { deleteField, doc } from 'firebase/firestore'\nimport { useCallback, useMemo, useState } from 'react'\nimport { useCrmBulkApply } from '../hooks/use-crm-bulk-apply'\nimport type { DealStageApi } from '../hooks/use-deal-stage-api'\nimport type { OrgMemberDirectory } from '../hooks/use-org-member-directory'\nimport { downloadTextFile } from '../model/contacts-csv'\nimport {\n type CrmBulkPlan,\n type CrmBulkWrite,\n crmBulkWriters,\n runCrmBulkCalls,\n runCrmBulkWrites,\n} from '../model/crm-bulk-writes'\nimport {\n type DealDoc,\n type PipelineDoc,\n closingStage,\n openStages,\n} from '../model/deal-board-model'\nimport { type DealCsvOptions, dealsCsv } from '../model/deals-csv'\nimport {\n type CrmBulkNoun,\n CrmBulkBarFrame,\n CrmBulkValueDialog,\n countNoun,\n} from './crm-bulk-bar-frame'\nimport CrmExportAllButton from './crm-export-all-button'\nimport { LostReasonDialog } from './lost-reason-dialog'\n\nexport interface DealsBulkBarProps {\n /**\n * The site whose activity feed the bar's acts are logged in, or `null`\n * at the organization level (AGL-2630), where the selection spans sites\n * and the org's feed takes one line for the action instead (AGL-2634);\n * a stage move runs as the org there and is logged per deal by the route.\n */\n hostId: string | null\n /** `['orgs', orgId]`, or `null` while the org is unresolved. */\n scope: readonly ['orgs', string] | null\n rows: readonly DealDoc[]\n selected: readonly string[]\n onSelectedChange: (ids: string[]) => void\n /** The pipeline a deal's `pipelineId` names, for the stage list. */\n pipelineById: (id: string | undefined) => PipelineDoc | null\n /** The section's roster — already read for the Owner column. */\n roster: OrgMemberDirectory\n /** The one door a stage change goes through. */\n api: DealStageApi\n /** How the export names the pipeline, the stage and the owner — the table's own. */\n csv?: DealCsvOptions\n}\n\nconst NOUN: CrmBulkNoun = { singular: 'deal', plural: 'deals' }\n\ntype PendingAction = 'stage' | 'owner'\n\nconst ACTION_TITLES: Record<PendingAction, string> = {\n stage: 'Set the stage',\n owner: 'Set the owner',\n}\n\n/** The label a report lists a deal under. */\nconst labelOf = (deal: DealDoc): string => deal.title || 'Untitled deal'\n\nexport function DealsBulkBar(props: DealsBulkBarProps) {\n if (!props.selected.length) return null\n return <DealsBulkBarBody {...props} />\n}\nDealsBulkBar.displayName = 'DealsBulkBar'\n\nfunction DealsBulkBarBody(props: DealsBulkBarProps) {\n const { hostId, scope, rows, selected, onSelectedChange, pipelineById, roster, api, csv } =\n props\n const firestore = useFirestore()\n const { confirm } = useConfirmationContext()\n const logActivity = useHostActivityLogger(hostId ?? undefined)\n const { busy, report, apply, dismissReport } = useCrmBulkApply({ recordKind: 'deal' })\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 /*\n * The one pipeline the selection is in, or `null` when it spans more\n * than one — in which case Set stage has no list to offer.\n */\n const pipeline = useMemo(() => {\n const ids = new Set(selectedRows.map((deal) => String(deal.pipelineId ?? '')))\n return ids.size === 1 ? pipelineById([...ids][0]) : null\n }, [selectedRows, pipelineById])\n const stages = useMemo(() => {\n if (!pipeline) return []\n const won = closingStage(pipeline, 'won')\n return [...openStages(pipeline), ...(won ? [won] : [])]\n }, [pipeline])\n\n const [pending, setPending] = useState<PendingAction | null>(null)\n const [value, setValue] = useState('')\n const [losing, setLosing] = useState(false)\n\n const writers = useMemo(\n () =>\n crmBulkWriters(firestore, (id) =>\n doc(firestore, scope?.[0] ?? 'orgs', scope?.[1] ?? '', CRM_COLLECTIONS.deals, id),\n ),\n [firestore, scope],\n )\n\n const openAction = (action: PendingAction) => {\n setValue('')\n setPending(action)\n }\n\n const runPlan = useCallback(\n (plan: CrmBulkPlan, done: (count: number) => string) =>\n apply({\n attempted: plan.writes.length,\n skipped: plan.skipped,\n job: () => runCrmBulkWrites(writers, plan.writes, (write) => write.label),\n done,\n }),\n [apply, writers],\n )\n\n /** One route request per deal, in order, named by title. */\n const runCalls = useCallback(\n (call: (deal: DealDoc) => Promise<unknown>, done: (count: number) => string) =>\n apply({\n attempted: selectedRows.length,\n skipped: [],\n job: () => runCrmBulkCalls(selectedRows, labelOf, call),\n done,\n // The stage route writes the org's line per deal (AGL-2634).\n loggedByRoute: true,\n }),\n [apply, selectedRows],\n )\n\n const handleApply = useCallback(async () => {\n if (!pending || !scope) return\n const action = pending\n setPending(null)\n if (action === 'stage') {\n const stage = dealStageById(pipeline, value)\n if (!stage) return\n await runCalls(\n (deal) => api.moveToStage(deal, stage.id),\n (count) => `Moved ${countNoun(count, NOUN)} to ${stage.name}`,\n )\n return\n }\n const nowMs = Date.now()\n const writes: CrmBulkWrite[] = selectedRows.map((deal) => ({\n id: deal.$id,\n label: labelOf(deal),\n kind: 'update',\n data: {\n ownerUid: value ? value : deleteField(),\n updatedAt: new Date(nowMs),\n },\n }))\n await runPlan({ writes, skipped: [] }, (count) => `Owner set on ${countNoun(count, NOUN)}`)\n }, [pending, scope, value, pipeline, selectedRows, api, runCalls, runPlan])\n\n const handleLost = useCallback(\n async (reason: string) => {\n setLosing(false)\n await runCalls(\n (deal) => api.markLost(deal, reason),\n (count) => `Marked ${countNoun(count, NOUN)} lost`,\n )\n },\n [api, runCalls],\n )\n\n const handleExport = useCallback(() => {\n downloadTextFile('deals-selected.csv', 'text/csv', dealsCsv(selectedRows, csv))\n }, [selectedRows, csv])\n\n const handleDelete = useCallback(async () => {\n if (!scope || !selectedRows.length) return\n const count = selectedRows.length\n const confirmed = await confirm({\n title: count === 1 ? 'Delete this deal?' : `Delete ${count} deals?`,\n description:\n `${count === 1 ? 'It is' : 'They are'} removed from the pipeline along ` +\n 'with their notes. The contacts and the companies they name are not ' +\n 'touched.',\n confirmationText: count === 1 ? 'Delete deal' : 'Delete deals',\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 writes: CrmBulkWrite[] = selectedRows.map((deal) => ({\n id: deal.$id,\n label: labelOf(deal),\n kind: 'delete',\n }))\n const outcome = await runPlan(\n { writes, skipped: [] },\n (done) => `Deleted ${countNoun(done, NOUN)}`,\n )\n // One line per deal that went, as its own page would write.\n const refused = new Set(outcome.refused.map((row) => row.label))\n for (const deal of selectedRows) {\n if (!refused.has(labelOf(deal))) {\n logActivity('Deleted deal', { type: 'deal', id: deal.$id, name: deal.title })\n }\n }\n onSelectedChange(\n selectedRows.filter((deal) => refused.has(labelOf(deal))).map((deal) => deal.$id),\n )\n }, [scope, selectedRows, confirm, runPlan, logActivity, onSelectedChange])\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={pending === 'owner' || Boolean(value)}\n onClose={() => setPending(null)}\n onApply={() => void handleApply()}\n >\n {pending === 'stage' ? (\n pipeline ? (\n <TextField\n select\n size=\"small\"\n label=\"Stage\"\n value={value}\n onChange={(event) => setValue(event.target.value)}\n helperText={`${pipeline.name} — each move fires its event, as a drag does`}\n >\n {stages.map((stage) => (\n <MenuItem key={stage.id} value={stage.id}>\n {stage.name}\n </MenuItem>\n ))}\n </TextField>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'The selected deals are in different pipelines, so there is ' +\n 'no one list of stages to move them to. Select deals from ' +\n 'one pipeline.'}\n </Typography>\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 disabled={roster.loading}\n error={Boolean(roster.error)}\n helperText={roster.error ?? (roster.loading ? 'Loading the team…' : undefined)}\n >\n <MenuItem value=\"\">{'Nobody — clear the owner'}</MenuItem>\n {roster.members.map((member) => (\n <MenuItem key={member.uid} value={member.uid}>\n {member.label}\n </MenuItem>\n ))}\n </TextField>\n ) : null}\n </CrmBulkValueDialog>\n <LostReasonDialog\n open={losing}\n dealTitle={selectedRows[0]?.title ?? ''}\n count={selectedRows.length}\n busy={busy}\n onClose={() => setLosing(false)}\n onConfirm={(reason) => void handleLost(reason)}\n />\n </>\n }\n >\n <Button size=\"small\" disabled={busy || !scope} onClick={() => openAction('stage')}>\n {'Set stage'}\n </Button>\n <Button size=\"small\" disabled={busy || !scope} onClick={() => openAction('owner')}>\n {'Set owner'}\n </Button>\n <Button size=\"small\" disabled={busy || !scope} onClick={() => setLosing(true)}>\n {'Mark lost'}\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=\"deals\"\n orgId={scope?.[1] ?? null}\n hostId={hostId}\n disabled={busy}\n />\n <Button\n size=\"small\"\n color=\"error\"\n disabled={busy || !scope}\n onClick={() => void handleDelete()}\n >\n {'Delete'}\n </Button>\n </CrmBulkBarFrame>\n )\n}\nDealsBulkBarBody.displayName = 'DealsBulkBarBody'\n\nexport default DealsBulkBar\n"],"names":["CRM_COLLECTIONS","dealStageById","useConfirmationContext","useFirestore","useHostActivityLogger","Button","MenuItem","TextField","Typography","deleteField","doc","useCallback","useMemo","useState","useCrmBulkApply","downloadTextFile","crmBulkWriters","runCrmBulkCalls","runCrmBulkWrites","closingStage","openStages","dealsCsv","CrmBulkBarFrame","CrmBulkValueDialog","countNoun","CrmExportAllButton","LostReasonDialog","NOUN","singular","plural","ACTION_TITLES","stage","owner","labelOf","deal","title","DealsBulkBar","props","selected","length","DealsBulkBarBody","displayName","roster","selectedRows","hostId","scope","rows","onSelectedChange","pipelineById","api","csv","firestore","confirm","logActivity","undefined","busy","report","apply","dismissReport","recordKind","chosen","Set","filter","row","has","$id","pipeline","ids","map","String","pipelineId","size","stages","won","pending","setPending","value","setValue","losing","setLosing","writers","id","deals","openAction","action","runPlan","plan","done","attempted","writes","skipped","job","write","label","runCalls","call","loggedByRoute","handleApply","moveToStage","count","name","nowMs","Date","now","kind","data","ownerUid","updatedAt","handleLost","reason","markLost","handleExport","handleDelete","confirmed","description","confirmationText","confirmationButtonProps","color","then","catch","outcome","refused","type","noun","onClear","onDismissReport","extras","open","canApply","Boolean","onClose","onApply","select","onChange","event","target","helperText","variant","disabled","loading","error","members","member","uid","dealTitle","onConfirm","onClick","resource","orgId"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA;;;;;;;;;;;;;;;;;;CAkBC,GAED,SAASA,eAAe,EAAEC,aAAa,QAAQ,eAAc;AAC7D,SAASC,sBAAsB,QAAQ,uBAAsB;AAC7D,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,iCAAgC;AACpF,SAASC,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAe;AACvE,SAASC,WAAW,EAAEC,GAAG,QAAQ,qBAAoB;AACrD,SAASC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AACtD,SAASC,eAAe,QAAQ,iCAA6B;AAG7D,SAASC,gBAAgB,QAAQ,2BAAuB;AACxD,SAGEC,cAAc,EACdC,eAAe,EACfC,gBAAgB,QACX,8BAA0B;AACjC,SAGEC,YAAY,EACZC,UAAU,QACL,+BAA2B;AAClC,SAA8BC,QAAQ,QAAQ,wBAAoB;AAClE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BsE,OAAOkE,OAAOC,GAAG;8CACzCD,OAAOjD,KAAK;mCADAiD,OAAOC,GAAG;;yBAK3B;;8BAEN,KAACrH;oBACCqG,MAAMjD;oBACNkE,SAAS,WAAErG,iBAAAA,YAAY,CAAC,EAAE,qBAAfA,eAAiBR,KAAK,mBAAI;oBACrCgE,OAAOxD,aAAaJ,MAAM;oBAC1BgB,MAAMA;oBACN2E,SAAS,IAAMnD,UAAU;oBACzBkE,WAAW,CAACpC,SAAW,KAAKD,WAAWC;;;;;0BAK7C,KAACxG;gBAAOkE,MAAK;gBAAQmE,UAAUnF,QAAQ,CAACV;gBAAOqG,SAAS,IAAM/D,WAAW;0BACtE;;0BAEH,KAAC9E;gBAAOkE,MAAK;gBAAQmE,UAAUnF,QAAQ,CAACV;gBAAOqG,SAAS,IAAM/D,WAAW;0BACtE;;0BAEH,KAAC9E;gBAAOkE,MAAK;gBAAQmE,UAAUnF,QAAQ,CAACV;gBAAOqG,SAAS,IAAMnE,UAAU;0BACrE;;0BAEH,KAAC1E;gBAAOkE,MAAK;gBAAQmE,UAAUnF;gBAAM2F,SAASnC;0BAC3C;;0BAMH,KAACtF;gBACC0H,UAAS;gBACTC,KAAK,WAAEvG,yBAAAA,KAAO,CAAC,EAAE,oBAAI;gBACrBD,QAAQA;gBACR8F,UAAUnF;;0BAEZ,KAAClD;gBACCkE,MAAK;gBACL8C,OAAM;gBACNqB,UAAUnF,QAAQ,CAACV;gBACnBqG,SAAS,IAAM,KAAKlC;0BAEnB;;;;AAIT;AACAxE,iBAAiBC,WAAW,GAAG;AAE/B,eAAeL,aAAY"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ConsolePluginPageProps } from '@aglyn/aglyn';
|
|
2
|
+
/**
|
|
3
|
+
* `/crm/deals` — the pipeline (AGL-2598).
|
|
4
|
+
*
|
|
5
|
+
* ## Two views of one pipeline
|
|
6
|
+
*
|
|
7
|
+
* The BOARD is one pipeline's open deals, one column per open stage, read
|
|
8
|
+
* in one bounded listener over `(visibleTo, pipelineId, status, updatedAt)`
|
|
9
|
+
* and sorted into columns here — a listener per column would be five
|
|
10
|
+
* subscriptions for one board. The TABLE is the same pipeline's deals,
|
|
11
|
+
* paged by the query, with a status toggle; it is where the closed history
|
|
12
|
+
* is found. The three figures above both come from the board's read, so
|
|
13
|
+
* they describe what is in play whichever view is showing.
|
|
14
|
+
*
|
|
15
|
+
* ## Which pipeline
|
|
16
|
+
*
|
|
17
|
+
* The switcher in the header (AGL-2620) picks among the ACTIVE pipelines
|
|
18
|
+
* and opens on the default; the board, the table, the figures and the New
|
|
19
|
+
* deal drawer all follow it. It is section state rather than a route: a
|
|
20
|
+
* pipeline is a lens on the section, and a saved view that names one
|
|
21
|
+
* composes with it. **Pipelines** opens the dialog that creates, renames,
|
|
22
|
+
* defaults, archives and — through it — edits the stages of each.
|
|
23
|
+
*
|
|
24
|
+
* ## Every move goes through the route
|
|
25
|
+
*
|
|
26
|
+
* A drag, a card's "Move to", "Mark won" and "Mark lost" all end in
|
|
27
|
+
* `useDealStageApi`, never a Firestore write: the stage is the fact the
|
|
28
|
+
* automations listen for, and only the server emits the event. The section
|
|
29
|
+
* marks the card pending while the request runs and lets the listener land
|
|
30
|
+
* it — see `DealBoard` for why a move is not applied optimistically.
|
|
31
|
+
*
|
|
32
|
+
* ## Creation is a button
|
|
33
|
+
*
|
|
34
|
+
* "New deal" opens a drawer; there is no form above the list. The drawer
|
|
35
|
+
* writes client-direct against the rules, stamped with this console's scope.
|
|
36
|
+
*
|
|
37
|
+
* ## The table selects and exports (AGL-2621)
|
|
38
|
+
*
|
|
39
|
+
* The table's rows are selectable, and a selection raises `DealsBulkBar`
|
|
40
|
+
* over it — whose stage moves go through the same `useDealStageApi` as a
|
|
41
|
+
* drag. Export CSV beside the status toggle writes the page through
|
|
42
|
+
* `dealsCsv()`, naming the pipeline, the stage and the owner; the bar
|
|
43
|
+
* writes the same file over the selection.
|
|
44
|
+
*/
|
|
45
|
+
export declare function DealsSection(props: ConsolePluginPageProps): import("react").JSX.Element;
|
|
46
|
+
export declare namespace DealsSection {
|
|
47
|
+
var displayName: string;
|
|
48
|
+
}
|
|
49
|
+
export default DealsSection;
|