@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,641 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
19
|
+
import { CONTACT_FIELD_TYPE_LABELS, createResourceUid, CRM_COLLECTIONS, CRM_FIELD_OBJECT_LABELS, CRM_FIELD_OBJECTS, isCrmFieldObject, newResourceScopeFields, ORG_SCOPE_TOKEN, pluginDocsHelp } from "@aglyn/aglyn";
|
|
20
|
+
import EmptyStateComponent from "@aglyn/shared-ui-jsx/components/empty-state.component";
|
|
21
|
+
import { mdiArchiveArrowUpOutline, mdiArchiveOutline, mdiArrowDown, mdiArrowUp, mdiDeleteOutline, mdiPencilOutline } from "@aglyn/shared-data-mdi";
|
|
22
|
+
import { CardDisplay, MdiIcon, SrOnly, useConfirmationContext } from "@aglyn/shared-ui-jsx";
|
|
23
|
+
import RowActionsMenu from "@aglyn/shared-ui-jsx/components/row-actions-menu.component";
|
|
24
|
+
import { ScrollTable } from "@aglyn/shared-ui-jsx/components/scroll-table.component";
|
|
25
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
26
|
+
import { useFirestore, useUser, writeGuardedBySeed } from "@aglyn/tenant-feature-instance";
|
|
27
|
+
import { Button, Chip, IconButton, Stack, Tab, TableBody, TableCell, TableHead, TableRow, Tabs, Typography } from "@mui/material";
|
|
28
|
+
import { collection, deleteDoc, doc, setDoc, updateDoc, writeBatch } from "firebase/firestore";
|
|
29
|
+
import { useCallback, useState } from "react";
|
|
30
|
+
import { useContactFieldDefinitions } from "../hooks/use-contact-field-definitions.js";
|
|
31
|
+
import { useCrmScope } from "../hooks/use-crm-scope.js";
|
|
32
|
+
import ContactFieldDrawer from "./contact-field-drawer.js";
|
|
33
|
+
import { recomputeAllCrmNextActivity } from "../model/next-activity-api.js";
|
|
34
|
+
import { crmTaskCallScope } from "../model/task-routes.js";
|
|
35
|
+
/** What each tab says the fields are for, above its list. */ const OBJECT_INTRO = {
|
|
36
|
+
contact: 'The custom fields on a contact — text, number, date, choice, ' + 'checkbox or link. They show on every contact, as columns on the ' + 'list, and a form field can save into one.',
|
|
37
|
+
company: 'The custom fields on a company. They show on every company’s page ' + 'and its edit form, as columns on the companies list, and a CSV ' + 'import can fill them.',
|
|
38
|
+
deal: 'The custom fields on a deal. They show on every deal’s page and ' + 'its edit form, and as columns on the deals table.'
|
|
39
|
+
};
|
|
40
|
+
/** The noun each tab's empty state and captions use. */ const OBJECT_NOUN = {
|
|
41
|
+
contact: 'contact',
|
|
42
|
+
company: 'company',
|
|
43
|
+
deal: 'deal'
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* `/crm/fields` — the custom fields a holder keeps on a person (AGL-2601),
|
|
47
|
+
* and since AGL-2661 on a company and a deal too, one tab each.
|
|
48
|
+
*
|
|
49
|
+
* Definitions live in `orgs/{orgId}/contactFields`, one document per field,
|
|
50
|
+
* and the VALUES live under each contact facet's `custom` keyed by the
|
|
51
|
+
* definition's `key`. That split decides everything this section does:
|
|
52
|
+
*
|
|
53
|
+
* - A field is RETIRED, not deleted, while values may exist under it. A
|
|
54
|
+
* retired field leaves every form and every column, but an export can
|
|
55
|
+
* still read what was written, and a restore brings it back intact.
|
|
56
|
+
* Delete is offered only on a retired field, because retiring is the step
|
|
57
|
+
* where the author had to look at what they were losing.
|
|
58
|
+
* - The KEY never changes. It is the map key every value sits under; a
|
|
59
|
+
* rename is a new field and a retire.
|
|
60
|
+
* - Order is a stored `order` on each document, moved with the arrows here,
|
|
61
|
+
* and every reader sorts by it — the profile card, the columns, an export.
|
|
62
|
+
*
|
|
63
|
+
* ## What is NOT on this page
|
|
64
|
+
*
|
|
65
|
+
* How many contacts carry a value under each field. That count is a read of
|
|
66
|
+
* every contact document in the org — the expensive-read shape this codebase
|
|
67
|
+
* has a standing rule against — and it would be paid on every visit to a
|
|
68
|
+
* settings page. The list says so rather than showing a number it cannot
|
|
69
|
+
* afford to keep true.
|
|
70
|
+
*
|
|
71
|
+
* Definitions are ORG-WIDE (`visibleTo: ['org']`): a field is a fact about
|
|
72
|
+
* how this business describes people, and every site in the org files
|
|
73
|
+
* people into the same address book. `hostId` records which site defined it.
|
|
74
|
+
*/ export function ContactsFieldsSection(props) {
|
|
75
|
+
var _ref;
|
|
76
|
+
const { hostId, org } = props;
|
|
77
|
+
const firestore = useFirestore();
|
|
78
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
79
|
+
const { confirm } = useConfirmationContext();
|
|
80
|
+
// The org root from the one scope hook (AGL-2614), which also answers at
|
|
81
|
+
// the organization level (AGL-2630). A definition is org-wide either way;
|
|
82
|
+
// the defining site it records is the mounted one, or the picked one, or
|
|
83
|
+
// none for a field defined over the whole org before any pick.
|
|
84
|
+
const { scope, ready: scopeReady, createHostId } = useCrmScope({
|
|
85
|
+
hostId,
|
|
86
|
+
org
|
|
87
|
+
});
|
|
88
|
+
const orgId = (_ref = scope == null ? void 0 : scope[1]) != null ? _ref : null;
|
|
89
|
+
/*
|
|
90
|
+
* ONE TAB PER OBJECT (AGL-2661). The list, the drawer and every write
|
|
91
|
+
* below are about the tab's object: the hook narrows the org's one
|
|
92
|
+
* definition list to it, a new field is stamped with it, and the drawer
|
|
93
|
+
* refuses a key only against the keys THIS object already uses — a
|
|
94
|
+
* company and a contact may both define `region`.
|
|
95
|
+
*/ const [object, setObject] = useState('contact');
|
|
96
|
+
const { definitions, ready, fromCache } = useContactFieldDefinitions(orgId, object);
|
|
97
|
+
const noun = OBJECT_NOUN[object];
|
|
98
|
+
/*
|
|
99
|
+
* MAINTENANCE: recompute every record's next activity (AGL-2661). The
|
|
100
|
+
* figure is kept by every task write, so this is for the records written
|
|
101
|
+
* before it existed and for whatever a write that could not reach the
|
|
102
|
+
* route left behind. A console action rather than a script, because the
|
|
103
|
+
* person who notices a stale column is the person who should be able to
|
|
104
|
+
* fix it.
|
|
105
|
+
*/ const { data: user } = useUser();
|
|
106
|
+
const [recomputing, setRecomputing] = useState(false);
|
|
107
|
+
const recomputeNextActivity = useCallback(async ()=>{
|
|
108
|
+
const callScope = crmTaskCallScope(hostId, orgId);
|
|
109
|
+
if (!callScope || recomputing) return;
|
|
110
|
+
const confirmed = await confirm({
|
|
111
|
+
title: 'Recompute next activity?',
|
|
112
|
+
description: 'Every contact, company and deal in this organization gets its ' + '"Next activity" recomputed from its open tasks. Safe to run any time; ' + 'it only rewrites a figure the task list already implies.',
|
|
113
|
+
confirmationText: 'Recompute'
|
|
114
|
+
}).then(()=>true).catch(()=>false);
|
|
115
|
+
if (!confirmed) return;
|
|
116
|
+
setRecomputing(true);
|
|
117
|
+
try {
|
|
118
|
+
var _result_tasks;
|
|
119
|
+
const result = await recomputeAllCrmNextActivity(user, callScope);
|
|
120
|
+
enqueueSnackbar(`Next activity recomputed: ${result.records.toLocaleString()} record${result.records === 1 ? '' : 's'} ` + `from ${((_result_tasks = result.tasks) != null ? _result_tasks : 0).toLocaleString()} open task${result.tasks === 1 ? '' : 's'}` + (result.truncated ? ' — the first batch of open tasks only; nothing stale was cleared' : ''), {
|
|
121
|
+
variant: 'success'
|
|
122
|
+
});
|
|
123
|
+
} catch (cause) {
|
|
124
|
+
enqueueSnackbar(cause instanceof Error ? cause.message : 'The next activity could not be recomputed.', {
|
|
125
|
+
variant: 'warning'
|
|
126
|
+
});
|
|
127
|
+
} finally{
|
|
128
|
+
setRecomputing(false);
|
|
129
|
+
}
|
|
130
|
+
}, [
|
|
131
|
+
hostId,
|
|
132
|
+
orgId,
|
|
133
|
+
recomputing,
|
|
134
|
+
confirm,
|
|
135
|
+
user,
|
|
136
|
+
enqueueSnackbar
|
|
137
|
+
]);
|
|
138
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
139
|
+
const [editing, setEditing] = useState(null);
|
|
140
|
+
const [busyId, setBusyId] = useState('');
|
|
141
|
+
const fieldRef = useCallback((id)=>{
|
|
142
|
+
if (!scope) throw new Error('a contact field needs an organization');
|
|
143
|
+
return doc(firestore, scope[0], scope[1], CRM_COLLECTIONS.contactFields, id);
|
|
144
|
+
}, [
|
|
145
|
+
firestore,
|
|
146
|
+
scope
|
|
147
|
+
]);
|
|
148
|
+
const openCreate = useCallback(()=>{
|
|
149
|
+
setEditing(null);
|
|
150
|
+
setDrawerOpen(true);
|
|
151
|
+
}, []);
|
|
152
|
+
const openEdit = useCallback((definition)=>{
|
|
153
|
+
setEditing(definition);
|
|
154
|
+
setDrawerOpen(true);
|
|
155
|
+
}, []);
|
|
156
|
+
/**
|
|
157
|
+
* Create, or save the editable half of an existing field.
|
|
158
|
+
*
|
|
159
|
+
* On create the document carries everything a reader expects: the key,
|
|
160
|
+
* an `order` past every existing one so it lands last, an explicit
|
|
161
|
+
* `retiredAt: null` so a `where('retiredAt', '==', null)` can find it, the
|
|
162
|
+
* defining site, and the org-wide scope stamp the rules require. On edit
|
|
163
|
+
* only the label, the choices and the required flag move — the key and
|
|
164
|
+
* the type are the drawer's disabled inputs, and this writer does not
|
|
165
|
+
* take them either.
|
|
166
|
+
*/ const handleSubmit = useCallback(async (draft)=>{
|
|
167
|
+
if (!scope) return;
|
|
168
|
+
const now = new Date();
|
|
169
|
+
if (editing) {
|
|
170
|
+
const verdict = await writeGuardedBySeed({
|
|
171
|
+
subject: 'field',
|
|
172
|
+
fromCache
|
|
173
|
+
}, async ()=>{
|
|
174
|
+
await updateDoc(fieldRef(editing.$id), _extends({
|
|
175
|
+
label: draft.label
|
|
176
|
+
}, editing.type === 'select' ? {
|
|
177
|
+
options: draft.options
|
|
178
|
+
} : {}, {
|
|
179
|
+
required: draft.required,
|
|
180
|
+
updatedAt: now
|
|
181
|
+
}));
|
|
182
|
+
});
|
|
183
|
+
if (!verdict.ok) {
|
|
184
|
+
return void enqueueSnackbar(verdict.message, {
|
|
185
|
+
variant: 'warning',
|
|
186
|
+
persist: false
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
enqueueSnackbar('Field saved', {
|
|
190
|
+
variant: 'success',
|
|
191
|
+
persist: false
|
|
192
|
+
});
|
|
193
|
+
} else {
|
|
194
|
+
const order = definitions.reduce((highest, definition)=>Math.max(highest, Number(definition.order) || 0), -1) + 1;
|
|
195
|
+
await setDoc(doc(collection(firestore, scope[0], scope[1], CRM_COLLECTIONS.contactFields), createResourceUid()), _extends({
|
|
196
|
+
key: draft.key,
|
|
197
|
+
label: draft.label,
|
|
198
|
+
type: draft.type
|
|
199
|
+
}, draft.type === 'select' ? {
|
|
200
|
+
options: draft.options
|
|
201
|
+
} : {}, {
|
|
202
|
+
required: draft.required,
|
|
203
|
+
order,
|
|
204
|
+
retiredAt: null,
|
|
205
|
+
// Which record the field describes — the tab it was made on.
|
|
206
|
+
object,
|
|
207
|
+
hostId: createHostId
|
|
208
|
+
}, newResourceScopeFields([
|
|
209
|
+
ORG_SCOPE_TOKEN
|
|
210
|
+
]), {
|
|
211
|
+
createdAt: now,
|
|
212
|
+
updatedAt: now
|
|
213
|
+
}));
|
|
214
|
+
enqueueSnackbar(`Field "${draft.label}" added`, {
|
|
215
|
+
variant: 'success',
|
|
216
|
+
persist: false
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
setDrawerOpen(false);
|
|
220
|
+
setEditing(null);
|
|
221
|
+
}, [
|
|
222
|
+
scope,
|
|
223
|
+
editing,
|
|
224
|
+
fromCache,
|
|
225
|
+
fieldRef,
|
|
226
|
+
enqueueSnackbar,
|
|
227
|
+
definitions,
|
|
228
|
+
firestore,
|
|
229
|
+
createHostId,
|
|
230
|
+
object
|
|
231
|
+
]);
|
|
232
|
+
/**
|
|
233
|
+
* Move a field one place up or down.
|
|
234
|
+
*
|
|
235
|
+
* Writes `order` as the POSITION for every row whose stored order is not
|
|
236
|
+
* already its position, in one batch. Swapping two numbers would be enough
|
|
237
|
+
* on a list whose orders are already distinct, and wrong on one where they
|
|
238
|
+
* are not — every field created before this section existed carries the
|
|
239
|
+
* same `order`, and a swap of two equal numbers moves nothing. Renumbering
|
|
240
|
+
* what is out of place makes the first move on such a list also the one
|
|
241
|
+
* that normalizes it, at the cost of a batch that is at most the list.
|
|
242
|
+
*/ const move = useCallback(async (definition, direction)=>{
|
|
243
|
+
if (!scope || busyId) return;
|
|
244
|
+
const index = definitions.findIndex((entry)=>entry.$id === definition.$id);
|
|
245
|
+
const target = index + direction;
|
|
246
|
+
if (index < 0 || target < 0 || target >= definitions.length) return;
|
|
247
|
+
const next = [
|
|
248
|
+
...definitions
|
|
249
|
+
];
|
|
250
|
+
next[index] = definitions[target];
|
|
251
|
+
next[target] = definitions[index];
|
|
252
|
+
setBusyId(definition.$id);
|
|
253
|
+
try {
|
|
254
|
+
const verdict = await writeGuardedBySeed({
|
|
255
|
+
subject: 'field order',
|
|
256
|
+
fromCache
|
|
257
|
+
}, async ()=>{
|
|
258
|
+
const batch = writeBatch(firestore);
|
|
259
|
+
const now = new Date();
|
|
260
|
+
next.forEach((entry, position)=>{
|
|
261
|
+
if (entry.order === position) return;
|
|
262
|
+
batch.update(fieldRef(entry.$id), {
|
|
263
|
+
order: position,
|
|
264
|
+
updatedAt: now
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
await batch.commit();
|
|
268
|
+
});
|
|
269
|
+
if (!verdict.ok) {
|
|
270
|
+
enqueueSnackbar(verdict.message, {
|
|
271
|
+
variant: 'warning',
|
|
272
|
+
persist: false
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
} catch (error) {
|
|
276
|
+
console.error(error);
|
|
277
|
+
enqueueSnackbar('An error has occurred', {
|
|
278
|
+
variant: 'error',
|
|
279
|
+
allowDuplicate: true
|
|
280
|
+
});
|
|
281
|
+
} finally{
|
|
282
|
+
setBusyId('');
|
|
283
|
+
}
|
|
284
|
+
}, [
|
|
285
|
+
scope,
|
|
286
|
+
busyId,
|
|
287
|
+
definitions,
|
|
288
|
+
fromCache,
|
|
289
|
+
firestore,
|
|
290
|
+
fieldRef,
|
|
291
|
+
enqueueSnackbar
|
|
292
|
+
]);
|
|
293
|
+
/**
|
|
294
|
+
* Retire a field, or bring one back.
|
|
295
|
+
*
|
|
296
|
+
* Retiring is asked about because it takes a control off every contact
|
|
297
|
+
* form and a column off the list; restoring is not, because it puts a
|
|
298
|
+
* choice back and is undone by retiring again. Neither touches a value.
|
|
299
|
+
*/ const toggleRetired = useCallback(async (definition)=>{
|
|
300
|
+
if (!scope || busyId) return;
|
|
301
|
+
if (!definition.retiredAt) {
|
|
302
|
+
const accepted = await confirm({
|
|
303
|
+
title: `Retire “${definition.label}”?`,
|
|
304
|
+
description: `It leaves every ${noun} form, column and form-field mapping. ` + 'Values already saved under it are kept and still export, and ' + 'you can restore the field at any time.',
|
|
305
|
+
confirmationText: 'Retire'
|
|
306
|
+
})// `confirm` resolves with no value and REJECTS on cancel, so gating
|
|
307
|
+
// on the resolved value alone would always fall through.
|
|
308
|
+
.then(()=>true).catch(()=>false);
|
|
309
|
+
if (!accepted) return;
|
|
310
|
+
}
|
|
311
|
+
setBusyId(definition.$id);
|
|
312
|
+
try {
|
|
313
|
+
await updateDoc(fieldRef(definition.$id), {
|
|
314
|
+
retiredAt: definition.retiredAt ? null : Date.now(),
|
|
315
|
+
updatedAt: new Date()
|
|
316
|
+
});
|
|
317
|
+
enqueueSnackbar(definition.retiredAt ? 'Field restored' : 'Field retired', {
|
|
318
|
+
variant: 'success',
|
|
319
|
+
persist: false
|
|
320
|
+
});
|
|
321
|
+
} catch (error) {
|
|
322
|
+
console.error(error);
|
|
323
|
+
enqueueSnackbar('An error has occurred', {
|
|
324
|
+
variant: 'error',
|
|
325
|
+
allowDuplicate: true
|
|
326
|
+
});
|
|
327
|
+
} finally{
|
|
328
|
+
setBusyId('');
|
|
329
|
+
}
|
|
330
|
+
}, [
|
|
331
|
+
scope,
|
|
332
|
+
busyId,
|
|
333
|
+
confirm,
|
|
334
|
+
fieldRef,
|
|
335
|
+
enqueueSnackbar,
|
|
336
|
+
noun
|
|
337
|
+
]);
|
|
338
|
+
/**
|
|
339
|
+
* Delete a RETIRED field's definition.
|
|
340
|
+
*
|
|
341
|
+
* The values under its key are not touched — they sit on contact documents
|
|
342
|
+
* this page does not read — so what is destroyed is the ability to show
|
|
343
|
+
* them anywhere. The dialog says exactly that, and the key stays taken for
|
|
344
|
+
* as long as the list can see it, which after this write it cannot; a new
|
|
345
|
+
* field with the same key would read the orphaned values back as its own.
|
|
346
|
+
*/ const handleDelete = useCallback(async (definition)=>{
|
|
347
|
+
if (!scope || busyId || !definition.retiredAt) return;
|
|
348
|
+
const accepted = await confirm({
|
|
349
|
+
title: `Delete “${definition.label}”?`,
|
|
350
|
+
description: 'The definition is removed for good. Values saved under its key ' + `(${definition.key}) stay on the ${noun}s that carry them but ` + 'nothing will show them again — and a new field created with the ' + 'same key would read them as its own.',
|
|
351
|
+
confirmationText: 'Delete field',
|
|
352
|
+
confirmationButtonProps: {
|
|
353
|
+
color: 'error'
|
|
354
|
+
}
|
|
355
|
+
}).then(()=>true).catch(()=>false);
|
|
356
|
+
if (!accepted) return;
|
|
357
|
+
setBusyId(definition.$id);
|
|
358
|
+
try {
|
|
359
|
+
await deleteDoc(fieldRef(definition.$id));
|
|
360
|
+
enqueueSnackbar('Field deleted', {
|
|
361
|
+
variant: 'success',
|
|
362
|
+
persist: false
|
|
363
|
+
});
|
|
364
|
+
} catch (error) {
|
|
365
|
+
console.error(error);
|
|
366
|
+
enqueueSnackbar('An error has occurred', {
|
|
367
|
+
variant: 'error',
|
|
368
|
+
allowDuplicate: true
|
|
369
|
+
});
|
|
370
|
+
} finally{
|
|
371
|
+
setBusyId('');
|
|
372
|
+
}
|
|
373
|
+
}, [
|
|
374
|
+
scope,
|
|
375
|
+
busyId,
|
|
376
|
+
confirm,
|
|
377
|
+
fieldRef,
|
|
378
|
+
enqueueSnackbar,
|
|
379
|
+
noun
|
|
380
|
+
]);
|
|
381
|
+
const rowActions = (definition)=>[
|
|
382
|
+
{
|
|
383
|
+
key: 'edit',
|
|
384
|
+
label: 'Edit field',
|
|
385
|
+
icon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
386
|
+
path: mdiPencilOutline.path,
|
|
387
|
+
size: 0.8
|
|
388
|
+
}),
|
|
389
|
+
onClick: ()=>openEdit(definition)
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
key: 'retire',
|
|
393
|
+
label: definition.retiredAt ? 'Restore' : 'Retire',
|
|
394
|
+
icon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
395
|
+
path: definition.retiredAt ? mdiArchiveArrowUpOutline.path : mdiArchiveOutline.path,
|
|
396
|
+
size: 0.8
|
|
397
|
+
}),
|
|
398
|
+
destructive: !definition.retiredAt,
|
|
399
|
+
disabled: Boolean(busyId),
|
|
400
|
+
disabledReason: busyId ? 'Another field is being saved' : undefined,
|
|
401
|
+
onClick: ()=>void toggleRetired(definition)
|
|
402
|
+
},
|
|
403
|
+
...definition.retiredAt ? [
|
|
404
|
+
{
|
|
405
|
+
key: 'delete',
|
|
406
|
+
label: 'Delete',
|
|
407
|
+
icon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
408
|
+
path: mdiDeleteOutline.path,
|
|
409
|
+
size: 0.8
|
|
410
|
+
}),
|
|
411
|
+
destructive: true,
|
|
412
|
+
disabled: Boolean(busyId),
|
|
413
|
+
disabledReason: busyId ? 'Another field is being saved' : undefined,
|
|
414
|
+
onClick: ()=>void handleDelete(definition)
|
|
415
|
+
}
|
|
416
|
+
] : []
|
|
417
|
+
];
|
|
418
|
+
return /*#__PURE__*/ _jsxs(CardDisplay, {
|
|
419
|
+
header: 'Fields',
|
|
420
|
+
help: pluginDocsHelp('contactFields', {
|
|
421
|
+
anchor: '#define-a-field'
|
|
422
|
+
}),
|
|
423
|
+
contentGutterX: true,
|
|
424
|
+
contentGutterY: true,
|
|
425
|
+
contentBordered: "all",
|
|
426
|
+
HeaderProps: {
|
|
427
|
+
action: scope ? /*#__PURE__*/ _jsxs(Stack, {
|
|
428
|
+
direction: "row",
|
|
429
|
+
spacing: 1,
|
|
430
|
+
sx: {
|
|
431
|
+
alignItems: 'center'
|
|
432
|
+
},
|
|
433
|
+
children: [
|
|
434
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
435
|
+
size: "small",
|
|
436
|
+
onClick: ()=>void recomputeNextActivity(),
|
|
437
|
+
disabled: recomputing,
|
|
438
|
+
children: recomputing ? 'Recomputing…' : 'Recompute next activity'
|
|
439
|
+
}),
|
|
440
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
441
|
+
variant: "contained",
|
|
442
|
+
onClick: openCreate,
|
|
443
|
+
children: 'New field'
|
|
444
|
+
})
|
|
445
|
+
]
|
|
446
|
+
}) : null
|
|
447
|
+
},
|
|
448
|
+
children: [
|
|
449
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
450
|
+
spacing: 2,
|
|
451
|
+
children: [
|
|
452
|
+
/*#__PURE__*/ _jsx(Tabs, {
|
|
453
|
+
value: object,
|
|
454
|
+
onChange: (_event, next)=>{
|
|
455
|
+
if (isCrmFieldObject(next)) setObject(next);
|
|
456
|
+
},
|
|
457
|
+
"aria-label": "Fields by record",
|
|
458
|
+
children: CRM_FIELD_OBJECTS.map((entry)=>/*#__PURE__*/ _jsx(Tab, {
|
|
459
|
+
value: entry,
|
|
460
|
+
label: CRM_FIELD_OBJECT_LABELS[entry]
|
|
461
|
+
}, entry))
|
|
462
|
+
}),
|
|
463
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
464
|
+
variant: "body2",
|
|
465
|
+
color: "text.secondary",
|
|
466
|
+
children: `${OBJECT_INTRO[object]} Fields are shared across every site in this ` + 'organization, like the records themselves.'
|
|
467
|
+
}),
|
|
468
|
+
scopeReady && !scope ? /*#__PURE__*/ _jsx(Typography, {
|
|
469
|
+
variant: "body2",
|
|
470
|
+
color: "text.secondary",
|
|
471
|
+
children: `This site has no organization, so it has no ${noun} fields.`
|
|
472
|
+
}) : !ready ? null : definitions.length === 0 ? /*#__PURE__*/ _jsx(EmptyStateComponent, {
|
|
473
|
+
label: `No custom ${noun} fields yet`,
|
|
474
|
+
description: `A field you define here is kept on every ${noun} and shows on its page.`,
|
|
475
|
+
action: scope ? /*#__PURE__*/ _jsx(Button, {
|
|
476
|
+
variant: "contained",
|
|
477
|
+
onClick: openCreate,
|
|
478
|
+
children: 'New field'
|
|
479
|
+
}) : undefined
|
|
480
|
+
}) : /*#__PURE__*/ _jsxs(ScrollTable, {
|
|
481
|
+
size: "small",
|
|
482
|
+
children: [
|
|
483
|
+
/*#__PURE__*/ _jsx(TableHead, {
|
|
484
|
+
children: /*#__PURE__*/ _jsxs(TableRow, {
|
|
485
|
+
children: [
|
|
486
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
487
|
+
sx: {
|
|
488
|
+
width: 96
|
|
489
|
+
},
|
|
490
|
+
children: 'Order'
|
|
491
|
+
}),
|
|
492
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
493
|
+
children: 'Field'
|
|
494
|
+
}),
|
|
495
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
496
|
+
children: 'Key'
|
|
497
|
+
}),
|
|
498
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
499
|
+
children: 'Type'
|
|
500
|
+
}),
|
|
501
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
502
|
+
children: 'Required'
|
|
503
|
+
}),
|
|
504
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
505
|
+
align: "right"
|
|
506
|
+
})
|
|
507
|
+
]
|
|
508
|
+
})
|
|
509
|
+
}),
|
|
510
|
+
/*#__PURE__*/ _jsx(TableBody, {
|
|
511
|
+
children: definitions.map((definition, index)=>{
|
|
512
|
+
var _CONTACT_FIELD_TYPE_LABELS_definition_type;
|
|
513
|
+
var _definition_options;
|
|
514
|
+
return /*#__PURE__*/ _jsxs(TableRow, {
|
|
515
|
+
hover: true,
|
|
516
|
+
sx: definition.retiredAt ? {
|
|
517
|
+
opacity: 0.6
|
|
518
|
+
} : undefined,
|
|
519
|
+
children: [
|
|
520
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
521
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
522
|
+
direction: "row",
|
|
523
|
+
spacing: 0,
|
|
524
|
+
children: [
|
|
525
|
+
/*#__PURE__*/ _jsxs(IconButton, {
|
|
526
|
+
size: "small",
|
|
527
|
+
disabled: index === 0 || Boolean(busyId),
|
|
528
|
+
onClick: ()=>void move(definition, -1),
|
|
529
|
+
children: [
|
|
530
|
+
/*#__PURE__*/ _jsx(MdiIcon, {
|
|
531
|
+
path: mdiArrowUp.path,
|
|
532
|
+
size: 0.7
|
|
533
|
+
}),
|
|
534
|
+
/*#__PURE__*/ _jsx(SrOnly, {
|
|
535
|
+
children: `Move ${definition.label} up`
|
|
536
|
+
})
|
|
537
|
+
]
|
|
538
|
+
}),
|
|
539
|
+
/*#__PURE__*/ _jsxs(IconButton, {
|
|
540
|
+
size: "small",
|
|
541
|
+
disabled: index === definitions.length - 1 || Boolean(busyId),
|
|
542
|
+
onClick: ()=>void move(definition, 1),
|
|
543
|
+
children: [
|
|
544
|
+
/*#__PURE__*/ _jsx(MdiIcon, {
|
|
545
|
+
path: mdiArrowDown.path,
|
|
546
|
+
size: 0.7
|
|
547
|
+
}),
|
|
548
|
+
/*#__PURE__*/ _jsx(SrOnly, {
|
|
549
|
+
children: `Move ${definition.label} down`
|
|
550
|
+
})
|
|
551
|
+
]
|
|
552
|
+
})
|
|
553
|
+
]
|
|
554
|
+
})
|
|
555
|
+
}),
|
|
556
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
557
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
558
|
+
direction: "row",
|
|
559
|
+
spacing: 1,
|
|
560
|
+
sx: {
|
|
561
|
+
flexWrap: 'wrap',
|
|
562
|
+
alignItems: 'center'
|
|
563
|
+
},
|
|
564
|
+
children: [
|
|
565
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
566
|
+
variant: "body2",
|
|
567
|
+
children: definition.label
|
|
568
|
+
}),
|
|
569
|
+
definition.retiredAt ? /*#__PURE__*/ _jsx(Chip, {
|
|
570
|
+
size: "small",
|
|
571
|
+
variant: "outlined",
|
|
572
|
+
color: "warning",
|
|
573
|
+
label: "Retired"
|
|
574
|
+
}) : null
|
|
575
|
+
]
|
|
576
|
+
})
|
|
577
|
+
}),
|
|
578
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
579
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
580
|
+
variant: "body2",
|
|
581
|
+
color: "text.secondary",
|
|
582
|
+
sx: {
|
|
583
|
+
fontFamily: 'monospace'
|
|
584
|
+
},
|
|
585
|
+
children: definition.key
|
|
586
|
+
})
|
|
587
|
+
}),
|
|
588
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
589
|
+
children: /*#__PURE__*/ _jsxs(Typography, {
|
|
590
|
+
variant: "body2",
|
|
591
|
+
children: [
|
|
592
|
+
(_CONTACT_FIELD_TYPE_LABELS_definition_type = CONTACT_FIELD_TYPE_LABELS[definition.type]) != null ? _CONTACT_FIELD_TYPE_LABELS_definition_type : definition.type,
|
|
593
|
+
definition.type === 'select' && ((_definition_options = definition.options) == null ? void 0 : _definition_options.length) ? ` · ${definition.options.length} choices` : ''
|
|
594
|
+
]
|
|
595
|
+
})
|
|
596
|
+
}),
|
|
597
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
598
|
+
children: /*#__PURE__*/ _jsx(Typography, {
|
|
599
|
+
variant: "body2",
|
|
600
|
+
color: "text.secondary",
|
|
601
|
+
children: definition.required ? 'Yes' : '—'
|
|
602
|
+
})
|
|
603
|
+
}),
|
|
604
|
+
/*#__PURE__*/ _jsx(TableCell, {
|
|
605
|
+
align: "right",
|
|
606
|
+
sx: {
|
|
607
|
+
width: 56
|
|
608
|
+
},
|
|
609
|
+
children: /*#__PURE__*/ _jsx(RowActionsMenu, {
|
|
610
|
+
label: definition.label,
|
|
611
|
+
items: rowActions(definition)
|
|
612
|
+
})
|
|
613
|
+
})
|
|
614
|
+
]
|
|
615
|
+
}, definition.$id);
|
|
616
|
+
})
|
|
617
|
+
})
|
|
618
|
+
]
|
|
619
|
+
}),
|
|
620
|
+
definitions.length ? /*#__PURE__*/ _jsx(Typography, {
|
|
621
|
+
variant: "caption",
|
|
622
|
+
color: "text.secondary",
|
|
623
|
+
children: `How many ${noun}s carry a value under each field is not ` + `counted — that would read every ${noun} in the organization ` + 'each time this page opened.'
|
|
624
|
+
}) : null
|
|
625
|
+
]
|
|
626
|
+
}),
|
|
627
|
+
/*#__PURE__*/ _jsx(ContactFieldDrawer, {
|
|
628
|
+
open: drawerOpen,
|
|
629
|
+
onClose: ()=>setDrawerOpen(false),
|
|
630
|
+
definition: editing,
|
|
631
|
+
object: object,
|
|
632
|
+
takenKeys: definitions.map((definition)=>definition.key),
|
|
633
|
+
onSubmit: handleSubmit
|
|
634
|
+
})
|
|
635
|
+
]
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
ContactsFieldsSection.displayName = 'ContactsFieldsSection';
|
|
639
|
+
export default ContactsFieldsSection;
|
|
640
|
+
|
|
641
|
+
//# sourceMappingURL=fields-section.js.map
|