@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,103 @@
|
|
|
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import * as Aglyn from "@aglyn/aglyn";
|
|
19
|
+
import { AppLink } from "@aglyn/shared-ui-jsx";
|
|
20
|
+
import { Stack, Typography } from "@mui/material";
|
|
21
|
+
import { useCallback, useMemo } from "react";
|
|
22
|
+
import { crmRoutes } from "../model/crm-routes.js";
|
|
23
|
+
import { ActivityList } from "./activity-list.js";
|
|
24
|
+
import { useActivityScope, useActivityWindow } from "./activity-queries.js";
|
|
25
|
+
/** How the record an activity is about reads in the feed. */ const RECORD_LABELS = {
|
|
26
|
+
contact: 'Contact',
|
|
27
|
+
deal: 'Deal',
|
|
28
|
+
company: 'Company',
|
|
29
|
+
lead: 'Lead'
|
|
30
|
+
};
|
|
31
|
+
/** The feed's default depth — a glance, not a log. */ export const RECENT_ACTIVITY_LIMIT = 10;
|
|
32
|
+
/** The empty link: nothing to render, the query returns nothing. */ const NO_RECORD = Object.freeze({});
|
|
33
|
+
/**
|
|
34
|
+
* The newest logged activity across the CRM (AGL-2600): the last few calls,
|
|
35
|
+
* emails, meetings and notes anyone on the team filed against any record,
|
|
36
|
+
* each linking to the record it is about.
|
|
37
|
+
*
|
|
38
|
+
* What the contacts landing shows under its list, so that opening the CRM
|
|
39
|
+
* answers "what has the team been doing" before anybody opens a record. One
|
|
40
|
+
* bounded listener on `(visibleTo, atMs DESC)` — the index that exists for
|
|
41
|
+
* exactly this query — filtered to what this reader may see, the same
|
|
42
|
+
* predicate the rules evaluate. Bounded to `limit` and no further: a feed
|
|
43
|
+
* is a glance, and the record's own page is where the whole log lives.
|
|
44
|
+
*
|
|
45
|
+
* A row links to its CONTACT when it has one, else its deal, else its
|
|
46
|
+
* company — `crmActivityRecordLink`'s precedence — through `crmRoutes`, so
|
|
47
|
+
* the address it builds is the one the hub resolves. Nothing is looked up
|
|
48
|
+
* to name the record: a name per row would be a document read per row of a
|
|
49
|
+
* feed drawn on every visit to the list, and the record's page names itself.
|
|
50
|
+
*/ export function RecentActivityFeed(props) {
|
|
51
|
+
const { hostId, org, limit = RECENT_ACTIVITY_LIMIT, basePath } = props;
|
|
52
|
+
const scope = useActivityScope(hostId, org);
|
|
53
|
+
const activities = useActivityWindow(scope, NO_RECORD, limit);
|
|
54
|
+
const routes = useMemo(()=>basePath ? crmRoutes(basePath) : null, [
|
|
55
|
+
basePath
|
|
56
|
+
]);
|
|
57
|
+
const subjectFor = useCallback((activity)=>{
|
|
58
|
+
const target = Aglyn.crmActivityRecordLink(activity);
|
|
59
|
+
if (!target) return null;
|
|
60
|
+
const label = RECORD_LABELS[target.record];
|
|
61
|
+
const href = routes ? routes[target.record](target.id) : null;
|
|
62
|
+
return href ? /*#__PURE__*/ _jsx(Typography, {
|
|
63
|
+
variant: "caption",
|
|
64
|
+
children: /*#__PURE__*/ _jsx(AppLink, {
|
|
65
|
+
href: href,
|
|
66
|
+
children: label
|
|
67
|
+
})
|
|
68
|
+
}) : /*#__PURE__*/ _jsx(Typography, {
|
|
69
|
+
variant: "caption",
|
|
70
|
+
color: "text.secondary",
|
|
71
|
+
children: label
|
|
72
|
+
});
|
|
73
|
+
}, [
|
|
74
|
+
routes
|
|
75
|
+
]);
|
|
76
|
+
// Nothing to show and nothing to say: a landing with no activity yet
|
|
77
|
+
// should not carry an empty heading for a feature the reader has not
|
|
78
|
+
// used, and the record pages are where the "log one" affordance lives.
|
|
79
|
+
if (activities.status !== 'error' && !activities.rows.length) return null;
|
|
80
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
81
|
+
spacing: 1.5,
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
84
|
+
variant: "subtitle2",
|
|
85
|
+
children: 'Recent activity'
|
|
86
|
+
}),
|
|
87
|
+
activities.status === 'error' ? /*#__PURE__*/ _jsx(Typography, {
|
|
88
|
+
variant: "body2",
|
|
89
|
+
color: "error",
|
|
90
|
+
children: 'Recent activity could not be loaded.'
|
|
91
|
+
}) : /*#__PURE__*/ _jsx(ActivityList, {
|
|
92
|
+
rows: activities.rows,
|
|
93
|
+
scope: scope,
|
|
94
|
+
subjectFor: subjectFor,
|
|
95
|
+
readOnly: true
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
RecentActivityFeed.displayName = 'RecentActivityFeed';
|
|
101
|
+
export default RecentActivityFeed;
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=recent-activity-feed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/recent-activity-feed.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 * as Aglyn from '@aglyn/aglyn'\nimport type { CrmActivityRow } from '@aglyn/aglyn'\nimport { AppLink } from '@aglyn/shared-ui-jsx'\nimport { Stack, Typography } from '@mui/material'\nimport { useCallback, useMemo } from 'react'\nimport { crmRoutes } from '../model/crm-routes'\nimport { ActivityList } from './activity-list'\nimport {\n type CrmOrg,\n useActivityScope,\n useActivityWindow,\n} from './activity-queries'\n\n/** How the record an activity is about reads in the feed. */\nconst RECORD_LABELS = {\n contact: 'Contact',\n deal: 'Deal',\n company: 'Company',\n lead: 'Lead',\n} as const\n\n/** The feed's default depth — a glance, not a log. */\nexport const RECENT_ACTIVITY_LIMIT = 10\n\n/** The empty link: nothing to render, the query returns nothing. */\nconst NO_RECORD = Object.freeze({})\n\nexport interface RecentActivityFeedProps {\n /** The site the record is read under, or `null` at the organization level. */\n hostId: string | null\n org: CrmOrg\n /** The newest this many, across every record. */\n limit?: number\n /**\n * The hub's mount path, for the link each row carries to its record. The\n * shell supplies it on every hub page; a mount without one draws the\n * record's label with no link rather than a link into nowhere.\n */\n basePath?: string\n}\n\n/**\n * The newest logged activity across the CRM (AGL-2600): the last few calls,\n * emails, meetings and notes anyone on the team filed against any record,\n * each linking to the record it is about.\n *\n * What the contacts landing shows under its list, so that opening the CRM\n * answers \"what has the team been doing\" before anybody opens a record. One\n * bounded listener on `(visibleTo, atMs DESC)` — the index that exists for\n * exactly this query — filtered to what this reader may see, the same\n * predicate the rules evaluate. Bounded to `limit` and no further: a feed\n * is a glance, and the record's own page is where the whole log lives.\n *\n * A row links to its CONTACT when it has one, else its deal, else its\n * company — `crmActivityRecordLink`'s precedence — through `crmRoutes`, so\n * the address it builds is the one the hub resolves. Nothing is looked up\n * to name the record: a name per row would be a document read per row of a\n * feed drawn on every visit to the list, and the record's page names itself.\n */\nexport function RecentActivityFeed(props: RecentActivityFeedProps) {\n const { hostId, org, limit = RECENT_ACTIVITY_LIMIT, basePath } = props\n const scope = useActivityScope(hostId, org)\n const activities = useActivityWindow(scope, NO_RECORD, limit)\n const routes = useMemo(\n () => (basePath ? crmRoutes(basePath) : null),\n [basePath],\n )\n const subjectFor = useCallback(\n (activity: CrmActivityRow) => {\n const target = Aglyn.crmActivityRecordLink(activity)\n if (!target) return null\n const label = RECORD_LABELS[target.record]\n const href = routes ? routes[target.record](target.id) : null\n return href ? (\n <Typography variant=\"caption\">\n <AppLink href={href}>{label}</AppLink>\n </Typography>\n ) : (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {label}\n </Typography>\n )\n },\n [routes],\n )\n\n // Nothing to show and nothing to say: a landing with no activity yet\n // should not carry an empty heading for a feature the reader has not\n // used, and the record pages are where the \"log one\" affordance lives.\n if (activities.status !== 'error' && !activities.rows.length) return null\n\n return (\n <Stack spacing={1.5}>\n <Typography variant=\"subtitle2\">{'Recent activity'}</Typography>\n {activities.status === 'error' ? (\n <Typography variant=\"body2\" color=\"error\">\n {'Recent activity could not be loaded.'}\n </Typography>\n ) : (\n <ActivityList\n rows={activities.rows}\n scope={scope}\n subjectFor={subjectFor}\n readOnly\n />\n )}\n </Stack>\n )\n}\nRecentActivityFeed.displayName = 'RecentActivityFeed'\n\nexport default RecentActivityFeed\n"],"names":["Aglyn","AppLink","Stack","Typography","useCallback","useMemo","crmRoutes","ActivityList","useActivityScope","useActivityWindow","RECORD_LABELS","contact","deal","company","lead","RECENT_ACTIVITY_LIMIT","NO_RECORD","Object","freeze","RecentActivityFeed","props","hostId","org","limit","basePath","scope","activities","routes","subjectFor","activity","target","crmActivityRecordLink","label","record","href","id","variant","color","status","rows","length","spacing","readOnly","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,YAAYA,WAAW,eAAc;AAErC,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,SAASC,KAAK,EAAEC,UAAU,QAAQ,gBAAe;AACjD,SAASC,WAAW,EAAEC,OAAO,QAAQ,QAAO;AAC5C,SAASC,SAAS,QAAQ,yBAAqB;AAC/C,SAASC,YAAY,QAAQ,qBAAiB;AAC9C,SAEEC,gBAAgB,EAChBC,iBAAiB,QACZ,wBAAoB;AAE3B,2DAA2D,GAC3D,MAAMC,gBAAgB;IACpBC,SAAS;IACTC,MAAM;IACNC,SAAS;IACTC,MAAM;AACR;AAEA,oDAAoD,GACpD,OAAO,MAAMC,wBAAwB,GAAE;AAEvC,kEAAkE,GAClE,MAAMC,YAAYC,OAAOC,MAAM,CAAC,CAAC;AAgBjC;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,SAASC,mBAAmBC,KAA8B;IAC/D,MAAM,EAAEC,MAAM,EAAEC,GAAG,EAAEC,QAAQR,qBAAqB,EAAES,QAAQ,EAAE,GAAGJ;IACjE,MAAMK,QAAQjB,iBAAiBa,QAAQC;IACvC,MAAMI,aAAajB,kBAAkBgB,OAAOT,WAAWO;IACvD,MAAMI,SAAStB,QACb,IAAOmB,WAAWlB,UAAUkB,YAAY,MACxC;QAACA;KAAS;IAEZ,MAAMI,aAAaxB,YACjB,CAACyB;QACC,MAAMC,SAAS9B,MAAM+B,qBAAqB,CAACF;QAC3C,IAAI,CAACC,QAAQ,OAAO;QACpB,MAAME,QAAQtB,aAAa,CAACoB,OAAOG,MAAM,CAAC;QAC1C,MAAMC,OAAOP,SAASA,MAAM,CAACG,OAAOG,MAAM,CAAC,CAACH,OAAOK,EAAE,IAAI;QACzD,OAAOD,qBACL,KAAC/B;YAAWiC,SAAQ;sBAClB,cAAA,KAACnC;gBAAQiC,MAAMA;0BAAOF;;2BAGxB,KAAC7B;YAAWiC,SAAQ;YAAUC,OAAM;sBACjCL;;IAGP,GACA;QAACL;KAAO;IAGV,qEAAqE;IACrE,qEAAqE;IACrE,uEAAuE;IACvE,IAAID,WAAWY,MAAM,KAAK,WAAW,CAACZ,WAAWa,IAAI,CAACC,MAAM,EAAE,OAAO;IAErE,qBACE,MAACtC;QAAMuC,SAAS;;0BACd,KAACtC;gBAAWiC,SAAQ;0BAAa;;YAChCV,WAAWY,MAAM,KAAK,wBACrB,KAACnC;gBAAWiC,SAAQ;gBAAQC,OAAM;0BAC/B;+BAGH,KAAC9B;gBACCgC,MAAMb,WAAWa,IAAI;gBACrBd,OAAOA;gBACPG,YAAYA;gBACZc,QAAQ;;;;AAKlB;AACAvB,mBAAmBwB,WAAW,GAAG;AAEjC,eAAexB,mBAAkB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type AglynOrgBilling } from '@aglyn/aglyn';
|
|
2
|
+
export interface RecipesCardProps {
|
|
3
|
+
org?: Partial<AglynOrgBilling> | null;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* "Recipes" — the CRM's ready-made automations, installed on a site from
|
|
7
|
+
* the organization (AGL-2639).
|
|
8
|
+
*
|
|
9
|
+
* ## Why this card exists at the org level and nowhere else
|
|
10
|
+
*
|
|
11
|
+
* Automation is a site feature: a site's Actions page has a Recipes menu
|
|
12
|
+
* that opens the editor prefilled, and the person saves what they see.
|
|
13
|
+
* The org hub mounts over every site with no editor of its own, so it had
|
|
14
|
+
* no recipes at all, and an org running five sites installed "Welcome a
|
|
15
|
+
* new lead" five times by hand. This card is the org's door: every recipe,
|
|
16
|
+
* the sites that already carry it, and Install, which writes the action
|
|
17
|
+
* into the site the reader picks through the server — the server stamps
|
|
18
|
+
* the recipe, refuses a site outside the org, and refuses a second copy.
|
|
19
|
+
* Under a site the section does not mount it; the site's own menu is the
|
|
20
|
+
* right door there.
|
|
21
|
+
*
|
|
22
|
+
* ## "Installed on" reads the stamp, and says when it cannot
|
|
23
|
+
*
|
|
24
|
+
* The status route answers, per site, the recipes a live action is stamped
|
|
25
|
+
* with and how many live actions carry no stamp. A site with any of the
|
|
26
|
+
* latter is named as one that MAY already have the recipe rather than
|
|
27
|
+
* listed as clear: those actions were saved before the stamp existed and
|
|
28
|
+
* the card cannot tell a hand-built welcome from an installed one.
|
|
29
|
+
*
|
|
30
|
+
* ## Creation opens a drawer
|
|
31
|
+
*
|
|
32
|
+
* Install is a button per row; the picks — the site, and for Tag by form
|
|
33
|
+
* one of that site's forms — live in a drawer, never above the list.
|
|
34
|
+
*/
|
|
35
|
+
export declare function RecipesCard(props: RecipesCardProps): import("react").JSX.Element;
|
|
36
|
+
export declare namespace RecipesCard {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
export default RecipesCard;
|
|
@@ -0,0 +1,485 @@
|
|
|
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 { checkEntitlement, CRM_ACTION_RECIPES, planLabelGrantingFeature, pluginDocsHelp } from "@aglyn/aglyn";
|
|
20
|
+
import { AppLink, CardDisplay, SrOnly } from "@aglyn/shared-ui-jsx";
|
|
21
|
+
import { ScrollTable } from "@aglyn/shared-ui-jsx/components/scroll-table.component";
|
|
22
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
23
|
+
import { ceilingedWindow, collectionCeiling, useFirestore, useFirestoreCollection } from "@aglyn/tenant-feature-instance";
|
|
24
|
+
import { Alert, Button, Drawer, MenuItem, Stack, TableBody, TableCell, TableHead, TableRow, TextField, Typography } from "@mui/material";
|
|
25
|
+
import { collection } from "firebase/firestore";
|
|
26
|
+
import { Fragment, useCallback, useEffect, useMemo, useState } from "react";
|
|
27
|
+
import { useCrmOrgMount } from "../hooks/use-crm-org-mount.js";
|
|
28
|
+
import { useCrmApi } from "./use-crm-api.js";
|
|
29
|
+
/** How many of a site's forms the picker offers before it says it stopped. */ const FORM_OPTION_CEILING = 100;
|
|
30
|
+
/**
|
|
31
|
+
* The site's Automation → Actions page — where an installed action lives
|
|
32
|
+
* and is edited — or `null` for a site whose subdomain the mount could not
|
|
33
|
+
* answer, which is named and not linked.
|
|
34
|
+
*/ function siteActionsHref(mount, hostId) {
|
|
35
|
+
const subdomain = mount.siteSubdomain(hostId);
|
|
36
|
+
return subdomain ? `${mount.hostsPath}/${encodeURIComponent(subdomain)}/automation/actions` : null;
|
|
37
|
+
}
|
|
38
|
+
function standingOf(status, hostId, recipeId) {
|
|
39
|
+
const site = status == null ? void 0 : status.get(hostId);
|
|
40
|
+
if (!site) return 'unread';
|
|
41
|
+
if (site.installed.includes(recipeId)) return 'installed';
|
|
42
|
+
return site.unstamped > 0 ? 'maybe' : 'clear';
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The stamps of every site of the org, read once the site list is known
|
|
46
|
+
* and again after each install, so the card reports what the documents
|
|
47
|
+
* say rather than what it last did.
|
|
48
|
+
*/ function useRecipeStatus(mount) {
|
|
49
|
+
const api = useCrmApi(null);
|
|
50
|
+
const [sites, setSites] = useState(null);
|
|
51
|
+
const [error, setError] = useState(null);
|
|
52
|
+
const refresh = useCallback(async ()=>{
|
|
53
|
+
try {
|
|
54
|
+
var _payload_sites;
|
|
55
|
+
const { response, payload } = await api('recipe-status', {});
|
|
56
|
+
if (!response.ok) {
|
|
57
|
+
var _ref;
|
|
58
|
+
setError((_ref = payload == null ? void 0 : payload.error) != null ? _ref : 'Which sites carry a recipe could not be read.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const answered = (_payload_sites = payload.sites) != null ? _payload_sites : [];
|
|
62
|
+
setSites(new Map(answered.map((site)=>[
|
|
63
|
+
site.hostId,
|
|
64
|
+
site
|
|
65
|
+
])));
|
|
66
|
+
setError(null);
|
|
67
|
+
} catch (caught) {
|
|
68
|
+
console.error(caught);
|
|
69
|
+
setError('Which sites carry a recipe could not be read.');
|
|
70
|
+
}
|
|
71
|
+
}, [
|
|
72
|
+
api
|
|
73
|
+
]);
|
|
74
|
+
const hostsReady = Boolean(mount == null ? void 0 : mount.hostsReady);
|
|
75
|
+
useEffect(()=>{
|
|
76
|
+
if (hostsReady) void refresh();
|
|
77
|
+
}, [
|
|
78
|
+
hostsReady,
|
|
79
|
+
refresh
|
|
80
|
+
]);
|
|
81
|
+
return {
|
|
82
|
+
sites,
|
|
83
|
+
error,
|
|
84
|
+
refresh
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** A site's name, linked into its Actions page when the link is known. */ function SiteLink(props) {
|
|
88
|
+
const { mount, hostId } = props;
|
|
89
|
+
const href = siteActionsHref(mount, hostId);
|
|
90
|
+
const name = mount.siteName(hostId);
|
|
91
|
+
return href ? /*#__PURE__*/ _jsx(AppLink, {
|
|
92
|
+
href: href,
|
|
93
|
+
children: name
|
|
94
|
+
}) : /*#__PURE__*/ _jsx(_Fragment, {
|
|
95
|
+
children: name
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
SiteLink.displayName = 'SiteLink';
|
|
99
|
+
/** One recipe's "Installed on" cell: the sites that carry it, and the ones that may. */ function InstalledOn(props) {
|
|
100
|
+
const { mount, recipe, status } = props;
|
|
101
|
+
if (!status) {
|
|
102
|
+
return /*#__PURE__*/ _jsx(Typography, {
|
|
103
|
+
variant: "caption",
|
|
104
|
+
color: "text.secondary",
|
|
105
|
+
children: 'Reading…'
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
const installed = mount.hosts.filter((host)=>standingOf(status, host.id, recipe.id) === 'installed');
|
|
109
|
+
const maybe = mount.hosts.filter((host)=>standingOf(status, host.id, recipe.id) === 'maybe');
|
|
110
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
111
|
+
spacing: 0.5,
|
|
112
|
+
children: [
|
|
113
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
114
|
+
variant: "body2",
|
|
115
|
+
children: installed.length === 0 ? 'Not installed on any site yet.' : installed.map((host, index)=>/*#__PURE__*/ _jsxs(Fragment, {
|
|
116
|
+
children: [
|
|
117
|
+
index > 0 ? ', ' : null,
|
|
118
|
+
/*#__PURE__*/ _jsx(SiteLink, {
|
|
119
|
+
mount: mount,
|
|
120
|
+
hostId: host.id
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
}, host.id))
|
|
124
|
+
}),
|
|
125
|
+
maybe.length > 0 ? /*#__PURE__*/ _jsx(Typography, {
|
|
126
|
+
variant: "caption",
|
|
127
|
+
color: "text.secondary",
|
|
128
|
+
children: `May already have it: ${maybe.map((host)=>host.name).join(', ')} — ` + 'actions there were saved before recipes were tracked.'
|
|
129
|
+
}) : null
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
InstalledOn.displayName = 'InstalledOn';
|
|
134
|
+
/**
|
|
135
|
+
* The install drawer's body: pick the site, pick the form a recipe that
|
|
136
|
+
* needs one is keyed on, confirm. Mounted fresh on every opening — the
|
|
137
|
+
* Drawer unmounts it when closed — so the picks start over each time from
|
|
138
|
+
* the session's site, when that site does not already carry the recipe.
|
|
139
|
+
*
|
|
140
|
+
* The forms are read from the picked site only once a site is picked and
|
|
141
|
+
* only for a recipe that needs one, so a reader installing the other three
|
|
142
|
+
* pays no read. Live forms only: an archived form collects nothing, and a
|
|
143
|
+
* recipe keyed on it would never fire.
|
|
144
|
+
*/ function RecipeInstallForm(props) {
|
|
145
|
+
const { recipe, mount, status, onClose, onInstalled } = props;
|
|
146
|
+
const firestore = useFirestore();
|
|
147
|
+
const api = useCrmApi(null);
|
|
148
|
+
const needsForm = recipe.needs === 'form';
|
|
149
|
+
const [hostId, setHostId] = useState(()=>{
|
|
150
|
+
const pick = mount.createHostId;
|
|
151
|
+
return pick && standingOf(status, pick, recipe.id) !== 'installed' ? pick : '';
|
|
152
|
+
});
|
|
153
|
+
const [formId, setFormId] = useState('');
|
|
154
|
+
const [busy, setBusy] = useState(false);
|
|
155
|
+
const [error, setError] = useState(null);
|
|
156
|
+
const { data: formRead, status: formsStatus } = useFirestoreCollection(()=>needsForm && hostId ? collectionCeiling(collection(firestore, 'hosts', hostId, 'forms'), FORM_OPTION_CEILING) : null, [
|
|
157
|
+
firestore,
|
|
158
|
+
needsForm,
|
|
159
|
+
hostId
|
|
160
|
+
], {
|
|
161
|
+
idField: '$id'
|
|
162
|
+
});
|
|
163
|
+
const { rows: formDocs, truncated: formsTruncated } = ceilingedWindow(formRead, FORM_OPTION_CEILING);
|
|
164
|
+
const formOptions = useMemo(()=>(formDocs != null ? formDocs : []).filter((form)=>!form.archivedAt).map((form)=>{
|
|
165
|
+
var _form_displayName;
|
|
166
|
+
return {
|
|
167
|
+
id: form.$id,
|
|
168
|
+
name: String((_form_displayName = form.displayName) != null ? _form_displayName : '').trim() || form.$id
|
|
169
|
+
};
|
|
170
|
+
}).sort((a, b)=>a.name.localeCompare(b.name)), [
|
|
171
|
+
formDocs
|
|
172
|
+
]);
|
|
173
|
+
const formsLoading = needsForm && Boolean(hostId) && formsStatus === 'loading';
|
|
174
|
+
const canInstall = Boolean(hostId) && (!needsForm || Boolean(formId)) && !busy && !formsLoading;
|
|
175
|
+
const handleInstall = async ()=>{
|
|
176
|
+
if (!canInstall) return;
|
|
177
|
+
setBusy(true);
|
|
178
|
+
setError(null);
|
|
179
|
+
try {
|
|
180
|
+
const { response, payload } = await api('recipe-install', _extends({
|
|
181
|
+
hostId,
|
|
182
|
+
recipeId: recipe.id
|
|
183
|
+
}, formId ? {
|
|
184
|
+
formId
|
|
185
|
+
} : {}));
|
|
186
|
+
if (!response.ok) {
|
|
187
|
+
var _ref;
|
|
188
|
+
setError((_ref = payload == null ? void 0 : payload.error) != null ? _ref : 'The recipe could not be installed.');
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
onInstalled(payload, hostId);
|
|
192
|
+
} catch (caught) {
|
|
193
|
+
console.error(caught);
|
|
194
|
+
setError('The recipe could not be installed.');
|
|
195
|
+
} finally{
|
|
196
|
+
setBusy(false);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
const siteSuffix = (id)=>{
|
|
200
|
+
const standing = standingOf(status, id, recipe.id);
|
|
201
|
+
if (standing === 'installed') return ' — installed';
|
|
202
|
+
if (standing === 'maybe') return ' — may already have it';
|
|
203
|
+
return '';
|
|
204
|
+
};
|
|
205
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
206
|
+
spacing: 2,
|
|
207
|
+
sx: {
|
|
208
|
+
width: 380,
|
|
209
|
+
p: 3
|
|
210
|
+
},
|
|
211
|
+
children: [
|
|
212
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
213
|
+
variant: "h6",
|
|
214
|
+
children: `Install “${recipe.title}”`
|
|
215
|
+
}),
|
|
216
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
217
|
+
variant: "body2",
|
|
218
|
+
color: "text.secondary",
|
|
219
|
+
children: recipe.description
|
|
220
|
+
}),
|
|
221
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
222
|
+
select: true,
|
|
223
|
+
size: "small",
|
|
224
|
+
label: "Site",
|
|
225
|
+
value: hostId,
|
|
226
|
+
onChange: (event)=>{
|
|
227
|
+
setHostId(event.target.value);
|
|
228
|
+
setFormId('');
|
|
229
|
+
setError(null);
|
|
230
|
+
},
|
|
231
|
+
disabled: busy,
|
|
232
|
+
helperText: mount.hosts.length === 0 ? 'This organization has no sites yet.' : 'The action is written into this site’s Automation → Actions.',
|
|
233
|
+
fullWidth: true,
|
|
234
|
+
children: mount.hosts.map((host)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
235
|
+
value: host.id,
|
|
236
|
+
disabled: standingOf(status, host.id, recipe.id) === 'installed',
|
|
237
|
+
children: `${host.name}${siteSuffix(host.id)}`
|
|
238
|
+
}, host.id))
|
|
239
|
+
}),
|
|
240
|
+
needsForm ? /*#__PURE__*/ _jsx(TextField, {
|
|
241
|
+
select: true,
|
|
242
|
+
size: "small",
|
|
243
|
+
label: "Form",
|
|
244
|
+
value: formId,
|
|
245
|
+
onChange: (event)=>setFormId(event.target.value),
|
|
246
|
+
disabled: !hostId || busy || formsLoading,
|
|
247
|
+
helperText: !hostId ? 'Pick the site first; the recipe is keyed on one of its forms.' : formsLoading ? 'Loading the site’s forms…' : formOptions.length === 0 ? 'This site has no live forms.' : formsTruncated ? `Showing the first ${FORM_OPTION_CEILING} forms.` : 'Contacts this form makes are tagged with its name.',
|
|
248
|
+
fullWidth: true,
|
|
249
|
+
children: formOptions.map((form)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
250
|
+
value: form.id,
|
|
251
|
+
children: form.name
|
|
252
|
+
}, form.id))
|
|
253
|
+
}) : null,
|
|
254
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
255
|
+
variant: "caption",
|
|
256
|
+
color: "text.secondary",
|
|
257
|
+
children: 'The action is created enabled, exactly as the recipe defines it. ' + 'Change anything afterwards from the site’s Automation → Actions page.'
|
|
258
|
+
}),
|
|
259
|
+
error ? /*#__PURE__*/ _jsx(Typography, {
|
|
260
|
+
variant: "body2",
|
|
261
|
+
color: "error",
|
|
262
|
+
children: error
|
|
263
|
+
}) : null,
|
|
264
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
265
|
+
direction: "row",
|
|
266
|
+
spacing: 1,
|
|
267
|
+
children: [
|
|
268
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
269
|
+
variant: "contained",
|
|
270
|
+
color: "primary",
|
|
271
|
+
disabled: !canInstall,
|
|
272
|
+
onClick: ()=>void handleInstall(),
|
|
273
|
+
children: busy ? 'Installing…' : 'Install'
|
|
274
|
+
}),
|
|
275
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
276
|
+
onClick: onClose,
|
|
277
|
+
disabled: busy,
|
|
278
|
+
children: 'Cancel'
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
})
|
|
282
|
+
]
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
RecipeInstallForm.displayName = 'RecipeInstallForm';
|
|
286
|
+
/**
|
|
287
|
+
* "Recipes" — the CRM's ready-made automations, installed on a site from
|
|
288
|
+
* the organization (AGL-2639).
|
|
289
|
+
*
|
|
290
|
+
* ## Why this card exists at the org level and nowhere else
|
|
291
|
+
*
|
|
292
|
+
* Automation is a site feature: a site's Actions page has a Recipes menu
|
|
293
|
+
* that opens the editor prefilled, and the person saves what they see.
|
|
294
|
+
* The org hub mounts over every site with no editor of its own, so it had
|
|
295
|
+
* no recipes at all, and an org running five sites installed "Welcome a
|
|
296
|
+
* new lead" five times by hand. This card is the org's door: every recipe,
|
|
297
|
+
* the sites that already carry it, and Install, which writes the action
|
|
298
|
+
* into the site the reader picks through the server — the server stamps
|
|
299
|
+
* the recipe, refuses a site outside the org, and refuses a second copy.
|
|
300
|
+
* Under a site the section does not mount it; the site's own menu is the
|
|
301
|
+
* right door there.
|
|
302
|
+
*
|
|
303
|
+
* ## "Installed on" reads the stamp, and says when it cannot
|
|
304
|
+
*
|
|
305
|
+
* The status route answers, per site, the recipes a live action is stamped
|
|
306
|
+
* with and how many live actions carry no stamp. A site with any of the
|
|
307
|
+
* latter is named as one that MAY already have the recipe rather than
|
|
308
|
+
* listed as clear: those actions were saved before the stamp existed and
|
|
309
|
+
* the card cannot tell a hand-built welcome from an installed one.
|
|
310
|
+
*
|
|
311
|
+
* ## Creation opens a drawer
|
|
312
|
+
*
|
|
313
|
+
* Install is a button per row; the picks — the site, and for Tag by form
|
|
314
|
+
* one of that site's forms — live in a drawer, never above the list.
|
|
315
|
+
*/ export function RecipesCard(props) {
|
|
316
|
+
var _planLabelGrantingFeature;
|
|
317
|
+
const { org } = props;
|
|
318
|
+
const mount = useCrmOrgMount();
|
|
319
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
320
|
+
const status = useRecipeStatus(mount);
|
|
321
|
+
const refreshStatus = status.refresh;
|
|
322
|
+
const [installing, setInstalling] = useState(null);
|
|
323
|
+
const [lastInstall, setLastInstall] = useState(null);
|
|
324
|
+
const entitled = checkEntitlement(org, 'actions');
|
|
325
|
+
const canInstall = Boolean(mount == null ? void 0 : mount.hostsReady) && entitled;
|
|
326
|
+
const handleInstalled = useCallback((result, hostId)=>{
|
|
327
|
+
var _ref;
|
|
328
|
+
setInstalling(null);
|
|
329
|
+
setLastInstall({
|
|
330
|
+
hostId,
|
|
331
|
+
name: result.name
|
|
332
|
+
});
|
|
333
|
+
enqueueSnackbar(`Installed “${result.name}” on ${(_ref = mount == null ? void 0 : mount.siteName(hostId)) != null ? _ref : hostId}`, {
|
|
334
|
+
variant: 'success',
|
|
335
|
+
persist: false
|
|
336
|
+
});
|
|
337
|
+
void refreshStatus();
|
|
338
|
+
}, [
|
|
339
|
+
enqueueSnackbar,
|
|
340
|
+
mount,
|
|
341
|
+
refreshStatus
|
|
342
|
+
]);
|
|
343
|
+
// Mounted by the section only beneath the org hub's provider; the hooks
|
|
344
|
+
// above run either way, so the render order never depends on the mount.
|
|
345
|
+
if (!mount) return null;
|
|
346
|
+
const lastInstallHref = lastInstall ? siteActionsHref(mount, lastInstall.hostId) : null;
|
|
347
|
+
return /*#__PURE__*/ _jsxs(CardDisplay, {
|
|
348
|
+
header: 'Recipes',
|
|
349
|
+
help: pluginDocsHelp('crmSettings', {
|
|
350
|
+
anchor: '#recipes'
|
|
351
|
+
}),
|
|
352
|
+
contentGutterX: true,
|
|
353
|
+
contentGutterY: true,
|
|
354
|
+
contentBordered: "all",
|
|
355
|
+
children: [
|
|
356
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
357
|
+
spacing: 2,
|
|
358
|
+
children: [
|
|
359
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
360
|
+
variant: "body2",
|
|
361
|
+
color: "text.secondary",
|
|
362
|
+
children: 'Ready-made automations for the CRM. Install one on a site and the ' + 'action is written into that site’s Automation → Actions as the ' + 'recipe defines it, where it can be edited like any other action.'
|
|
363
|
+
}),
|
|
364
|
+
lastInstall ? /*#__PURE__*/ _jsx(Alert, {
|
|
365
|
+
severity: "success",
|
|
366
|
+
onClose: ()=>setLastInstall(null),
|
|
367
|
+
action: lastInstallHref ? // A link dressed as a button: the anchor carries its own
|
|
368
|
+
// href, so it keeps the link role a navigation door has.
|
|
369
|
+
/*#__PURE__*/ _jsx(Button, _extends({
|
|
370
|
+
component: AppLink
|
|
371
|
+
}, {
|
|
372
|
+
componentVariant: 'naked',
|
|
373
|
+
nativeButton: false
|
|
374
|
+
}, {
|
|
375
|
+
href: lastInstallHref,
|
|
376
|
+
size: "small",
|
|
377
|
+
color: "inherit",
|
|
378
|
+
children: 'Open Automation → Actions'
|
|
379
|
+
})) : undefined,
|
|
380
|
+
children: `Installed “${lastInstall.name}” on ${mount.siteName(lastInstall.hostId)}.`
|
|
381
|
+
}) : null,
|
|
382
|
+
status.error ? /*#__PURE__*/ _jsx(Typography, {
|
|
383
|
+
variant: "caption",
|
|
384
|
+
color: "error",
|
|
385
|
+
children: status.error
|
|
386
|
+
}) : null,
|
|
387
|
+
/*#__PURE__*/ _jsxs(ScrollTable, {
|
|
388
|
+
size: "small",
|
|
389
|
+
children: [
|
|
390
|
+
/*#__PURE__*/ _jsx(TableHead, {
|
|
391
|
+
children: /*#__PURE__*/ _jsxs(TableRow, {
|
|
392
|
+
children: [
|
|
393
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
394
|
+
children: 'Recipe'
|
|
395
|
+
}),
|
|
396
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
397
|
+
children: 'Installed on'
|
|
398
|
+
}),
|
|
399
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
400
|
+
align: "right"
|
|
401
|
+
})
|
|
402
|
+
]
|
|
403
|
+
})
|
|
404
|
+
}),
|
|
405
|
+
/*#__PURE__*/ _jsx(TableBody, {
|
|
406
|
+
children: CRM_ACTION_RECIPES.map((recipe)=>/*#__PURE__*/ _jsxs(TableRow, {
|
|
407
|
+
hover: true,
|
|
408
|
+
children: [
|
|
409
|
+
/*#__PURE__*/ _jsxs(TableCell, {
|
|
410
|
+
sx: {
|
|
411
|
+
maxWidth: 360
|
|
412
|
+
},
|
|
413
|
+
children: [
|
|
414
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
415
|
+
variant: "body2",
|
|
416
|
+
children: recipe.title
|
|
417
|
+
}),
|
|
418
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
419
|
+
variant: "caption",
|
|
420
|
+
color: "text.secondary",
|
|
421
|
+
children: recipe.description
|
|
422
|
+
})
|
|
423
|
+
]
|
|
424
|
+
}),
|
|
425
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
426
|
+
children: /*#__PURE__*/ _jsx(InstalledOn, {
|
|
427
|
+
mount: mount,
|
|
428
|
+
recipe: recipe,
|
|
429
|
+
status: status.sites
|
|
430
|
+
})
|
|
431
|
+
}),
|
|
432
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
433
|
+
align: "right",
|
|
434
|
+
sx: {
|
|
435
|
+
width: 120
|
|
436
|
+
},
|
|
437
|
+
children: /*#__PURE__*/ _jsxs(Button, {
|
|
438
|
+
size: "small",
|
|
439
|
+
variant: "outlined",
|
|
440
|
+
disabled: !canInstall,
|
|
441
|
+
onClick: ()=>setInstalling(recipe),
|
|
442
|
+
children: [
|
|
443
|
+
'Install',
|
|
444
|
+
/*#__PURE__*/ _jsx(SrOnly, {
|
|
445
|
+
children: ` ${recipe.title}`
|
|
446
|
+
})
|
|
447
|
+
]
|
|
448
|
+
})
|
|
449
|
+
})
|
|
450
|
+
]
|
|
451
|
+
}, recipe.id))
|
|
452
|
+
})
|
|
453
|
+
]
|
|
454
|
+
}),
|
|
455
|
+
!entitled ? /*#__PURE__*/ _jsx(Typography, {
|
|
456
|
+
variant: "caption",
|
|
457
|
+
color: "text.secondary",
|
|
458
|
+
children: `The actions builder requires the ${(_planLabelGrantingFeature = planLabelGrantingFeature('actions')) != null ? _planLabelGrantingFeature : 'Pro'} ` + 'plan — see Billing to upgrade.'
|
|
459
|
+
}) : null,
|
|
460
|
+
mount.hostsReady && mount.hosts.length === 0 ? /*#__PURE__*/ _jsx(Typography, {
|
|
461
|
+
variant: "body2",
|
|
462
|
+
color: "text.secondary",
|
|
463
|
+
children: 'This organization has no sites yet, so there is nowhere to install a recipe.'
|
|
464
|
+
}) : null
|
|
465
|
+
]
|
|
466
|
+
}),
|
|
467
|
+
/*#__PURE__*/ _jsx(Drawer, {
|
|
468
|
+
anchor: "right",
|
|
469
|
+
open: Boolean(installing),
|
|
470
|
+
onClose: ()=>setInstalling(null),
|
|
471
|
+
children: installing ? /*#__PURE__*/ _jsx(RecipeInstallForm, {
|
|
472
|
+
recipe: installing,
|
|
473
|
+
mount: mount,
|
|
474
|
+
status: status.sites,
|
|
475
|
+
onClose: ()=>setInstalling(null),
|
|
476
|
+
onInstalled: handleInstalled
|
|
477
|
+
}) : null
|
|
478
|
+
})
|
|
479
|
+
]
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
RecipesCard.displayName = 'RecipesCard';
|
|
483
|
+
export default RecipesCard;
|
|
484
|
+
|
|
485
|
+
//# sourceMappingURL=recipes-card.js.map
|