@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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/tasks-calendar.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\nimport { mdiChevronLeft, mdiChevronRight } from '@aglyn/shared-data-mdi'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { Box, Button, ButtonBase, IconButton, Stack, Typography } from '@mui/material'\nimport { useMemo, useState } from 'react'\nimport type { CrmTaskRow } from '../hooks/use-crm-tasks'\nimport {\n bucketTasksByCalendarDay,\n CALENDAR_DAY_LABELS,\n CALENDAR_WEEK_DAYS,\n shiftCalendarMonth,\n taskCalendarMonth,\n} from '../model/task-calendar'\n\n/** How many tasks a square lists before folding the rest into a count. */\nconst TASKS_PER_DAY = 3\n\nexport interface TasksCalendarProps {\n /** The window the list is holding — the calendar reads no more than it. */\n tasks: readonly CrmTaskRow[]\n /** Open one task's drawer, the same drawer a row opens. */\n onOpen: (task: CrmTaskRow) => void\n /** The list's window filled, so neither surface is showing everything. */\n truncated?: boolean\n}\n\n/**\n * A MONTH OF TASKS, BY DUE DATE (AGL-2662).\n *\n * The Tasks list answers \"what is on my plate\"; this answers \"what does\n * next week look like\", which a list ordered by due date can only imply.\n *\n * ## Drawn over the list's own window, and never over a second read\n *\n * The rows are the ones the section already holds. A calendar that fetched\n * its own month would be a second listener over the same collection, would\n * disagree with the list whenever the two windows differed, and would put\n * a read behind every page of the arrows. What it costs instead is honesty:\n * the grid can only place what the window carries, so the tasks due in\n * other months are counted under it rather than implied to be absent.\n *\n * ## Hand-built rather than a calendar dependency\n *\n * Seven columns of MUI boxes and the local-day arithmetic in\n * `task-calendar.ts`. The one calendar package already installed\n * (`@mui/x-date-pickers`) draws a date PICKER — a grid whose squares are\n * choices, not content — so it answers a different question, and a\n * scheduling library for one surface is a dependency the whole console\n * would carry.\n */\nexport function TasksCalendar(props: TasksCalendarProps) {\n const { tasks, onOpen, truncated } = props\n /*\n * The clock is read ONCE, at mount. A component that read `Date.now()`\n * per render would move the today square under a reader who left the tab\n * open across midnight, without any state having changed — and the grid\n * is a pure function of this, so what is drawn can be pinned.\n */\n const [nowMs] = useState(() => Date.now())\n const [anchorMs, setAnchorMs] = useState(() => nowMs)\n\n const month = useMemo(\n () => taskCalendarMonth(anchorMs, nowMs),\n [anchorMs, nowMs],\n )\n const buckets = useMemo(\n () => bucketTasksByCalendarDay(tasks, (task) => task.dueAtMs, month),\n [tasks, month],\n )\n const label = useMemo(\n () =>\n month.monthDate.toLocaleDateString(undefined, {\n month: 'long',\n year: 'numeric',\n }),\n [month],\n )\n\n return (\n <Stack spacing={1.5}>\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center', flexWrap: 'wrap', rowGap: 1 }}\n >\n <IconButton\n size=\"small\"\n aria-label=\"Previous month\"\n onClick={() => setAnchorMs((current) => shiftCalendarMonth(current, -1))}\n >\n <MdiIcon path={mdiChevronLeft.path} size={0.9} />\n </IconButton>\n <Typography variant=\"subtitle1\" sx={{ minWidth: 160, textAlign: 'center' }}>\n {label}\n </Typography>\n <IconButton\n size=\"small\"\n aria-label=\"Next month\"\n onClick={() => setAnchorMs((current) => shiftCalendarMonth(current, 1))}\n >\n <MdiIcon path={mdiChevronRight.path} size={0.9} />\n </IconButton>\n <Button size=\"small\" onClick={() => setAnchorMs(nowMs)}>\n {'Today'}\n </Button>\n </Stack>\n\n <Box sx={{ overflowX: 'auto' }}>\n <Box sx={{ minWidth: 640 }}>\n <Box\n sx={{\n display: 'grid',\n gridTemplateColumns: `repeat(${CALENDAR_WEEK_DAYS}, 1fr)`,\n gap: 0.5,\n mb: 0.5,\n }}\n >\n {CALENDAR_DAY_LABELS.map((day) => (\n <Typography\n key={day}\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ textAlign: 'center' }}\n >\n {day}\n </Typography>\n ))}\n </Box>\n <Box\n sx={{\n display: 'grid',\n gridTemplateColumns: `repeat(${CALENDAR_WEEK_DAYS}, 1fr)`,\n gap: 0.5,\n }}\n >\n {month.weeks.flat().map((day) => {\n const held = buckets.byDay.get(day.startMs) ?? []\n const shown = held.slice(0, TASKS_PER_DAY)\n const folded = held.length - shown.length\n return (\n <Box\n key={day.startMs}\n sx={{\n minHeight: 96,\n p: 0.75,\n borderRadius: 1,\n border: 1,\n borderColor: day.isToday ? 'primary.main' : 'divider',\n bgcolor: day.inMonth ? 'background.paper' : 'action.hover',\n }}\n >\n <Typography\n variant=\"caption\"\n sx={{\n display: 'block',\n mb: 0.5,\n fontWeight: day.isToday ? 'fontWeightBold' : undefined,\n color: day.inMonth ? 'text.primary' : 'text.disabled',\n }}\n >\n {day.date}\n </Typography>\n <Stack spacing={0.25}>\n {shown.map((task) => (\n <ButtonBase\n key={task.$id}\n onClick={() => onOpen(task)}\n sx={{\n justifyContent: 'flex-start',\n width: '100%',\n px: 0.5,\n py: 0.25,\n borderRadius: 0.5,\n bgcolor: 'action.selected',\n '&:hover': { bgcolor: 'action.focus' },\n }}\n >\n <Typography\n variant=\"caption\"\n noWrap\n sx={{\n width: '100%',\n textAlign: 'left',\n textDecoration:\n task.status === 'done' ? 'line-through' : undefined,\n color:\n task.status === 'done'\n ? 'text.secondary'\n : day.endMs <= nowMs\n ? 'error.main'\n : 'text.primary',\n }}\n >\n {task.title}\n </Typography>\n </ButtonBase>\n ))}\n {folded > 0 ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {`+${folded} more`}\n </Typography>\n ) : null}\n </Stack>\n </Box>\n )\n })}\n </Box>\n </Box>\n </Box>\n\n {/*\n What the grid could not place. Said plainly, because a month with\n nothing on it reads as \"nothing is due\" and the honest reading here\n is often \"the window's tasks are somewhere else\".\n */}\n {buckets.undated.length || buckets.elsewhere.length || truncated ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {[\n buckets.elsewhere.length\n ? `${buckets.elsewhere.length} due outside this month`\n : '',\n buckets.undated.length\n ? `${buckets.undated.length} with no due date`\n : '',\n truncated ? 'and the view is showing only its first page' : '',\n ]\n .filter(Boolean)\n .join(' · ')}\n </Typography>\n ) : null}\n </Stack>\n )\n}\nTasksCalendar.displayName = 'TasksCalendar'\n\nexport default TasksCalendar\n"],"names":["mdiChevronLeft","mdiChevronRight","MdiIcon","Box","Button","ButtonBase","IconButton","Stack","Typography","useMemo","useState","bucketTasksByCalendarDay","CALENDAR_DAY_LABELS","CALENDAR_WEEK_DAYS","shiftCalendarMonth","taskCalendarMonth","TASKS_PER_DAY","TasksCalendar","props","tasks","onOpen","truncated","nowMs","Date","now","anchorMs","setAnchorMs","month","buckets","task","dueAtMs","label","monthDate","toLocaleDateString","undefined","year","spacing","direction","sx","alignItems","flexWrap","rowGap","size","aria-label","onClick","current","path","variant","minWidth","textAlign","overflowX","display","gridTemplateColumns","gap","mb","map","day","color","weeks","flat","held","byDay","get","startMs","shown","slice","folded","length","minHeight","p","borderRadius","border","borderColor","isToday","bgcolor","inMonth","fontWeight","date","justifyContent","width","px","py","noWrap","textDecoration","status","endMs","title","$id","undated","elsewhere","filter","Boolean","join","displayName"],"mappings":"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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ConsolePluginPageProps } from '@aglyn/aglyn';
|
|
2
|
+
/**
|
|
3
|
+
* `/crm/tasks` — what the team owes the people in the CRM (AGL-2599).
|
|
4
|
+
*
|
|
5
|
+
* Six views over `orgs/{orgId}/crmTasks`, each a bounded listener on one of
|
|
6
|
+
* the collection's indexes, chosen by a segmented control. A task hangs off
|
|
7
|
+
* a contact, a company or a deal, but it is listed HERE because "what is due
|
|
8
|
+
* today" is a question about the team's day and not about any one record;
|
|
9
|
+
* the record pages carry their own `RecordTasksCard` for the other
|
|
10
|
+
* direction.
|
|
11
|
+
*
|
|
12
|
+
* Completing goes through `crm/task-complete`, because completing fires the
|
|
13
|
+
* `taskCompleted` host event and only the server can run a workflow.
|
|
14
|
+
* Reopening is client-direct: undoing a tick has no side effect beyond the
|
|
15
|
+
* document, and the rules gate it like any other CRM write.
|
|
16
|
+
*
|
|
17
|
+
* The rows are selectable, and a selection raises `TasksBulkBar` over the
|
|
18
|
+
* list — Complete and Assign through their routes, the due date and the
|
|
19
|
+
* delete as batched writes (AGL-2621). Export CSV beside the view control
|
|
20
|
+
* writes the view through `tasksCsv()`, naming the assignee and the linked
|
|
21
|
+
* records; the bar writes the same file over the selection.
|
|
22
|
+
*/
|
|
23
|
+
export declare function TasksSection(props: ConsolePluginPageProps): import("react").JSX.Element;
|
|
24
|
+
export declare namespace TasksSection {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
export default TasksSection;
|
|
@@ -0,0 +1,579 @@
|
|
|
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
|
+
import { CRM_COLLECTIONS, findOrgMember, pluginDocsHelp } from "@aglyn/aglyn";
|
|
20
|
+
import { CardDisplay } from "@aglyn/shared-ui-jsx";
|
|
21
|
+
import { ListTable } from "@aglyn/shared-ui-jsx/components/list-table.component";
|
|
22
|
+
import { useCrmSavedView } from "../hooks/use-crm-saved-view.js";
|
|
23
|
+
import { useCrmScope } from "../hooks/use-crm-scope.js";
|
|
24
|
+
import { useCrmViewGrid } from "../hooks/use-crm-view-grid.js";
|
|
25
|
+
import { CRM_LIST_SLOTS, CrmColumnOrderProvider } from "./crm-column-menu.js";
|
|
26
|
+
import CrmViewsControl from "./crm-views-control.js";
|
|
27
|
+
import EmptyStateComponent from "@aglyn/shared-ui-jsx/components/empty-state.component";
|
|
28
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
29
|
+
import { useFirestore, useUser } from "@aglyn/tenant-feature-instance";
|
|
30
|
+
import { Button, Checkbox, Stack, ToggleButton, ToggleButtonGroup, Typography } from "@mui/material";
|
|
31
|
+
import { deleteField, doc, serverTimestamp, updateDoc } from "firebase/firestore";
|
|
32
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
33
|
+
import { useCrmRecordNames } from "../hooks/use-crm-record-names.js";
|
|
34
|
+
import { useCrmTaskList, useNowMs } from "../hooks/use-crm-tasks.js";
|
|
35
|
+
import { useOrgMemberDirectory } from "../hooks/use-org-member-directory.js";
|
|
36
|
+
import { downloadTextFile } from "../model/contacts-csv.js";
|
|
37
|
+
import { crmRoutes } from "../model/crm-routes.js";
|
|
38
|
+
import { refreshCrmNextActivity } from "../model/next-activity-api.js";
|
|
39
|
+
import { completeCrmTask } from "../model/task-api.js";
|
|
40
|
+
import { crmTaskCallScope } from "../model/task-routes.js";
|
|
41
|
+
import { tasksCsv } from "../model/tasks-csv.js";
|
|
42
|
+
import { CRM_TASK_VIEW_LIMIT, CRM_TASK_VIEWS } from "../model/task-views.js";
|
|
43
|
+
import { TaskDueText, TaskKindCell, TaskPriorityChip, TaskRecordLink } from "./task-cells.js";
|
|
44
|
+
import TaskEditDrawer from "./task-edit-drawer.js";
|
|
45
|
+
import TasksCalendar from "./tasks-calendar.js";
|
|
46
|
+
import { TaskImportButton } from "./task-import-drawer.js";
|
|
47
|
+
import TaskSnoozeMenu from "./task-snooze-menu.js";
|
|
48
|
+
import TasksBulkBar from "./tasks-bulk-bar.js";
|
|
49
|
+
/** What an empty view is headed, by view — "nothing overdue" is good news. */ const EMPTY_LABEL = {
|
|
50
|
+
mine: 'Nothing is assigned to you',
|
|
51
|
+
overdue: 'Nothing is overdue',
|
|
52
|
+
today: 'Nothing is due today',
|
|
53
|
+
upcoming: 'Nothing is scheduled beyond today',
|
|
54
|
+
open: 'No open tasks',
|
|
55
|
+
done: 'No completed tasks yet'
|
|
56
|
+
};
|
|
57
|
+
/** The one sentence under it, by view. */ const EMPTY_COPY = {
|
|
58
|
+
mine: 'Tasks you create are yours unless you hand them to someone.',
|
|
59
|
+
overdue: 'Every dated task is on or ahead of schedule.',
|
|
60
|
+
today: 'Nothing on your calendar day is owed to anyone in the CRM.',
|
|
61
|
+
upcoming: 'A task with a due date past today would be listed here.',
|
|
62
|
+
open: 'A task is a call, an email, a meeting or a to-do owed to a contact, a company or a deal.',
|
|
63
|
+
done: 'Tasks ticked off on their record, or here, are kept for the history.'
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* `/crm/tasks` — what the team owes the people in the CRM (AGL-2599).
|
|
67
|
+
*
|
|
68
|
+
* Six views over `orgs/{orgId}/crmTasks`, each a bounded listener on one of
|
|
69
|
+
* the collection's indexes, chosen by a segmented control. A task hangs off
|
|
70
|
+
* a contact, a company or a deal, but it is listed HERE because "what is due
|
|
71
|
+
* today" is a question about the team's day and not about any one record;
|
|
72
|
+
* the record pages carry their own `RecordTasksCard` for the other
|
|
73
|
+
* direction.
|
|
74
|
+
*
|
|
75
|
+
* Completing goes through `crm/task-complete`, because completing fires the
|
|
76
|
+
* `taskCompleted` host event and only the server can run a workflow.
|
|
77
|
+
* Reopening is client-direct: undoing a tick has no side effect beyond the
|
|
78
|
+
* document, and the rules gate it like any other CRM write.
|
|
79
|
+
*
|
|
80
|
+
* The rows are selectable, and a selection raises `TasksBulkBar` over the
|
|
81
|
+
* list — Complete and Assign through their routes, the due date and the
|
|
82
|
+
* delete as batched writes (AGL-2621). Export CSV beside the view control
|
|
83
|
+
* writes the view through `tasksCsv()`, naming the assignee and the linked
|
|
84
|
+
* records; the bar writes the same file over the selection.
|
|
85
|
+
*/ export function TasksSection(props) {
|
|
86
|
+
var _ref;
|
|
87
|
+
const { hostId, org, basePath = '' } = props;
|
|
88
|
+
const orgRecord = org;
|
|
89
|
+
const firestore = useFirestore();
|
|
90
|
+
const { data: user } = useUser();
|
|
91
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
92
|
+
const nowMs = useNowMs();
|
|
93
|
+
const routes = useMemo(()=>crmRoutes(basePath), [
|
|
94
|
+
basePath
|
|
95
|
+
]);
|
|
96
|
+
// The viewing group a linked contact is named through, or `null` at the
|
|
97
|
+
// organization level, where each is named through its own holder.
|
|
98
|
+
const { consentGroup } = useCrmScope({
|
|
99
|
+
hostId,
|
|
100
|
+
org: orgRecord
|
|
101
|
+
});
|
|
102
|
+
const groupId = (_ref = consentGroup == null ? void 0 : consentGroup.groupId) != null ? _ref : null;
|
|
103
|
+
/*
|
|
104
|
+
* Which of the six task views is open is the saved VIEW'S (AGL-2617): a
|
|
105
|
+
* saved view of tasks holds the task view beside the columns and the
|
|
106
|
+
* sort, and the toggle below writes into it. Unset reads as "My tasks",
|
|
107
|
+
* which is what the section opened on before views existed.
|
|
108
|
+
*/ const views = useCrmSavedView({
|
|
109
|
+
section: 'tasks',
|
|
110
|
+
hostId,
|
|
111
|
+
org: orgRecord,
|
|
112
|
+
basePath
|
|
113
|
+
});
|
|
114
|
+
const view = useMemo(()=>{
|
|
115
|
+
var _views_state_filters_find;
|
|
116
|
+
const value = (_views_state_filters_find = views.state.filters.find((clause)=>clause.field === 'view')) == null ? void 0 : _views_state_filters_find.value;
|
|
117
|
+
return CRM_TASK_VIEWS.some((option)=>option.id === value) ? value : 'mine';
|
|
118
|
+
}, [
|
|
119
|
+
views.state.filters
|
|
120
|
+
]);
|
|
121
|
+
const setView = useCallback((next)=>views.setFilters([
|
|
122
|
+
{
|
|
123
|
+
field: 'view',
|
|
124
|
+
op: 'equals',
|
|
125
|
+
value: next
|
|
126
|
+
}
|
|
127
|
+
]), [
|
|
128
|
+
views.setFilters
|
|
129
|
+
]);
|
|
130
|
+
const list = useCrmTaskList({
|
|
131
|
+
hostId,
|
|
132
|
+
org: orgRecord,
|
|
133
|
+
view,
|
|
134
|
+
uid: user == null ? void 0 : user.uid,
|
|
135
|
+
nowMs
|
|
136
|
+
});
|
|
137
|
+
const { tasks, status, fromCache, truncated, scope, orgId, readTokens } = list;
|
|
138
|
+
const directory = useOrgMemberDirectory(orgId);
|
|
139
|
+
/*
|
|
140
|
+
* Every record a task names, not only the one its "For" cell shows: the
|
|
141
|
+
* export writes the contact, the company and the deal each by name, and
|
|
142
|
+
* a task that names two would otherwise carry an id in one column.
|
|
143
|
+
*/ const linked = useMemo(()=>tasks.flatMap((task)=>[
|
|
144
|
+
...task.contactId ? [
|
|
145
|
+
{
|
|
146
|
+
kind: 'contact',
|
|
147
|
+
id: task.contactId
|
|
148
|
+
}
|
|
149
|
+
] : [],
|
|
150
|
+
...task.companyId ? [
|
|
151
|
+
{
|
|
152
|
+
kind: 'company',
|
|
153
|
+
id: task.companyId
|
|
154
|
+
}
|
|
155
|
+
] : [],
|
|
156
|
+
...task.dealId ? [
|
|
157
|
+
{
|
|
158
|
+
kind: 'deal',
|
|
159
|
+
id: task.dealId
|
|
160
|
+
}
|
|
161
|
+
] : []
|
|
162
|
+
]), [
|
|
163
|
+
tasks
|
|
164
|
+
]);
|
|
165
|
+
const nameOf = useCrmRecordNames({
|
|
166
|
+
orgId,
|
|
167
|
+
groupId,
|
|
168
|
+
org: orgRecord,
|
|
169
|
+
records: linked
|
|
170
|
+
});
|
|
171
|
+
const [selectedIds, setSelectedIds] = useState([]);
|
|
172
|
+
// A view is a different set of rows; a selection made on the last one
|
|
173
|
+
// would be a count over rows no longer on screen.
|
|
174
|
+
useEffect(()=>setSelectedIds([]), [
|
|
175
|
+
view
|
|
176
|
+
]);
|
|
177
|
+
const csvOptions = useMemo(()=>({
|
|
178
|
+
assigneeEmail: (uid)=>{
|
|
179
|
+
const member = findOrgMember(directory.members, uid);
|
|
180
|
+
return (member == null ? void 0 : member.email) || (member == null ? void 0 : member.label) || uid;
|
|
181
|
+
},
|
|
182
|
+
recordName: nameOf
|
|
183
|
+
}), [
|
|
184
|
+
directory.members,
|
|
185
|
+
nameOf
|
|
186
|
+
]);
|
|
187
|
+
const handleExport = useCallback(()=>{
|
|
188
|
+
downloadTextFile('tasks.csv', 'text/csv', tasksCsv(tasks, csvOptions));
|
|
189
|
+
}, [
|
|
190
|
+
tasks,
|
|
191
|
+
csvOptions
|
|
192
|
+
]);
|
|
193
|
+
/*
|
|
194
|
+
* List or month (AGL-2662). A layout choice over the SAME rows and the
|
|
195
|
+
* same view — switching does not narrow anything and costs no read, so
|
|
196
|
+
* it is a toggle rather than another saved view.
|
|
197
|
+
*/ const [layout, setLayout] = useState('list');
|
|
198
|
+
const [drawer, setDrawer] = useState({
|
|
199
|
+
open: false,
|
|
200
|
+
task: null
|
|
201
|
+
});
|
|
202
|
+
const [busyId, setBusyId] = useState(null);
|
|
203
|
+
/*
|
|
204
|
+
* Tick or untick. The two directions are two different writes on purpose
|
|
205
|
+
* — see the module comment — and the row is disabled while either is in
|
|
206
|
+
* flight so a double-click cannot complete a task and reopen it in the
|
|
207
|
+
* same breath.
|
|
208
|
+
*/ const toggleDone = useCallback(async (task)=>{
|
|
209
|
+
if (!scope || busyId) return;
|
|
210
|
+
setBusyId(task.$id);
|
|
211
|
+
try {
|
|
212
|
+
if (task.status === 'done') {
|
|
213
|
+
await updateDoc(doc(firestore, scope[0], scope[1], CRM_COLLECTIONS.tasks, task.$id), {
|
|
214
|
+
status: 'open',
|
|
215
|
+
completedAtMs: null,
|
|
216
|
+
completedByUid: deleteField(),
|
|
217
|
+
updatedAt: serverTimestamp()
|
|
218
|
+
});
|
|
219
|
+
enqueueSnackbar('Task reopened', {
|
|
220
|
+
variant: 'success'
|
|
221
|
+
});
|
|
222
|
+
// A client-direct write: the records it names are told (AGL-2661).
|
|
223
|
+
await refreshCrmNextActivity(user, crmTaskCallScope(hostId, orgId), [
|
|
224
|
+
task
|
|
225
|
+
]);
|
|
226
|
+
} else {
|
|
227
|
+
// The route runs as the mounted site, which hears the event, or
|
|
228
|
+
// at the organization level as the org — the org variant, which
|
|
229
|
+
// emits on the task's own site, or nowhere for an org task.
|
|
230
|
+
const callScope = crmTaskCallScope(hostId, orgId);
|
|
231
|
+
if (!callScope) return;
|
|
232
|
+
await completeCrmTask(user, _extends({}, callScope, {
|
|
233
|
+
taskId: task.$id
|
|
234
|
+
}));
|
|
235
|
+
enqueueSnackbar('Task completed', {
|
|
236
|
+
variant: 'success'
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
} catch (cause) {
|
|
240
|
+
enqueueSnackbar(cause instanceof Error ? cause.message : 'The task could not be updated.', {
|
|
241
|
+
variant: 'warning'
|
|
242
|
+
});
|
|
243
|
+
} finally{
|
|
244
|
+
setBusyId(null);
|
|
245
|
+
}
|
|
246
|
+
}, [
|
|
247
|
+
scope,
|
|
248
|
+
busyId,
|
|
249
|
+
firestore,
|
|
250
|
+
user,
|
|
251
|
+
hostId,
|
|
252
|
+
orgId,
|
|
253
|
+
enqueueSnackbar
|
|
254
|
+
]);
|
|
255
|
+
const columns = useMemo(()=>[
|
|
256
|
+
{
|
|
257
|
+
field: 'status',
|
|
258
|
+
headerName: '',
|
|
259
|
+
width: 56,
|
|
260
|
+
sortable: false,
|
|
261
|
+
filterable: false,
|
|
262
|
+
renderCell: ({ row })=>/*#__PURE__*/ _jsx(Checkbox, {
|
|
263
|
+
size: "small",
|
|
264
|
+
checked: row.status === 'done',
|
|
265
|
+
disabled: busyId === row.$id,
|
|
266
|
+
onClick: (event)=>{
|
|
267
|
+
event.stopPropagation();
|
|
268
|
+
void toggleDone(row);
|
|
269
|
+
},
|
|
270
|
+
slotProps: {
|
|
271
|
+
input: {
|
|
272
|
+
'aria-label': row.status === 'done' ? `Reopen "${row.title}"` : `Complete "${row.title}"`
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
})
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
field: 'title',
|
|
279
|
+
headerName: 'Task',
|
|
280
|
+
flex: 2,
|
|
281
|
+
minWidth: 220,
|
|
282
|
+
sortable: false,
|
|
283
|
+
renderCell: ({ row })=>/*#__PURE__*/ _jsxs(Stack, {
|
|
284
|
+
sx: {
|
|
285
|
+
justifyContent: 'center',
|
|
286
|
+
height: '100%',
|
|
287
|
+
minWidth: 0
|
|
288
|
+
},
|
|
289
|
+
children: [
|
|
290
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
291
|
+
variant: "body2",
|
|
292
|
+
noWrap: true,
|
|
293
|
+
sx: {
|
|
294
|
+
textDecoration: row.status === 'done' ? 'line-through' : undefined,
|
|
295
|
+
color: row.status === 'done' ? 'text.secondary' : undefined
|
|
296
|
+
},
|
|
297
|
+
children: row.title
|
|
298
|
+
}),
|
|
299
|
+
row.notes ? /*#__PURE__*/ _jsx(Typography, {
|
|
300
|
+
variant: "caption",
|
|
301
|
+
color: "text.secondary",
|
|
302
|
+
noWrap: true,
|
|
303
|
+
children: row.notes
|
|
304
|
+
}) : null
|
|
305
|
+
]
|
|
306
|
+
})
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
field: 'kind',
|
|
310
|
+
headerName: 'Kind',
|
|
311
|
+
width: 120,
|
|
312
|
+
sortable: false,
|
|
313
|
+
renderCell: ({ row })=>/*#__PURE__*/ _jsx(TaskKindCell, {
|
|
314
|
+
kind: row.kind
|
|
315
|
+
})
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
field: 'priority',
|
|
319
|
+
headerName: 'Priority',
|
|
320
|
+
width: 110,
|
|
321
|
+
sortable: false,
|
|
322
|
+
renderCell: ({ row })=>/*#__PURE__*/ _jsx(TaskPriorityChip, {
|
|
323
|
+
priority: row.priority
|
|
324
|
+
})
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
field: 'dueAtMs',
|
|
328
|
+
headerName: 'Due',
|
|
329
|
+
width: 260,
|
|
330
|
+
sortable: false,
|
|
331
|
+
renderCell: ({ row })=>/*#__PURE__*/ _jsxs(Stack, {
|
|
332
|
+
direction: "row",
|
|
333
|
+
spacing: 0.5,
|
|
334
|
+
sx: {
|
|
335
|
+
alignItems: 'center',
|
|
336
|
+
height: '100%'
|
|
337
|
+
},
|
|
338
|
+
children: [
|
|
339
|
+
/*#__PURE__*/ _jsx(TaskDueText, {
|
|
340
|
+
task: row,
|
|
341
|
+
nowMs: nowMs
|
|
342
|
+
}),
|
|
343
|
+
row.status === 'done' || !scope ? null : /*#__PURE__*/ _jsx(TaskSnoozeMenu, {
|
|
344
|
+
dueAtMs: row.dueAtMs,
|
|
345
|
+
remindAtMs: row.remindAtMs,
|
|
346
|
+
target: {
|
|
347
|
+
write: {
|
|
348
|
+
scope,
|
|
349
|
+
taskId: row.$id,
|
|
350
|
+
call: crmTaskCallScope(hostId, orgId),
|
|
351
|
+
links: row
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
disabled: busyId === row.$id
|
|
355
|
+
})
|
|
356
|
+
]
|
|
357
|
+
})
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
field: 'assigneeUid',
|
|
361
|
+
headerName: 'Assignee',
|
|
362
|
+
flex: 1,
|
|
363
|
+
minWidth: 140,
|
|
364
|
+
sortable: false,
|
|
365
|
+
valueGetter: (_value, row)=>directory.nameOf(row.assigneeUid),
|
|
366
|
+
renderCell: ({ row })=>/*#__PURE__*/ _jsx(Typography, {
|
|
367
|
+
variant: "body2",
|
|
368
|
+
color: row.assigneeUid ? undefined : 'text.secondary',
|
|
369
|
+
children: row.assigneeUid ? directory.nameOf(row.assigneeUid) : 'Unassigned'
|
|
370
|
+
})
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
field: 'record',
|
|
374
|
+
headerName: 'For',
|
|
375
|
+
flex: 1,
|
|
376
|
+
minWidth: 160,
|
|
377
|
+
sortable: false,
|
|
378
|
+
renderCell: ({ row })=>/*#__PURE__*/ _jsx(TaskRecordLink, {
|
|
379
|
+
task: row,
|
|
380
|
+
routes: routes,
|
|
381
|
+
nameOf: nameOf
|
|
382
|
+
})
|
|
383
|
+
}
|
|
384
|
+
], [
|
|
385
|
+
busyId,
|
|
386
|
+
toggleDone,
|
|
387
|
+
nowMs,
|
|
388
|
+
directory,
|
|
389
|
+
routes,
|
|
390
|
+
nameOf,
|
|
391
|
+
scope
|
|
392
|
+
]);
|
|
393
|
+
/* The column and sort models are the view's (AGL-2617). */ const grid = useCrmViewGrid(views, columns);
|
|
394
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
395
|
+
children: [
|
|
396
|
+
/*#__PURE__*/ _jsx(CardDisplay, {
|
|
397
|
+
header: 'Tasks',
|
|
398
|
+
help: pluginDocsHelp('crmTasks', {
|
|
399
|
+
anchor: '#the-tasks-page',
|
|
400
|
+
excerpt: 'Calls, emails, meetings and to-dos, each linked to the contact, ' + 'company or deal it is for. Overdue and today are read off the ' + 'due date as you look.'
|
|
401
|
+
}),
|
|
402
|
+
contentGutterX: true,
|
|
403
|
+
contentGutterY: true,
|
|
404
|
+
HeaderProps: {
|
|
405
|
+
action: /*#__PURE__*/ _jsx(Button, {
|
|
406
|
+
size: "small",
|
|
407
|
+
variant: "contained",
|
|
408
|
+
color: "primary",
|
|
409
|
+
onClick: ()=>setDrawer({
|
|
410
|
+
open: true,
|
|
411
|
+
task: null
|
|
412
|
+
}),
|
|
413
|
+
children: 'New task'
|
|
414
|
+
})
|
|
415
|
+
},
|
|
416
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
417
|
+
spacing: 2,
|
|
418
|
+
children: [
|
|
419
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
420
|
+
direction: "row",
|
|
421
|
+
spacing: 2,
|
|
422
|
+
sx: {
|
|
423
|
+
alignItems: 'center',
|
|
424
|
+
flexWrap: 'wrap',
|
|
425
|
+
rowGap: 1
|
|
426
|
+
},
|
|
427
|
+
children: [
|
|
428
|
+
/*#__PURE__*/ _jsx(CrmViewsControl, {
|
|
429
|
+
controller: views,
|
|
430
|
+
allLabel: "All tasks"
|
|
431
|
+
}),
|
|
432
|
+
/*#__PURE__*/ _jsx(ToggleButtonGroup, {
|
|
433
|
+
exclusive: true,
|
|
434
|
+
size: "small",
|
|
435
|
+
color: "primary",
|
|
436
|
+
value: view,
|
|
437
|
+
onChange: (_event, next)=>{
|
|
438
|
+
if (next) setView(next);
|
|
439
|
+
},
|
|
440
|
+
"aria-label": "Task view",
|
|
441
|
+
children: CRM_TASK_VIEWS.map((option)=>/*#__PURE__*/ _jsx(ToggleButton, {
|
|
442
|
+
value: option.id,
|
|
443
|
+
children: option.label
|
|
444
|
+
}, option.id))
|
|
445
|
+
}),
|
|
446
|
+
/*#__PURE__*/ _jsxs(ToggleButtonGroup, {
|
|
447
|
+
exclusive: true,
|
|
448
|
+
size: "small",
|
|
449
|
+
color: "primary",
|
|
450
|
+
value: layout,
|
|
451
|
+
onChange: (_event, next)=>{
|
|
452
|
+
if (next) setLayout(next);
|
|
453
|
+
},
|
|
454
|
+
"aria-label": "Task layout",
|
|
455
|
+
children: [
|
|
456
|
+
/*#__PURE__*/ _jsx(ToggleButton, {
|
|
457
|
+
value: "list",
|
|
458
|
+
children: 'List'
|
|
459
|
+
}),
|
|
460
|
+
/*#__PURE__*/ _jsx(ToggleButton, {
|
|
461
|
+
value: "calendar",
|
|
462
|
+
children: 'Calendar'
|
|
463
|
+
})
|
|
464
|
+
]
|
|
465
|
+
}),
|
|
466
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
467
|
+
sx: {
|
|
468
|
+
flex: 1
|
|
469
|
+
}
|
|
470
|
+
}),
|
|
471
|
+
/*#__PURE__*/ _jsx(TaskImportButton, {
|
|
472
|
+
hostId: hostId
|
|
473
|
+
}),
|
|
474
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
475
|
+
size: "small",
|
|
476
|
+
onClick: handleExport,
|
|
477
|
+
disabled: !tasks.length,
|
|
478
|
+
children: 'Export CSV'
|
|
479
|
+
})
|
|
480
|
+
]
|
|
481
|
+
}),
|
|
482
|
+
status === 'error' ? /*#__PURE__*/ _jsx(Typography, {
|
|
483
|
+
variant: "body2",
|
|
484
|
+
color: "error",
|
|
485
|
+
children: 'The tasks could not be loaded. Reload to try again.'
|
|
486
|
+
}) : status === 'success' && !tasks.length ? /*#__PURE__*/ _jsx(EmptyStateComponent, {
|
|
487
|
+
label: EMPTY_LABEL[view],
|
|
488
|
+
description: EMPTY_COPY[view],
|
|
489
|
+
action: /*#__PURE__*/ _jsx(Button, {
|
|
490
|
+
size: "small",
|
|
491
|
+
variant: "contained",
|
|
492
|
+
color: "primary",
|
|
493
|
+
onClick: ()=>setDrawer({
|
|
494
|
+
open: true,
|
|
495
|
+
task: null
|
|
496
|
+
}),
|
|
497
|
+
children: 'New task'
|
|
498
|
+
})
|
|
499
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
500
|
+
children: [
|
|
501
|
+
truncated ? /*#__PURE__*/ _jsx(Typography, {
|
|
502
|
+
variant: "caption",
|
|
503
|
+
color: "text.secondary",
|
|
504
|
+
children: `Showing the first ${CRM_TASK_VIEW_LIMIT} — narrow the view to see the rest.`
|
|
505
|
+
}) : null,
|
|
506
|
+
layout === 'calendar' ? /*#__PURE__*/ _jsx(TasksCalendar, {
|
|
507
|
+
tasks: tasks,
|
|
508
|
+
truncated: truncated,
|
|
509
|
+
onOpen: (task)=>setDrawer({
|
|
510
|
+
open: true,
|
|
511
|
+
task
|
|
512
|
+
})
|
|
513
|
+
}) : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
514
|
+
children: [
|
|
515
|
+
/*#__PURE__*/ _jsx(TasksBulkBar, {
|
|
516
|
+
hostId: hostId,
|
|
517
|
+
scope: scope,
|
|
518
|
+
rows: tasks,
|
|
519
|
+
selected: selectedIds,
|
|
520
|
+
onSelectedChange: setSelectedIds,
|
|
521
|
+
directory: directory,
|
|
522
|
+
csv: csvOptions
|
|
523
|
+
}),
|
|
524
|
+
/*#__PURE__*/ _jsx(CrmColumnOrderProvider, {
|
|
525
|
+
value: grid.columnOrder,
|
|
526
|
+
children: /*#__PURE__*/ _jsx(ListTable, {
|
|
527
|
+
rows: tasks,
|
|
528
|
+
columns: grid.columns,
|
|
529
|
+
slots: CRM_LIST_SLOTS,
|
|
530
|
+
selectable: {
|
|
531
|
+
selected: selectedIds,
|
|
532
|
+
onChange: setSelectedIds
|
|
533
|
+
},
|
|
534
|
+
loading: status === 'loading',
|
|
535
|
+
onOpen: (id)=>{
|
|
536
|
+
const found = tasks.find((row)=>row.$id === id);
|
|
537
|
+
if (found) setDrawer({
|
|
538
|
+
open: true,
|
|
539
|
+
task: found
|
|
540
|
+
});
|
|
541
|
+
},
|
|
542
|
+
disableColumnFilter: true,
|
|
543
|
+
// Columns and sort are the view's, controlled (AGL-2617).
|
|
544
|
+
columnVisibilityModel: grid.columnVisibilityModel,
|
|
545
|
+
onColumnVisibilityModelChange: grid.onColumnVisibilityModelChange,
|
|
546
|
+
sortModel: grid.sortModel,
|
|
547
|
+
onSortModelChange: grid.onSortModelChange
|
|
548
|
+
})
|
|
549
|
+
})
|
|
550
|
+
]
|
|
551
|
+
})
|
|
552
|
+
]
|
|
553
|
+
})
|
|
554
|
+
]
|
|
555
|
+
})
|
|
556
|
+
}),
|
|
557
|
+
/*#__PURE__*/ _jsx(TaskEditDrawer, {
|
|
558
|
+
open: drawer.open,
|
|
559
|
+
onClose: ()=>setDrawer((prev)=>_extends({}, prev, {
|
|
560
|
+
open: false
|
|
561
|
+
})),
|
|
562
|
+
hostId: hostId,
|
|
563
|
+
org: orgRecord,
|
|
564
|
+
orgId: orgId,
|
|
565
|
+
scope: scope,
|
|
566
|
+
readTokens: readTokens,
|
|
567
|
+
task: drawer.task,
|
|
568
|
+
seed: {
|
|
569
|
+
fromCache,
|
|
570
|
+
unreadable: status === 'error'
|
|
571
|
+
}
|
|
572
|
+
})
|
|
573
|
+
]
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
TasksSection.displayName = 'TasksSection';
|
|
577
|
+
export default TasksSection;
|
|
578
|
+
|
|
579
|
+
//# sourceMappingURL=tasks-section.js.map
|