@aglyn/plugins-crm 1.0.0-beta.221 → 1.0.0-beta.223
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/README.md +2 -1
- package/package.json +13 -13
- package/src/lib/components/activity-list.js +12 -5
- package/src/lib/components/activity-list.js.map +1 -1
- package/src/lib/components/companies-bulk-bar.d.ts +1 -4
- package/src/lib/components/companies-bulk-bar.js +7 -20
- package/src/lib/components/companies-bulk-bar.js.map +1 -1
- package/src/lib/components/companies-section.d.ts +3 -3
- package/src/lib/components/companies-section.js +149 -46
- package/src/lib/components/companies-section.js.map +1 -1
- package/src/lib/components/company-edit-drawer.js +281 -20
- package/src/lib/components/company-edit-drawer.js.map +1 -1
- package/src/lib/components/company-properties-card.js +99 -8
- package/src/lib/components/company-properties-card.js.map +1 -1
- package/src/lib/components/contact-detail-page.js +3 -1
- package/src/lib/components/contact-detail-page.js.map +1 -1
- package/src/lib/components/contact-merge-dialog.js +33 -10
- package/src/lib/components/contact-merge-dialog.js.map +1 -1
- package/src/lib/components/contact-properties-card.d.ts +0 -69
- package/src/lib/components/contact-properties-card.js +350 -60
- package/src/lib/components/contact-properties-card.js.map +1 -1
- package/src/lib/components/contact-reports-to-field.d.ts +46 -0
- package/src/lib/components/contact-reports-to-field.js +67 -0
- package/src/lib/components/contact-reports-to-field.js.map +1 -0
- package/src/lib/components/contacts-bulk-bar.d.ts +1 -8
- package/src/lib/components/contacts-bulk-bar.js +7 -19
- package/src/lib/components/contacts-bulk-bar.js.map +1 -1
- package/src/lib/components/contacts-section.js +46 -33
- package/src/lib/components/contacts-section.js.map +1 -1
- package/src/lib/components/crm-call-actions.d.ts +10 -0
- package/src/lib/components/crm-call-actions.js +26 -9
- package/src/lib/components/crm-call-actions.js.map +1 -1
- package/src/lib/components/crm-next-activity-column.js +1 -1
- package/src/lib/components/crm-next-activity-column.js.map +1 -1
- package/src/lib/components/crm-record-picker.d.ts +15 -0
- package/src/lib/components/crm-record-picker.js +16 -10
- package/src/lib/components/crm-record-picker.js.map +1 -1
- package/src/lib/components/crm-transfer-buttons.d.ts +54 -0
- package/src/lib/components/crm-transfer-buttons.js +167 -0
- package/src/lib/components/crm-transfer-buttons.js.map +1 -0
- package/src/lib/components/deal-contact-roles-card.d.ts +46 -0
- package/src/lib/components/deal-contact-roles-card.js +368 -0
- package/src/lib/components/deal-contact-roles-card.js.map +1 -0
- package/src/lib/components/deal-detail-page.d.ts +3 -2
- package/src/lib/components/deal-detail-page.js +25 -6
- package/src/lib/components/deal-detail-page.js.map +1 -1
- package/src/lib/components/deal-edit-drawer.d.ts +10 -0
- package/src/lib/components/deal-edit-drawer.js +219 -10
- package/src/lib/components/deal-edit-drawer.js.map +1 -1
- package/src/lib/components/deal-properties-card.d.ts +7 -0
- package/src/lib/components/deal-properties-card.js +34 -3
- package/src/lib/components/deal-properties-card.js.map +1 -1
- package/src/lib/components/deal-stage-card.d.ts +4 -0
- package/src/lib/components/deal-stage-card.js +10 -2
- package/src/lib/components/deal-stage-card.js.map +1 -1
- package/src/lib/components/deals-bulk-bar.d.ts +0 -3
- package/src/lib/components/deals-bulk-bar.js +7 -20
- package/src/lib/components/deals-bulk-bar.js.map +1 -1
- package/src/lib/components/deals-section.d.ts +3 -3
- package/src/lib/components/deals-section.js +123 -63
- package/src/lib/components/deals-section.js.map +1 -1
- package/src/lib/components/fields-section.js +31 -17
- package/src/lib/components/fields-section.js.map +1 -1
- package/src/lib/components/lead-convert-dialog.d.ts +4 -0
- package/src/lib/components/lead-convert-dialog.js +23 -1
- package/src/lib/components/lead-convert-dialog.js.map +1 -1
- package/src/lib/components/lead-detail-page.js +8 -2
- package/src/lib/components/lead-detail-page.js.map +1 -1
- package/src/lib/components/lead-profile-fields.d.ts +71 -0
- package/src/lib/components/lead-profile-fields.js +386 -0
- package/src/lib/components/lead-profile-fields.js.map +1 -0
- package/src/lib/components/lead-properties-card.d.ts +2 -1
- package/src/lib/components/lead-properties-card.js +85 -176
- package/src/lib/components/lead-properties-card.js.map +1 -1
- package/src/lib/components/lead-source-select.d.ts +4 -23
- package/src/lib/components/lead-source-select.js +9 -73
- package/src/lib/components/lead-source-select.js.map +1 -1
- package/src/lib/components/lead-status-chip.d.ts +9 -3
- package/src/lib/components/lead-status-chip.js +8 -4
- package/src/lib/components/lead-status-chip.js.map +1 -1
- package/src/lib/components/lead-status-options.d.ts +20 -0
- package/src/lib/components/lead-status-options.js +51 -0
- package/src/lib/components/lead-status-options.js.map +1 -0
- package/src/lib/components/lead-unqualify-dialog.d.ts +5 -0
- package/src/lib/components/lead-unqualify-dialog.js +50 -18
- package/src/lib/components/lead-unqualify-dialog.js.map +1 -1
- package/src/lib/components/leads-bulk-bar.d.ts +0 -3
- package/src/lib/components/leads-bulk-bar.js +29 -29
- package/src/lib/components/leads-bulk-bar.js.map +1 -1
- package/src/lib/components/leads-section.js +120 -68
- package/src/lib/components/leads-section.js.map +1 -1
- package/src/lib/components/linked-deals-card.d.ts +4 -0
- package/src/lib/components/linked-deals-card.js +47 -3
- package/src/lib/components/linked-deals-card.js.map +1 -1
- package/src/lib/components/log-activity-dialog.js +43 -3
- package/src/lib/components/log-activity-dialog.js.map +1 -1
- package/src/lib/components/new-contact-drawer.d.ts +8 -0
- package/src/lib/components/new-contact-drawer.js +108 -6
- package/src/lib/components/new-contact-drawer.js.map +1 -1
- package/src/lib/components/new-lead-drawer.d.ts +9 -2
- package/src/lib/components/new-lead-drawer.js +88 -121
- package/src/lib/components/new-lead-drawer.js.map +1 -1
- package/src/lib/components/picklist-select.d.ts +36 -0
- package/src/lib/components/picklist-select.js +114 -0
- package/src/lib/components/picklist-select.js.map +1 -0
- package/src/lib/components/picklist-values-card.d.ts +34 -0
- package/src/lib/components/{lead-source-values-card.js → picklist-values-card.js} +241 -58
- package/src/lib/components/picklist-values-card.js.map +1 -0
- package/src/lib/components/pipeline-stages-dialog.d.ts +7 -0
- package/src/lib/components/pipeline-stages-dialog.js +26 -4
- package/src/lib/components/pipeline-stages-dialog.js.map +1 -1
- package/src/lib/components/pipelines-dialog.js +15 -6
- package/src/lib/components/pipelines-dialog.js.map +1 -1
- package/src/lib/components/recent-activity-feed.js +20 -5
- package/src/lib/components/recent-activity-feed.js.map +1 -1
- package/src/lib/components/recipes-card.js +4 -2
- package/src/lib/components/recipes-card.js.map +1 -1
- package/src/lib/components/record-tasks-card.js +15 -8
- package/src/lib/components/record-tasks-card.js.map +1 -1
- package/src/lib/components/reports/forecast-card.d.ts +6 -0
- package/src/lib/components/reports/forecast-card.js +101 -3
- package/src/lib/components/reports/forecast-card.js.map +1 -1
- package/src/lib/components/reports/lead-funnel-card.d.ts +12 -0
- package/src/lib/components/reports/lead-funnel-card.js +9 -5
- package/src/lib/components/reports/lead-funnel-card.js.map +1 -1
- package/src/lib/components/reports/lead-source-card.d.ts +23 -0
- package/src/lib/components/reports/lead-source-card.js +318 -0
- package/src/lib/components/reports/lead-source-card.js.map +1 -0
- package/src/lib/components/reports/pipeline-card.js +2 -1
- package/src/lib/components/reports/pipeline-card.js.map +1 -1
- package/src/lib/components/reports/report-export.js +1 -1
- package/src/lib/components/reports/report-export.js.map +1 -1
- package/src/lib/components/reports-section.js +8 -0
- package/src/lib/components/reports-section.js.map +1 -1
- package/src/lib/components/sharing-rule-drawer.d.ts +5 -0
- package/src/lib/components/sharing-rule-drawer.js +108 -19
- package/src/lib/components/sharing-rule-drawer.js.map +1 -1
- package/src/lib/components/sharing-rules-card.js +11 -3
- package/src/lib/components/sharing-rules-card.js.map +1 -1
- package/src/lib/components/task-cells.d.ts +9 -1
- package/src/lib/components/task-cells.js +9 -4
- package/src/lib/components/task-cells.js.map +1 -1
- package/src/lib/components/task-edit-drawer.js +111 -43
- package/src/lib/components/task-edit-drawer.js.map +1 -1
- package/src/lib/components/tasks-bulk-bar.d.ts +0 -3
- package/src/lib/components/tasks-bulk-bar.js +7 -20
- package/src/lib/components/tasks-bulk-bar.js.map +1 -1
- package/src/lib/components/tasks-calendar.d.ts +3 -0
- package/src/lib/components/tasks-calendar.js +8 -1
- package/src/lib/components/tasks-calendar.js.map +1 -1
- package/src/lib/components/tasks-section.d.ts +3 -3
- package/src/lib/components/tasks-section.js +58 -43
- package/src/lib/components/tasks-section.js.map +1 -1
- package/src/lib/constants/api-routes.d.ts +2 -9
- package/src/lib/constants/api-routes.js +1 -7
- package/src/lib/constants/api-routes.js.map +1 -1
- package/src/lib/constants/bundle-common.d.ts +6 -0
- package/src/lib/constants/bundle-common.js +11 -0
- package/src/lib/constants/bundle-common.js.map +1 -1
- package/src/lib/constants/company-filters.d.ts +14 -0
- package/src/lib/constants/company-filters.js +51 -1
- package/src/lib/constants/company-filters.js.map +1 -1
- package/src/lib/constants/contact-filters.d.ts +2 -0
- package/src/lib/constants/contact-filters.js +18 -1
- package/src/lib/constants/contact-filters.js.map +1 -1
- package/src/lib/constants/deal-filters.d.ts +22 -1
- package/src/lib/constants/deal-filters.js +67 -4
- package/src/lib/constants/deal-filters.js.map +1 -1
- package/src/lib/declarations.console-server.d.ts +3 -0
- package/src/lib/declarations.console-server.js +35 -0
- package/src/lib/declarations.console-server.js.map +1 -1
- package/src/lib/declarations.d.ts +26 -0
- package/src/lib/declarations.js +35 -0
- package/src/lib/declarations.js.map +1 -0
- package/src/lib/declarations.server.d.ts +11 -0
- package/src/lib/declarations.server.js +97 -1
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/hooks/use-company-picklists.d.ts +15 -0
- package/src/lib/hooks/use-company-picklists.js +55 -0
- package/src/lib/hooks/use-company-picklists.js.map +1 -0
- package/src/lib/hooks/use-crm-picklist.d.ts +25 -0
- package/src/lib/hooks/use-crm-picklist.js +53 -0
- package/src/lib/hooks/use-crm-picklist.js.map +1 -0
- package/src/lib/hooks/use-crm-record-names.d.ts +16 -0
- package/src/lib/hooks/use-crm-record-names.js +45 -19
- package/src/lib/hooks/use-crm-record-names.js.map +1 -1
- package/src/lib/hooks/use-crm-task-picklists.d.ts +11 -0
- package/src/lib/hooks/use-crm-task-picklists.js +45 -0
- package/src/lib/hooks/use-crm-task-picklists.js.map +1 -0
- package/src/lib/hooks/use-deals.d.ts +14 -0
- package/src/lib/hooks/use-deals.js +29 -0
- package/src/lib/hooks/use-deals.js.map +1 -1
- package/src/lib/hooks/use-lead-picklists.d.ts +14 -0
- package/src/lib/hooks/use-lead-picklists.js +46 -0
- package/src/lib/hooks/use-lead-picklists.js.map +1 -0
- package/src/lib/hooks/use-lead-source-picklist.d.ts +5 -19
- package/src/lib/hooks/use-lead-source-picklist.js +12 -22
- package/src/lib/hooks/use-lead-source-picklist.js.map +1 -1
- package/src/lib/hooks/use-lead-status-picklist.d.ts +9 -0
- package/src/lib/hooks/use-lead-status-picklist.js +40 -0
- package/src/lib/hooks/use-lead-status-picklist.js.map +1 -0
- package/src/lib/model/companies.d.ts +32 -3
- package/src/lib/model/companies.js +133 -16
- package/src/lib/model/companies.js.map +1 -1
- package/src/lib/model/contact-merge.d.ts +27 -3
- package/src/lib/model/contact-merge.js +81 -7
- package/src/lib/model/contact-merge.js.map +1 -1
- package/src/lib/model/contact-record.d.ts +17 -0
- package/src/lib/model/contact-record.js +17 -2
- package/src/lib/model/contact-record.js.map +1 -1
- package/src/lib/model/contact-update.d.ts +31 -2
- package/src/lib/model/contact-update.js +14 -0
- package/src/lib/model/contact-update.js.map +1 -1
- package/src/lib/model/crm-list-query.d.ts +5 -0
- package/src/lib/model/crm-list-query.js +8 -0
- package/src/lib/model/crm-list-query.js.map +1 -1
- package/src/lib/model/crm-next-activity.d.ts +107 -0
- package/src/lib/model/crm-next-activity.js +140 -0
- package/src/lib/model/crm-next-activity.js.map +1 -0
- package/src/lib/model/crm-recipes.d.ts +40 -0
- package/src/lib/model/crm-recipes.js +259 -0
- package/src/lib/model/crm-recipes.js.map +1 -0
- package/src/lib/model/crm-record-counts.d.ts +36 -0
- package/src/lib/model/crm-record-counts.js +54 -0
- package/src/lib/model/crm-record-counts.js.map +1 -0
- package/src/lib/model/crm-record-lists.d.ts +23 -0
- package/src/lib/model/crm-record-lists.js +161 -0
- package/src/lib/model/crm-record-lists.js.map +1 -0
- package/src/lib/model/crm-reports.d.ts +73 -3
- package/src/lib/model/crm-reports.js +120 -1
- package/src/lib/model/crm-reports.js.map +1 -1
- package/src/lib/model/crm-sharing.d.ts +21 -3
- package/src/lib/model/crm-sharing.js +27 -6
- package/src/lib/model/crm-sharing.js.map +1 -1
- package/src/lib/model/crm-task-reminders.d.ts +152 -0
- package/src/lib/model/crm-task-reminders.js +161 -0
- package/src/lib/model/crm-task-reminders.js.map +1 -0
- package/src/lib/model/deal-board-model.d.ts +8 -2
- package/src/lib/model/deal-board-model.js +15 -2
- package/src/lib/model/deal-board-model.js.map +1 -1
- package/src/lib/model/deal-contact-roles.d.ts +45 -0
- package/src/lib/model/deal-contact-roles.js +73 -0
- package/src/lib/model/deal-contact-roles.js.map +1 -0
- package/src/lib/model/deal-form-model.d.ts +56 -0
- package/src/lib/model/deal-form-model.js +79 -7
- package/src/lib/model/deal-form-model.js.map +1 -1
- package/src/lib/model/download-text-file.d.ts +23 -0
- package/src/lib/model/download-text-file.js +34 -0
- package/src/lib/model/download-text-file.js.map +1 -0
- package/src/lib/model/lead-filters.d.ts +36 -2
- package/src/lib/model/lead-filters.js +123 -2
- package/src/lib/model/lead-filters.js.map +1 -1
- package/src/lib/model/lead-source-direction.d.ts +38 -0
- package/src/lib/model/lead-source-direction.js +52 -0
- package/src/lib/model/lead-source-direction.js.map +1 -0
- package/src/lib/model/next-activity.d.ts +1 -1
- package/src/lib/model/next-activity.js.map +1 -1
- package/src/lib/model/picklist-values.d.ts +119 -0
- package/src/lib/model/picklist-values.js +256 -0
- package/src/lib/model/picklist-values.js.map +1 -0
- package/src/lib/model/record-facts-disclosed.d.ts +81 -0
- package/src/lib/model/record-facts-disclosed.js +281 -0
- package/src/lib/model/record-facts-disclosed.js.map +1 -0
- package/src/lib/model/record-facts.d.ts +215 -34
- package/src/lib/model/record-facts.js +307 -128
- package/src/lib/model/record-facts.js.map +1 -1
- package/src/lib/model/task-picklists.d.ts +52 -0
- package/src/lib/model/task-picklists.js +83 -0
- package/src/lib/model/task-picklists.js.map +1 -0
- package/src/lib/model/task-routes.d.ts +13 -0
- package/src/lib/model/task-routes.js +23 -4
- package/src/lib/model/task-routes.js.map +1 -1
- package/src/lib/plan-entitlements.js +6 -4
- package/src/lib/plan-entitlements.js.map +1 -1
- package/src/lib/plugin.js +17 -0
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/server/api-v1/contacts.js +220 -14
- package/src/lib/server/api-v1/contacts.js.map +1 -1
- package/src/lib/server/api-v1/crm-activities.js +14 -1
- package/src/lib/server/api-v1/crm-activities.js.map +1 -1
- package/src/lib/server/api-v1/crm-companies.js +123 -14
- package/src/lib/server/api-v1/crm-companies.js.map +1 -1
- package/src/lib/server/api-v1/crm-deals.js +291 -26
- package/src/lib/server/api-v1/crm-deals.js.map +1 -1
- package/src/lib/server/api-v1/crm-leads.js +144 -38
- package/src/lib/server/api-v1/crm-leads.js.map +1 -1
- package/src/lib/server/api-v1/crm-pipelines.d.ts +6 -0
- package/src/lib/server/api-v1/crm-pipelines.js +8 -2
- package/src/lib/server/api-v1/crm-pipelines.js.map +1 -1
- package/src/lib/server/api-v1/crm-tasks.js +78 -34
- package/src/lib/server/api-v1/crm-tasks.js.map +1 -1
- package/src/lib/server/api-v1/openapi.d.ts +0 -11
- package/src/lib/server/api-v1/openapi.js +171 -16
- package/src/lib/server/api-v1/openapi.js.map +1 -1
- package/src/lib/server/assign-contact-owner.d.ts +188 -0
- package/src/lib/server/assign-contact-owner.js +446 -0
- package/src/lib/server/assign-contact-owner.js.map +1 -0
- package/src/lib/server/associate-company-by-domain.d.ts +70 -0
- package/src/lib/server/associate-company-by-domain.js +153 -0
- package/src/lib/server/associate-company-by-domain.js.map +1 -0
- package/src/lib/server/automation-steps.d.ts +140 -0
- package/src/lib/server/automation-steps.js +669 -0
- package/src/lib/server/automation-steps.js.map +1 -0
- package/src/lib/server/capture-contact.d.ts +17 -0
- package/src/lib/server/capture-contact.js +95 -26
- package/src/lib/server/capture-contact.js.map +1 -1
- package/src/lib/server/capture-host-contact.d.ts +104 -0
- package/src/lib/server/capture-host-contact.js +151 -0
- package/src/lib/server/capture-host-contact.js.map +1 -0
- package/src/lib/server/company-children.d.ts +25 -0
- package/src/lib/server/company-children.js +42 -0
- package/src/lib/server/company-children.js.map +1 -0
- package/src/lib/server/company-delete.d.ts +18 -0
- package/src/lib/server/company-delete.js +44 -21
- package/src/lib/server/company-delete.js.map +1 -1
- package/src/lib/server/contact-email-history.js +21 -19
- package/src/lib/server/contact-email-history.js.map +1 -1
- package/src/lib/server/contact-remove.js +27 -2
- package/src/lib/server/contact-remove.js.map +1 -1
- package/src/lib/server/contact-reports-to.d.ts +61 -0
- package/src/lib/server/contact-reports-to.js +114 -0
- package/src/lib/server/contact-reports-to.js.map +1 -0
- package/src/lib/server/contact-update.d.ts +42 -1
- package/src/lib/server/contact-update.js +204 -23
- package/src/lib/server/contact-update.js.map +1 -1
- package/src/lib/server/convert-host-lead.d.ts +46 -1
- package/src/lib/server/convert-host-lead.js +173 -15
- package/src/lib/server/convert-host-lead.js.map +1 -1
- package/src/lib/server/convert-open-lead.js +12 -5
- package/src/lib/server/convert-open-lead.js.map +1 -1
- package/src/lib/server/crm-email-activity.d.ts +118 -0
- package/src/lib/server/crm-email-activity.js +148 -0
- package/src/lib/server/crm-email-activity.js.map +1 -0
- package/src/lib/server/crm-inbound-email.js +1 -1
- package/src/lib/server/crm-inbound-email.js.map +1 -1
- package/src/lib/server/crm-next-activity.d.ts +74 -0
- package/src/lib/server/crm-next-activity.js +194 -0
- package/src/lib/server/crm-next-activity.js.map +1 -0
- package/src/lib/server/crm-record-indexes.d.ts +45 -0
- package/src/lib/server/crm-record-indexes.js +78 -0
- package/src/lib/server/crm-record-indexes.js.map +1 -0
- package/src/lib/server/crm-sharing.d.ts +9 -1
- package/src/lib/server/crm-sharing.js +23 -3
- package/src/lib/server/crm-sharing.js.map +1 -1
- package/src/lib/server/deal-contact-roles.d.ts +27 -0
- package/src/lib/server/deal-contact-roles.js +89 -0
- package/src/lib/server/deal-contact-roles.js.map +1 -0
- package/src/lib/server/email-send.js +2 -1
- package/src/lib/server/email-send.js.map +1 -1
- package/src/lib/server/lead-convert.d.ts +5 -0
- package/src/lib/server/lead-convert.js +19 -3
- package/src/lib/server/lead-convert.js.map +1 -1
- package/src/lib/server/lead-create.d.ts +17 -2
- package/src/lib/server/lead-create.js +46 -14
- package/src/lib/server/lead-create.js.map +1 -1
- package/src/lib/server/lead-nurturing.d.ts +6 -0
- package/src/lib/server/lead-nurturing.js +57 -20
- package/src/lib/server/lead-nurturing.js.map +1 -1
- package/src/lib/server/lead-picklists.d.ts +35 -0
- package/src/lib/server/lead-picklists.js +52 -0
- package/src/lib/server/lead-picklists.js.map +1 -0
- package/src/lib/server/lead-source-picklist.d.ts +1 -13
- package/src/lib/server/lead-source-picklist.js +6 -33
- package/src/lib/server/lead-source-picklist.js.map +1 -1
- package/src/lib/server/merge-contacts.js +23 -5
- package/src/lib/server/merge-contacts.js.map +1 -1
- package/src/lib/server/next-activity-routes.js +2 -1
- package/src/lib/server/next-activity-routes.js.map +1 -1
- package/src/lib/server/person-eraser.d.ts +53 -0
- package/src/lib/server/person-eraser.js +149 -0
- package/src/lib/server/person-eraser.js.map +1 -0
- package/src/lib/server/person-records.d.ts +69 -0
- package/src/lib/server/person-records.js +317 -0
- package/src/lib/server/person-records.js.map +1 -0
- package/src/lib/server/person-refund.d.ts +97 -0
- package/src/lib/server/person-refund.js +221 -0
- package/src/lib/server/person-refund.js.map +1 -0
- package/src/lib/server/picklist-values.d.ts +21 -0
- package/src/lib/server/picklist-values.js +308 -0
- package/src/lib/server/picklist-values.js.map +1 -0
- package/src/lib/server/read-picklist.d.ts +44 -0
- package/src/lib/server/read-picklist.js +65 -0
- package/src/lib/server/read-picklist.js.map +1 -0
- package/src/lib/server/recipe-routes.js +22 -8
- package/src/lib/server/recipe-routes.js.map +1 -1
- package/src/lib/server/record-email-state.js +7 -1
- package/src/lib/server/record-email-state.js.map +1 -1
- package/src/lib/server/record-facts.d.ts +3 -0
- package/src/lib/server/record-facts.js +233 -31
- package/src/lib/server/record-facts.js.map +1 -1
- package/src/lib/server/record-origin.d.ts +27 -0
- package/src/lib/server/record-origin.js +104 -0
- package/src/lib/server/record-origin.js.map +1 -0
- package/src/lib/server/record-timeline.js +40 -3
- package/src/lib/server/record-timeline.js.map +1 -1
- package/src/lib/server/suite-gate.js +4 -3
- package/src/lib/server/suite-gate.js.map +1 -1
- package/src/lib/server/task-reminders-route.js +2 -1
- package/src/lib/server/task-reminders-route.js.map +1 -1
- package/src/lib/server/task-routes.js +33 -17
- package/src/lib/server/task-routes.js.map +1 -1
- package/src/lib/server-deal-stage.d.ts +5 -1
- package/src/lib/server-deal-stage.js +10 -5
- package/src/lib/server-deal-stage.js.map +1 -1
- package/src/lib/server.d.ts +8 -3
- package/src/lib/server.js +47 -43
- package/src/lib/server.js.map +1 -1
- package/src/lib/testing/memory-firestore.d.ts +55 -0
- package/src/lib/testing/memory-firestore.js +335 -0
- package/src/lib/testing/memory-firestore.js.map +1 -0
- package/src/lib/testing/stand-in-email-send-index.d.ts +25 -0
- package/src/lib/testing/stand-in-email-send-index.js +49 -0
- package/src/lib/testing/stand-in-email-send-index.js.map +1 -0
- package/src/lib/transfer/activities.d.ts +30 -0
- package/src/lib/transfer/activities.js +132 -0
- package/src/lib/transfer/activities.js.map +1 -0
- package/src/lib/transfer/aliases.d.ts +22 -0
- package/src/lib/transfer/aliases.js +1342 -0
- package/src/lib/transfer/aliases.js.map +1 -0
- package/src/lib/transfer/common.d.ts +222 -0
- package/src/lib/transfer/common.js +832 -0
- package/src/lib/transfer/common.js.map +1 -0
- package/src/lib/transfer/companies.d.ts +43 -0
- package/src/lib/transfer/companies.js +549 -0
- package/src/lib/transfer/companies.js.map +1 -0
- package/src/lib/transfer/contacts.d.ts +31 -0
- package/src/lib/transfer/contacts.js +727 -0
- package/src/lib/transfer/contacts.js.map +1 -0
- package/src/lib/transfer/deals.d.ts +66 -0
- package/src/lib/transfer/deals.js +698 -0
- package/src/lib/transfer/deals.js.map +1 -0
- package/src/lib/transfer/email-templates-package.d.ts +40 -0
- package/src/lib/transfer/email-templates-package.js +76 -0
- package/src/lib/transfer/email-templates-package.js.map +1 -0
- package/src/lib/transfer/email-templates-package.server.d.ts +32 -0
- package/src/lib/transfer/email-templates-package.server.js +176 -0
- package/src/lib/transfer/email-templates-package.server.js.map +1 -0
- package/src/lib/transfer/fields.d.ts +102 -0
- package/src/lib/transfer/fields.js +1755 -0
- package/src/lib/transfer/fields.js.map +1 -0
- package/src/lib/transfer/leads.d.ts +30 -0
- package/src/lib/transfer/leads.js +582 -0
- package/src/lib/transfer/leads.js.map +1 -0
- package/src/lib/transfer/pipelines.d.ts +21 -0
- package/src/lib/transfer/pipelines.js +172 -0
- package/src/lib/transfer/pipelines.js.map +1 -0
- package/src/lib/transfer/register.d.ts +47 -0
- package/src/lib/transfer/register.js +277 -0
- package/src/lib/transfer/register.js.map +1 -0
- package/src/lib/transfer/tasks.d.ts +30 -0
- package/src/lib/transfer/tasks.js +418 -0
- package/src/lib/transfer/tasks.js.map +1 -0
- package/src/lib/transfer/ui.d.ts +20 -0
- package/src/lib/transfer/ui.js +42 -0
- package/src/lib/transfer/ui.js.map +1 -0
- package/src/lib/components/company-import-drawer.d.ts +0 -42
- package/src/lib/components/company-import-drawer.js +0 -99
- package/src/lib/components/company-import-drawer.js.map +0 -1
- package/src/lib/components/contact-import-drawer.d.ts +0 -46
- package/src/lib/components/contact-import-drawer.js +0 -149
- package/src/lib/components/contact-import-drawer.js.map +0 -1
- package/src/lib/components/crm-export-all-button.d.ts +0 -39
- package/src/lib/components/crm-export-all-button.js +0 -98
- package/src/lib/components/crm-export-all-button.js.map +0 -1
- package/src/lib/components/csv-import-drawer.d.ts +0 -139
- package/src/lib/components/csv-import-drawer.js +0 -757
- package/src/lib/components/csv-import-drawer.js.map +0 -1
- package/src/lib/components/deal-import-drawer.d.ts +0 -24
- package/src/lib/components/deal-import-drawer.js +0 -83
- package/src/lib/components/deal-import-drawer.js.map +0 -1
- package/src/lib/components/lead-import-drawer.d.ts +0 -27
- package/src/lib/components/lead-import-drawer.js +0 -118
- package/src/lib/components/lead-import-drawer.js.map +0 -1
- package/src/lib/components/lead-source-values-card.d.ts +0 -27
- package/src/lib/components/lead-source-values-card.js.map +0 -1
- package/src/lib/components/task-import-drawer.d.ts +0 -24
- package/src/lib/components/task-import-drawer.js +0 -82
- package/src/lib/components/task-import-drawer.js.map +0 -1
- package/src/lib/model/companies-csv.d.ts +0 -36
- package/src/lib/model/companies-csv.js +0 -38
- package/src/lib/model/companies-csv.js.map +0 -1
- package/src/lib/model/contacts-csv.d.ts +0 -54
- package/src/lib/model/contacts-csv.js +0 -67
- package/src/lib/model/contacts-csv.js.map +0 -1
- package/src/lib/model/crm-company-import.d.ts +0 -154
- package/src/lib/model/crm-company-import.js +0 -331
- package/src/lib/model/crm-company-import.js.map +0 -1
- package/src/lib/model/crm-csv.d.ts +0 -239
- package/src/lib/model/crm-csv.js +0 -467
- package/src/lib/model/crm-csv.js.map +0 -1
- package/src/lib/model/crm-deal-import.d.ts +0 -112
- package/src/lib/model/crm-deal-import.js +0 -263
- package/src/lib/model/crm-deal-import.js.map +0 -1
- package/src/lib/model/crm-import.d.ts +0 -250
- package/src/lib/model/crm-import.js +0 -467
- package/src/lib/model/crm-import.js.map +0 -1
- package/src/lib/model/crm-lead-import.d.ts +0 -138
- package/src/lib/model/crm-lead-import.js +0 -446
- package/src/lib/model/crm-lead-import.js.map +0 -1
- package/src/lib/model/crm-task-import.d.ts +0 -94
- package/src/lib/model/crm-task-import.js +0 -275
- package/src/lib/model/crm-task-import.js.map +0 -1
- package/src/lib/model/deals-csv.d.ts +0 -32
- package/src/lib/model/deals-csv.js +0 -36
- package/src/lib/model/deals-csv.js.map +0 -1
- package/src/lib/model/import-column-shapes.d.ts +0 -36
- package/src/lib/model/import-column-shapes.js +0 -76
- package/src/lib/model/import-column-shapes.js.map +0 -1
- package/src/lib/model/lead-source-values.d.ts +0 -82
- package/src/lib/model/lead-source-values.js +0 -149
- package/src/lib/model/lead-source-values.js.map +0 -1
- package/src/lib/model/leads-csv.d.ts +0 -40
- package/src/lib/model/leads-csv.js +0 -40
- package/src/lib/model/leads-csv.js.map +0 -1
- package/src/lib/model/tasks-csv.d.ts +0 -28
- package/src/lib/model/tasks-csv.js +0 -28
- package/src/lib/model/tasks-csv.js.map +0 -1
- package/src/lib/server/companies-import.d.ts +0 -57
- package/src/lib/server/companies-import.js +0 -242
- package/src/lib/server/companies-import.js.map +0 -1
- package/src/lib/server/contacts-import.d.ts +0 -109
- package/src/lib/server/contacts-import.js +0 -393
- package/src/lib/server/contacts-import.js.map +0 -1
- package/src/lib/server/deals-import.d.ts +0 -76
- package/src/lib/server/deals-import.js +0 -248
- package/src/lib/server/deals-import.js.map +0 -1
- package/src/lib/server/export-route.d.ts +0 -60
- package/src/lib/server/export-route.js +0 -447
- package/src/lib/server/export-route.js.map +0 -1
- package/src/lib/server/import-context.d.ts +0 -87
- package/src/lib/server/import-context.js +0 -182
- package/src/lib/server/import-context.js.map +0 -1
- package/src/lib/server/lead-source-values.d.ts +0 -50
- package/src/lib/server/lead-source-values.js +0 -191
- package/src/lib/server/lead-source-values.js.map +0 -1
- package/src/lib/server/leads-import.d.ts +0 -84
- package/src/lib/server/leads-import.js +0 -367
- package/src/lib/server/leads-import.js.map +0 -1
- package/src/lib/server/tasks-import.d.ts +0 -54
- package/src/lib/server/tasks-import.js +0 -160
- package/src/lib/server/tasks-import.js.map +0 -1
|
@@ -23,6 +23,21 @@ export interface CrmRecordPickerProps {
|
|
|
23
23
|
value: string | null;
|
|
24
24
|
onChange: (id: string | null) => void;
|
|
25
25
|
disabled?: boolean;
|
|
26
|
+
/** The field's label; the record kind's name by default. */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** A record the picker never offers — the record being edited, say. */
|
|
29
|
+
excludeId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The current value's name, when the caller already resolved it — shown
|
|
32
|
+
* instead of the id while the window does not hold the record.
|
|
33
|
+
*/
|
|
34
|
+
valueLabel?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Open the listener only once the menu is first opened, for a picker that
|
|
37
|
+
* sits on a page most readers never change it on.
|
|
38
|
+
*/
|
|
39
|
+
lazy?: boolean;
|
|
40
|
+
helperText?: string;
|
|
26
41
|
}
|
|
27
42
|
/**
|
|
28
43
|
* Link a task to a contact, company or deal by name (AGL-2599).
|
|
@@ -19,7 +19,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
19
19
|
import { useFirestore, useFirestoreCollection } from "@aglyn/tenant-feature-instance";
|
|
20
20
|
import { Autocomplete, TextField } from "@mui/material";
|
|
21
21
|
import { collection, limit, orderBy, query } from "firebase/firestore";
|
|
22
|
-
import { useMemo } from "react";
|
|
22
|
+
import { useMemo, useState } from "react";
|
|
23
23
|
import { CRM_RECORD_COLLECTIONS, crmRecordName } from "../hooks/use-crm-record-names.js";
|
|
24
24
|
import { crmVisibleToClause } from "../hooks/use-crm-scope.js";
|
|
25
25
|
import { contactPrimaryGroup } from "../model/contact-record.js";
|
|
@@ -47,23 +47,27 @@ const PICKER_LABELS = {
|
|
|
47
47
|
* window. The listener opens with the drawer and closes with it.
|
|
48
48
|
*/ export function CrmRecordPicker(props) {
|
|
49
49
|
const { kind, scope, readTokens, groupId, org, value, onChange, disabled } = props;
|
|
50
|
+
const { label, excludeId, valueLabel, lazy = false, helperText } = props;
|
|
50
51
|
const firestore = useFirestore();
|
|
51
|
-
const
|
|
52
|
+
const [opened, setOpened] = useState(!lazy);
|
|
53
|
+
const { data, status } = useFirestoreCollection(()=>scope && opened ? query(collection(firestore, scope[0], scope[1], CRM_RECORD_COLLECTIONS[kind]), ...crmVisibleToClause(readTokens), orderBy('updatedAt', 'desc'), limit(CRM_RECORD_PICKER_LIMIT)) : null, [
|
|
52
54
|
firestore,
|
|
53
55
|
scope,
|
|
54
56
|
readTokens,
|
|
55
|
-
kind
|
|
57
|
+
kind,
|
|
58
|
+
opened
|
|
56
59
|
], {
|
|
57
60
|
idField: '$id'
|
|
58
61
|
});
|
|
59
|
-
const options = useMemo(()=>(data != null ? data : []).map((row)=>({
|
|
62
|
+
const options = useMemo(()=>(data != null ? data : []).filter((row)=>row.$id !== excludeId).map((row)=>({
|
|
60
63
|
id: row.$id,
|
|
61
64
|
label: crmRecordName(kind, row, groupId != null ? groupId : contactPrimaryGroup(row, org).groupId) || row.$id
|
|
62
65
|
})).sort((a, b)=>a.label.localeCompare(b.label)), [
|
|
63
66
|
data,
|
|
64
67
|
kind,
|
|
65
68
|
groupId,
|
|
66
|
-
org
|
|
69
|
+
org,
|
|
70
|
+
excludeId
|
|
67
71
|
]);
|
|
68
72
|
/*
|
|
69
73
|
* The linked record may sit outside the window — an old contact a record
|
|
@@ -74,11 +78,12 @@ const PICKER_LABELS = {
|
|
|
74
78
|
if (!value) return null;
|
|
75
79
|
return (_options_find = options.find((option)=>option.id === value)) != null ? _options_find : {
|
|
76
80
|
id: value,
|
|
77
|
-
label: value
|
|
81
|
+
label: valueLabel || value
|
|
78
82
|
};
|
|
79
83
|
}, [
|
|
80
84
|
options,
|
|
81
|
-
value
|
|
85
|
+
value,
|
|
86
|
+
valueLabel
|
|
82
87
|
]);
|
|
83
88
|
return /*#__PURE__*/ _jsx(Autocomplete, {
|
|
84
89
|
options: options,
|
|
@@ -87,14 +92,15 @@ const PICKER_LABELS = {
|
|
|
87
92
|
var _ref;
|
|
88
93
|
return onChange((_ref = next == null ? void 0 : next.id) != null ? _ref : null);
|
|
89
94
|
},
|
|
95
|
+
onOpen: ()=>setOpened(true),
|
|
90
96
|
getOptionLabel: (option)=>option.label,
|
|
91
97
|
isOptionEqualToValue: (option, current)=>option.id === current.id,
|
|
92
|
-
loading: status === 'loading',
|
|
98
|
+
loading: opened && status === 'loading',
|
|
93
99
|
disabled: disabled,
|
|
94
100
|
size: "small",
|
|
95
101
|
renderInput: (params)=>/*#__PURE__*/ _jsx(TextField, _extends({}, params, {
|
|
96
|
-
label: PICKER_LABELS[kind],
|
|
97
|
-
helperText: options.length >= CRM_RECORD_PICKER_LIMIT ? `The ${CRM_RECORD_PICKER_LIMIT} most recently updated — type to narrow.` :
|
|
102
|
+
label: label != null ? label : PICKER_LABELS[kind],
|
|
103
|
+
helperText: options.length >= CRM_RECORD_PICKER_LIMIT ? `The ${CRM_RECORD_PICKER_LIMIT} most recently updated — type to narrow.` : helperText
|
|
98
104
|
}))
|
|
99
105
|
});
|
|
100
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/crm-record-picker.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 {\n useFirestore,\n useFirestoreCollection,\n} from '@aglyn/tenant-feature-instance'\nimport { Autocomplete, TextField } from '@mui/material'\nimport { collection, limit, orderBy, query } from 'firebase/firestore'\nimport { useMemo } from 'react'\nimport {\n CRM_RECORD_COLLECTIONS,\n type CrmRecordKind,\n crmRecordName,\n} from '../hooks/use-crm-record-names'\nimport { crmVisibleToClause } from '../hooks/use-crm-scope'\nimport { contactPrimaryGroup } from '../model/contact-record'\n\n/**\n * How many records a picker offers. The window is the hundred most recently\n * touched, which is the hundred a person is most likely to be making a task\n * about; the field says so, and the record pages' own \"New task\" buttons\n * arrive with the record already linked, which is how a task about an older\n * one gets made.\n */\nexport const CRM_RECORD_PICKER_LIMIT = 100\n\nconst PICKER_LABELS: Record<CrmRecordKind, string> = {\n contact: 'Contact',\n company: 'Company',\n deal: 'Deal',\n}\n\nexport interface CrmRecordPickerProps {\n kind: CrmRecordKind\n scope: readonly [string, string] | null\n /** The reader's tokens, or `null` at the organization level — no clause (AGL-2630). */\n readTokens: readonly string[] | null\n /**\n * The viewing group, for a contact's facet name — or `null` at the\n * organization level, where each contact is named through its own\n * primary holder (`contactPrimaryGroup`), resolved from {@link org}.\n */\n groupId: string | null\n /** The org document, for the per-contact holder when {@link groupId} is null. */\n org?: Record<string, unknown> | null\n value: string | null\n onChange: (id: string | null) => void\n disabled?: boolean\n}\n\n/**\n * Link a task to a contact, company or deal by name (AGL-2599).\n *\n * One query shape for all three kinds — the most recently updated hundred\n * visible to this site, filtered as the person types — because that is the\n * one shape every CRM collection has an index for (`visibleTo, updatedAt`).\n * A prefix search on the stored name would need `(visibleTo, nameLower)`,\n * which companies have and contacts do not, and a picker that searched two\n * kinds properly and one kind not at all would be worse to explain than a\n * window. The listener opens with the drawer and closes with it.\n */\nexport function CrmRecordPicker(props: CrmRecordPickerProps) {\n const { kind, scope, readTokens, groupId, org, value, onChange, disabled } = props\n const firestore = useFirestore()\n const { data, status } = useFirestoreCollection<Record<string, unknown> & { $id: string }>(\n () =>\n scope\n ? query(\n collection(firestore, scope[0], scope[1], CRM_RECORD_COLLECTIONS[kind]),\n ...crmVisibleToClause(readTokens),\n orderBy('updatedAt', 'desc'),\n limit(CRM_RECORD_PICKER_LIMIT),\n )\n : null,\n [firestore, scope, readTokens, kind],\n { idField: '$id' },\n )\n const options = useMemo(\n () =>\n (data ?? [])\n .map((row) => ({\n id: row.$id,\n label:\n crmRecordName(\n kind,\n row,\n groupId ?? contactPrimaryGroup(row, org).groupId,\n ) || row.$id,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)),\n [data, kind, groupId, org],\n )\n /*\n * The linked record may sit outside the window — an old contact a record\n * page's button linked — so the value is a placeholder carrying its id\n * until (unless) the window turns out to hold it.\n */\n const selected = useMemo(() => {\n if (!value) return null\n return options.find((option) => option.id === value) ?? { id: value, label: value }\n }, [options, value])\n\n return (\n <Autocomplete\n options={options}\n value={selected}\n onChange={(_event, next) => onChange(next?.id ?? null)}\n getOptionLabel={(option) => option.label}\n isOptionEqualToValue={(option, current) => option.id === current.id}\n loading={status === 'loading'}\n disabled={disabled}\n size=\"small\"\n renderInput={(params) => (\n <TextField\n {...params}\n label={PICKER_LABELS[kind]}\n helperText={\n options.length >= CRM_RECORD_PICKER_LIMIT\n ? `The ${CRM_RECORD_PICKER_LIMIT} most recently updated — type to narrow.`\n :
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/crm-record-picker.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 {\n useFirestore,\n useFirestoreCollection,\n} from '@aglyn/tenant-feature-instance'\nimport { Autocomplete, TextField } from '@mui/material'\nimport { collection, limit, orderBy, query } from 'firebase/firestore'\nimport { useMemo, useState } from 'react'\nimport {\n CRM_RECORD_COLLECTIONS,\n type CrmRecordKind,\n crmRecordName,\n} from '../hooks/use-crm-record-names'\nimport { crmVisibleToClause } from '../hooks/use-crm-scope'\nimport { contactPrimaryGroup } from '../model/contact-record'\n\n/**\n * How many records a picker offers. The window is the hundred most recently\n * touched, which is the hundred a person is most likely to be making a task\n * about; the field says so, and the record pages' own \"New task\" buttons\n * arrive with the record already linked, which is how a task about an older\n * one gets made.\n */\nexport const CRM_RECORD_PICKER_LIMIT = 100\n\nconst PICKER_LABELS: Record<CrmRecordKind, string> = {\n contact: 'Contact',\n company: 'Company',\n deal: 'Deal',\n}\n\nexport interface CrmRecordPickerProps {\n kind: CrmRecordKind\n scope: readonly [string, string] | null\n /** The reader's tokens, or `null` at the organization level — no clause (AGL-2630). */\n readTokens: readonly string[] | null\n /**\n * The viewing group, for a contact's facet name — or `null` at the\n * organization level, where each contact is named through its own\n * primary holder (`contactPrimaryGroup`), resolved from {@link org}.\n */\n groupId: string | null\n /** The org document, for the per-contact holder when {@link groupId} is null. */\n org?: Record<string, unknown> | null\n value: string | null\n onChange: (id: string | null) => void\n disabled?: boolean\n /** The field's label; the record kind's name by default. */\n label?: string\n /** A record the picker never offers — the record being edited, say. */\n excludeId?: string\n /**\n * The current value's name, when the caller already resolved it — shown\n * instead of the id while the window does not hold the record.\n */\n valueLabel?: string\n /**\n * Open the listener only once the menu is first opened, for a picker that\n * sits on a page most readers never change it on.\n */\n lazy?: boolean\n helperText?: string\n}\n\n/**\n * Link a task to a contact, company or deal by name (AGL-2599).\n *\n * One query shape for all three kinds — the most recently updated hundred\n * visible to this site, filtered as the person types — because that is the\n * one shape every CRM collection has an index for (`visibleTo, updatedAt`).\n * A prefix search on the stored name would need `(visibleTo, nameLower)`,\n * which companies have and contacts do not, and a picker that searched two\n * kinds properly and one kind not at all would be worse to explain than a\n * window. The listener opens with the drawer and closes with it.\n */\nexport function CrmRecordPicker(props: CrmRecordPickerProps) {\n const { kind, scope, readTokens, groupId, org, value, onChange, disabled } = props\n const { label, excludeId, valueLabel, lazy = false, helperText } = props\n const firestore = useFirestore()\n const [opened, setOpened] = useState(!lazy)\n const { data, status } = useFirestoreCollection<Record<string, unknown> & { $id: string }>(\n () =>\n scope && opened\n ? query(\n collection(firestore, scope[0], scope[1], CRM_RECORD_COLLECTIONS[kind]),\n ...crmVisibleToClause(readTokens),\n orderBy('updatedAt', 'desc'),\n limit(CRM_RECORD_PICKER_LIMIT),\n )\n : null,\n [firestore, scope, readTokens, kind, opened],\n { idField: '$id' },\n )\n const options = useMemo(\n () =>\n (data ?? [])\n .filter((row) => row.$id !== excludeId)\n .map((row) => ({\n id: row.$id,\n label:\n crmRecordName(\n kind,\n row,\n groupId ?? contactPrimaryGroup(row, org).groupId,\n ) || row.$id,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)),\n [data, kind, groupId, org, excludeId],\n )\n /*\n * The linked record may sit outside the window — an old contact a record\n * page's button linked — so the value is a placeholder carrying its id\n * until (unless) the window turns out to hold it.\n */\n const selected = useMemo(() => {\n if (!value) return null\n return (\n options.find((option) => option.id === value) ?? { id: value, label: valueLabel || value }\n )\n }, [options, value, valueLabel])\n\n return (\n <Autocomplete\n options={options}\n value={selected}\n onChange={(_event, next) => onChange(next?.id ?? null)}\n onOpen={() => setOpened(true)}\n getOptionLabel={(option) => option.label}\n isOptionEqualToValue={(option, current) => option.id === current.id}\n loading={opened && status === 'loading'}\n disabled={disabled}\n size=\"small\"\n renderInput={(params) => (\n <TextField\n {...params}\n label={label ?? PICKER_LABELS[kind]}\n helperText={\n options.length >= CRM_RECORD_PICKER_LIMIT\n ? `The ${CRM_RECORD_PICKER_LIMIT} most recently updated — type to narrow.`\n : helperText\n }\n />\n )}\n />\n )\n}\nCrmRecordPicker.displayName = 'CrmRecordPicker'\n\nexport default CrmRecordPicker\n"],"names":["useFirestore","useFirestoreCollection","Autocomplete","TextField","collection","limit","orderBy","query","useMemo","useState","CRM_RECORD_COLLECTIONS","crmRecordName","crmVisibleToClause","contactPrimaryGroup","CRM_RECORD_PICKER_LIMIT","PICKER_LABELS","contact","company","deal","CrmRecordPicker","props","kind","scope","readTokens","groupId","org","value","onChange","disabled","label","excludeId","valueLabel","lazy","helperText","firestore","opened","setOpened","data","status","idField","options","filter","row","$id","map","id","sort","a","b","localeCompare","selected","find","option","_event","next","onOpen","getOptionLabel","isOptionEqualToValue","current","loading","size","renderInput","params","length","displayName"],"mappings":"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"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
*/
|
|
17
|
+
import type { ListQueryPlan } from '@aglyn/shared-ui-jsx/const/list-query-plan';
|
|
18
|
+
/** A list's served query as an export's filter: its predicates and its order, dates kept as dates. */
|
|
19
|
+
export declare function crmExportFilterOf(plan: Pick<ListQueryPlan, 'filters' | 'orderBy'>): Record<string, unknown>;
|
|
20
|
+
export interface CrmImportButtonProps {
|
|
21
|
+
/** The resource key the CRM declared (`crm.contacts`). */
|
|
22
|
+
resource: string;
|
|
23
|
+
/** What one batch is called in a sentence ("contacts"). */
|
|
24
|
+
noun: string;
|
|
25
|
+
/** The site the list is read under, or `null` at the organization level. */
|
|
26
|
+
hostId: string | null;
|
|
27
|
+
/** What the `importMapping` zone's widgets know the file as (`contacts`). */
|
|
28
|
+
mappingZone?: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Opens the import wizard on a CRM resource, under the list's site or one the reader picks. */
|
|
32
|
+
export declare function CrmImportButton(props: CrmImportButtonProps): import("react").JSX.Element;
|
|
33
|
+
export declare namespace CrmImportButton {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CrmExportButtonProps {
|
|
37
|
+
resource: string;
|
|
38
|
+
/** The site the list is read under, or `null` at the organization level. */
|
|
39
|
+
hostId: string | null;
|
|
40
|
+
/** The rows the reader ticked; the dialog offers exporting just these. */
|
|
41
|
+
selection?: readonly string[];
|
|
42
|
+
/** The list's filter, when one is applied: a name for it and its served query. */
|
|
43
|
+
filter?: {
|
|
44
|
+
label: string;
|
|
45
|
+
plan: Pick<ListQueryPlan, 'filters' | 'orderBy'>;
|
|
46
|
+
} | null;
|
|
47
|
+
label?: string;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/** Opens the export dialog on a CRM resource: the selection, the list's filter, or every record. */
|
|
51
|
+
export declare function CrmExportButton(props: CrmExportButtonProps): import("react").JSX.Element;
|
|
52
|
+
export declare namespace CrmExportButton {
|
|
53
|
+
var displayName: string;
|
|
54
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
/*==========================================
|
|
20
|
+
* IMPORT AND EXPORT, FROM ANY CRM LIST (AGL-3527).
|
|
21
|
+
*
|
|
22
|
+
* The CRM never draws the wizard or the dialog itself: the console does,
|
|
23
|
+
* and hands the plugin a launcher (`useTransferLauncher`). These buttons are
|
|
24
|
+
* all a list needs — Import opens the wizard on the list's resource, Export
|
|
25
|
+
* the field-picking dialog on its selection, its filter or everything.
|
|
26
|
+
* Outside the console shell there is no launcher, and no button.
|
|
27
|
+
*
|
|
28
|
+
* At the organization level an import is filed under a site, as every CRM
|
|
29
|
+
* create is (AGL-2630): with one site it is that one, with several the
|
|
30
|
+
* button asks first, remembering the pick for the session like every other
|
|
31
|
+
* create.
|
|
32
|
+
*=========================================*/ import { TransferResumeImport } from "@aglyn/aglyn/app-utils/transfer-resume-import";
|
|
33
|
+
import { useTransferLauncher } from "@aglyn/aglyn/app-utils/transfer-launcher-context";
|
|
34
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Typography } from "@mui/material";
|
|
35
|
+
import { useState } from "react";
|
|
36
|
+
import { useCrmOrgMount } from "../hooks/use-crm-org-mount.js";
|
|
37
|
+
import { CrmSitePicker } from "./crm-site-picker.js";
|
|
38
|
+
/** A list's served query as an export's filter: its predicates and its order, dates kept as dates. */ export function crmExportFilterOf(plan) {
|
|
39
|
+
const value = (raw)=>raw instanceof Date ? {
|
|
40
|
+
$date: raw.toISOString()
|
|
41
|
+
} : Array.isArray(raw) ? raw.map(value) : raw;
|
|
42
|
+
return {
|
|
43
|
+
filters: plan.filters.map((filter)=>({
|
|
44
|
+
path: filter.path,
|
|
45
|
+
op: filter.op,
|
|
46
|
+
value: value(filter.value)
|
|
47
|
+
})),
|
|
48
|
+
orderBy: {
|
|
49
|
+
path: plan.orderBy.path,
|
|
50
|
+
direction: plan.orderBy.direction
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** Opens the import wizard on a CRM resource, under the list's site or one the reader picks. */ export function CrmImportButton(props) {
|
|
55
|
+
var _ref;
|
|
56
|
+
const { resource, noun, hostId, mappingZone, label = 'Import' } = props;
|
|
57
|
+
const transfer = useTransferLauncher();
|
|
58
|
+
const mount = useCrmOrgMount();
|
|
59
|
+
const [asking, setAsking] = useState(false);
|
|
60
|
+
// Importing needs "Manage data" (AGL-3546); a reader sees no Import.
|
|
61
|
+
if (!(transfer == null ? void 0 : transfer.can('import', {
|
|
62
|
+
resource,
|
|
63
|
+
scope: 'org',
|
|
64
|
+
hostId
|
|
65
|
+
}))) return null;
|
|
66
|
+
const open = (site)=>transfer.openImport(_extends({
|
|
67
|
+
resource,
|
|
68
|
+
scope: 'org',
|
|
69
|
+
hostId: site
|
|
70
|
+
}, mappingZone ? {
|
|
71
|
+
mappingZone
|
|
72
|
+
} : {}));
|
|
73
|
+
const site = (_ref = hostId != null ? hostId : mount == null ? void 0 : mount.createHostId) != null ? _ref : null;
|
|
74
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
75
|
+
children: [
|
|
76
|
+
/*#__PURE__*/ _jsx(TransferResumeImport, {
|
|
77
|
+
target: {
|
|
78
|
+
resource,
|
|
79
|
+
scope: 'org',
|
|
80
|
+
hostId
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
84
|
+
size: "small",
|
|
85
|
+
onClick: ()=>{
|
|
86
|
+
if (site && (hostId || (mount == null ? void 0 : mount.hostsReady) && mount.hosts.length === 1)) open(site);
|
|
87
|
+
else setAsking(true);
|
|
88
|
+
},
|
|
89
|
+
children: label
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ _jsxs(Dialog, {
|
|
92
|
+
open: asking,
|
|
93
|
+
onClose: ()=>setAsking(false),
|
|
94
|
+
"aria-labelledby": `${resource}-import-site`,
|
|
95
|
+
children: [
|
|
96
|
+
/*#__PURE__*/ _jsx(DialogTitle, {
|
|
97
|
+
id: `${resource}-import-site`,
|
|
98
|
+
children: `Import ${noun}`
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ _jsxs(DialogContent, {
|
|
101
|
+
children: [
|
|
102
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
103
|
+
variant: "body2",
|
|
104
|
+
color: "text.secondary",
|
|
105
|
+
sx: {
|
|
106
|
+
mb: 2
|
|
107
|
+
},
|
|
108
|
+
children: `Every new record is filed under a site — it decides which of your sites may see the ${noun}.`
|
|
109
|
+
}),
|
|
110
|
+
/*#__PURE__*/ _jsx(CrmSitePicker, {
|
|
111
|
+
hostId: null,
|
|
112
|
+
helperText: `The site these ${noun} are imported into.`
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
}),
|
|
116
|
+
/*#__PURE__*/ _jsxs(DialogActions, {
|
|
117
|
+
children: [
|
|
118
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
119
|
+
onClick: ()=>setAsking(false),
|
|
120
|
+
children: 'Cancel'
|
|
121
|
+
}),
|
|
122
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
123
|
+
variant: "contained",
|
|
124
|
+
disabled: !(mount == null ? void 0 : mount.createHostId),
|
|
125
|
+
onClick: ()=>{
|
|
126
|
+
setAsking(false);
|
|
127
|
+
if (mount == null ? void 0 : mount.createHostId) open(mount.createHostId);
|
|
128
|
+
},
|
|
129
|
+
children: 'Continue'
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
CrmImportButton.displayName = 'CrmImportButton';
|
|
139
|
+
/** Opens the export dialog on a CRM resource: the selection, the list's filter, or every record. */ export function CrmExportButton(props) {
|
|
140
|
+
const { resource, hostId, selection, filter, label = 'Export…', disabled } = props;
|
|
141
|
+
const transfer = useTransferLauncher();
|
|
142
|
+
if (!(transfer == null ? void 0 : transfer.can('export', {
|
|
143
|
+
resource,
|
|
144
|
+
scope: 'org',
|
|
145
|
+
hostId
|
|
146
|
+
}))) return null;
|
|
147
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
148
|
+
size: "small",
|
|
149
|
+
disabled: disabled,
|
|
150
|
+
onClick: ()=>transfer.openExport(_extends({
|
|
151
|
+
resource,
|
|
152
|
+
scope: 'org',
|
|
153
|
+
hostId
|
|
154
|
+
}, (selection == null ? void 0 : selection.length) ? {
|
|
155
|
+
selection
|
|
156
|
+
} : {}, filter ? {
|
|
157
|
+
filter: {
|
|
158
|
+
label: filter.label,
|
|
159
|
+
value: crmExportFilterOf(filter.plan)
|
|
160
|
+
}
|
|
161
|
+
} : {})),
|
|
162
|
+
children: label
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
CrmExportButton.displayName = 'CrmExportButton';
|
|
166
|
+
|
|
167
|
+
//# sourceMappingURL=crm-transfer-buttons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/crm-transfer-buttons.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\n'use client'\n\n/*==========================================\n * IMPORT AND EXPORT, FROM ANY CRM LIST (AGL-3527).\n *\n * The CRM never draws the wizard or the dialog itself: the console does,\n * and hands the plugin a launcher (`useTransferLauncher`). These buttons are\n * all a list needs — Import opens the wizard on the list's resource, Export\n * the field-picking dialog on its selection, its filter or everything.\n * Outside the console shell there is no launcher, and no button.\n *\n * At the organization level an import is filed under a site, as every CRM\n * create is (AGL-2630): with one site it is that one, with several the\n * button asks first, remembering the pick for the session like every other\n * create.\n *=========================================*/\n\nimport { TransferResumeImport } from '@aglyn/aglyn/app-utils/transfer-resume-import'\nimport { useTransferLauncher } from '@aglyn/aglyn/app-utils/transfer-launcher-context'\nimport type { ListQueryPlan } from '@aglyn/shared-ui-jsx/const/list-query-plan'\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Typography,\n} from '@mui/material'\nimport { useState } from 'react'\nimport { useCrmOrgMount } from '../hooks/use-crm-org-mount'\nimport { CrmSitePicker } from './crm-site-picker'\n\n/** A list's served query as an export's filter: its predicates and its order, dates kept as dates. */\nexport function crmExportFilterOf(plan: Pick<ListQueryPlan, 'filters' | 'orderBy'>): Record<string, unknown> {\n const value = (raw: unknown): unknown =>\n raw instanceof Date ? { $date: raw.toISOString() } : Array.isArray(raw) ? raw.map(value) : raw\n return {\n filters: plan.filters.map((filter) => ({ path: filter.path, op: filter.op, value: value(filter.value) })),\n orderBy: { path: plan.orderBy.path, direction: plan.orderBy.direction },\n }\n}\n\nexport interface CrmImportButtonProps {\n /** The resource key the CRM declared (`crm.contacts`). */\n resource: string\n /** What one batch is called in a sentence (\"contacts\"). */\n noun: string\n /** The site the list is read under, or `null` at the organization level. */\n hostId: string | null\n /** What the `importMapping` zone's widgets know the file as (`contacts`). */\n mappingZone?: string\n label?: string\n}\n\n/** Opens the import wizard on a CRM resource, under the list's site or one the reader picks. */\nexport function CrmImportButton(props: CrmImportButtonProps) {\n const { resource, noun, hostId, mappingZone, label = 'Import' } = props\n const transfer = useTransferLauncher()\n const mount = useCrmOrgMount()\n const [asking, setAsking] = useState(false)\n // Importing needs \"Manage data\" (AGL-3546); a reader sees no Import.\n if (!transfer?.can('import', { resource, scope: 'org', hostId })) return null\n\n const open = (site: string) =>\n transfer.openImport({ resource, scope: 'org', hostId: site, ...(mappingZone ? { mappingZone } : {}) })\n\n const site = hostId ?? mount?.createHostId ?? null\n return (\n <>\n {/* An import left unfinished, reopened where it stopped (AGL-3549). */}\n <TransferResumeImport target={{ resource, scope: 'org', hostId }} />\n <Button\n size=\"small\"\n onClick={() => {\n if (site && (hostId || (mount?.hostsReady && mount.hosts.length === 1))) open(site)\n else setAsking(true)\n }}\n >\n {label}\n </Button>\n <Dialog open={asking} onClose={() => setAsking(false)} aria-labelledby={`${resource}-import-site`}>\n <DialogTitle id={`${resource}-import-site`}>{`Import ${noun}`}</DialogTitle>\n <DialogContent>\n <Typography variant=\"body2\" color=\"text.secondary\" sx={{ mb: 2 }}>\n {`Every new record is filed under a site — it decides which of your sites may see the ${noun}.`}\n </Typography>\n <CrmSitePicker hostId={null} helperText={`The site these ${noun} are imported into.`} />\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setAsking(false)}>{'Cancel'}</Button>\n <Button\n variant=\"contained\"\n disabled={!mount?.createHostId}\n onClick={() => {\n setAsking(false)\n if (mount?.createHostId) open(mount.createHostId)\n }}\n >\n {'Continue'}\n </Button>\n </DialogActions>\n </Dialog>\n </>\n )\n}\nCrmImportButton.displayName = 'CrmImportButton'\n\nexport interface CrmExportButtonProps {\n resource: string\n /** The site the list is read under, or `null` at the organization level. */\n hostId: string | null\n /** The rows the reader ticked; the dialog offers exporting just these. */\n selection?: readonly string[]\n /** The list's filter, when one is applied: a name for it and its served query. */\n filter?: { label: string; plan: Pick<ListQueryPlan, 'filters' | 'orderBy'> } | null\n label?: string\n disabled?: boolean\n}\n\n/** Opens the export dialog on a CRM resource: the selection, the list's filter, or every record. */\nexport function CrmExportButton(props: CrmExportButtonProps) {\n const { resource, hostId, selection, filter, label = 'Export…', disabled } = props\n const transfer = useTransferLauncher()\n if (!transfer?.can('export', { resource, scope: 'org', hostId })) return null\n return (\n <Button\n size=\"small\"\n disabled={disabled}\n onClick={() =>\n transfer.openExport({\n resource,\n scope: 'org',\n hostId,\n ...(selection?.length ? { selection } : {}),\n ...(filter ? { filter: { label: filter.label, value: crmExportFilterOf(filter.plan) } } : {}),\n })\n }\n >\n {label}\n </Button>\n )\n}\nCrmExportButton.displayName = 'CrmExportButton'\n"],"names":["TransferResumeImport","useTransferLauncher","Button","Dialog","DialogActions","DialogContent","DialogTitle","Typography","useState","useCrmOrgMount","CrmSitePicker","crmExportFilterOf","plan","value","raw","Date","$date","toISOString","Array","isArray","map","filters","filter","path","op","orderBy","direction","CrmImportButton","props","hostId","resource","noun","mappingZone","label","transfer","mount","asking","setAsking","can","scope","open","site","openImport","createHostId","target","size","onClick","hostsReady","hosts","length","onClose","aria-labelledby","id","variant","color","sx","mb","helperText","disabled","displayName","CrmExportButton","selection","openExport"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;AAEA;;;;;;;;;;;;;2CAa2C,GAE3C,SAASA,oBAAoB,QAAQ,gDAA+C;AACpF,SAASC,mBAAmB,QAAQ,mDAAkD;AAEtF,SACEC,MAAM,EACNC,MAAM,EACNC,aAAa,EACbC,aAAa,EACbC,WAAW,EACXC,UAAU,QACL,gBAAe;AACtB,SAASC,QAAQ,QAAQ,QAAO;AAChC,SAASC,cAAc,QAAQ,gCAA4B;AAC3D,SAASC,aAAa,QAAQ,uBAAmB;AAEjD,oGAAoG,GACpG,OAAO,SAASC,kBAAkBC,IAAgD;IAChF,MAAMC,QAAQ,CAACC,MACbA,eAAeC,OAAO;YAAEC,OAAOF,IAAIG,WAAW;QAAG,IAAIC,MAAMC,OAAO,CAACL,OAAOA,IAAIM,GAAG,CAACP,SAASC;IAC7F,OAAO;QACLO,SAAST,KAAKS,OAAO,CAACD,GAAG,CAAC,CAACE,SAAY,CAAA;gBAAEC,MAAMD,OAAOC,IAAI;gBAAEC,IAAIF,OAAOE,EAAE;gBAAEX,OAAOA,MAAMS,OAAOT,KAAK;YAAE,CAAA;QACtGY,SAAS;YAAEF,MAAMX,KAAKa,OAAO,CAACF,IAAI;YAAEG,WAAWd,KAAKa,OAAO,CAACC,SAAS;QAAC;IACxE;AACF;AAcA,8FAA8F,GAC9F,OAAO,SAASC,gBAAgBC,KAA2B;QAW5CC;IAVb,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAEF,MAAM,EAAEG,WAAW,EAAEC,QAAQ,QAAQ,EAAE,GAAGL;IAClE,MAAMM,WAAWjC;IACjB,MAAMkC,QAAQ1B;IACd,MAAM,CAAC2B,QAAQC,UAAU,GAAG7B,SAAS;IACrC,qEAAqE;IACrE,IAAI,EAAC0B,4BAAAA,SAAUI,GAAG,CAAC,UAAU;QAAER;QAAUS,OAAO;QAAOV;IAAO,KAAI,OAAO;IAEzE,MAAMW,OAAO,CAACC,OACZP,SAASQ,UAAU,CAAC;YAAEZ;YAAUS,OAAO;YAAOV,QAAQY;WAAUT,cAAc;YAAEA;QAAY,IAAI,CAAC;IAEnG,MAAMS,QAAOZ,OAAAA,iBAAAA,SAAUM,yBAAAA,MAAOQ,YAAY,YAA7Bd,OAAiC;IAC9C,qBACE;;0BAEE,KAAC7B;gBAAqB4C,QAAQ;oBAAEd;oBAAUS,OAAO;oBAAOV;gBAAO;;0BAC/D,KAAC3B;gBACC2C,MAAK;gBACLC,SAAS;oBACP,IAAIL,QAASZ,CAAAA,UAAWM,CAAAA,yBAAAA,MAAOY,UAAU,KAAIZ,MAAMa,KAAK,CAACC,MAAM,KAAK,CAAC,GAAIT,KAAKC;yBACzEJ,UAAU;gBACjB;0BAECJ;;0BAEH,MAAC9B;gBAAOqC,MAAMJ;gBAAQc,SAAS,IAAMb,UAAU;gBAAQc,mBAAiB,GAAGrB,SAAS,YAAY,CAAC;;kCAC/F,KAACxB;wBAAY8C,IAAI,GAAGtB,SAAS,YAAY,CAAC;kCAAG,CAAC,OAAO,EAAEC,MAAM;;kCAC7D,MAAC1B;;0CACC,KAACE;gCAAW8C,SAAQ;gCAAQC,OAAM;gCAAiBC,IAAI;oCAAEC,IAAI;gCAAE;0CAC5D,CAAC,oFAAoF,EAAEzB,KAAK,CAAC,CAAC;;0CAEjG,KAACrB;gCAAcmB,QAAQ;gCAAM4B,YAAY,CAAC,eAAe,EAAE1B,KAAK,mBAAmB,CAAC;;;;kCAEtF,MAAC3B;;0CACC,KAACF;gCAAO4C,SAAS,IAAMT,UAAU;0CAAS;;0CAC1C,KAACnC;gCACCmD,SAAQ;gCACRK,UAAU,EAACvB,yBAAAA,MAAOQ,YAAY;gCAC9BG,SAAS;oCACPT,UAAU;oCACV,IAAIF,yBAAAA,MAAOQ,YAAY,EAAEH,KAAKL,MAAMQ,YAAY;gCAClD;0CAEC;;;;;;;;AAMb;AACAhB,gBAAgBgC,WAAW,GAAG;AAc9B,kGAAkG,GAClG,OAAO,SAASC,gBAAgBhC,KAA2B;IACzD,MAAM,EAAEE,QAAQ,EAAED,MAAM,EAAEgC,SAAS,EAAEvC,MAAM,EAAEW,QAAQ,SAAS,EAAEyB,QAAQ,EAAE,GAAG9B;IAC7E,MAAMM,WAAWjC;IACjB,IAAI,EAACiC,4BAAAA,SAAUI,GAAG,CAAC,UAAU;QAAER;QAAUS,OAAO;QAAOV;IAAO,KAAI,OAAO;IACzE,qBACE,KAAC3B;QACC2C,MAAK;QACLa,UAAUA;QACVZ,SAAS,IACPZ,SAAS4B,UAAU,CAAC;gBAClBhC;gBACAS,OAAO;gBACPV;eACIgC,CAAAA,6BAAAA,UAAWZ,MAAM,IAAG;gBAAEY;YAAU,IAAI,CAAC,GACrCvC,SAAS;gBAAEA,QAAQ;oBAAEW,OAAOX,OAAOW,KAAK;oBAAEpB,OAAOF,kBAAkBW,OAAOV,IAAI;gBAAE;YAAE,IAAI,CAAC;kBAI9FqB;;AAGP;AACA2B,gBAAgBD,WAAW,GAAG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
*/
|
|
17
|
+
import { type CrmOrgDoc } from '../hooks/use-crm-scope';
|
|
18
|
+
import type { CrmRoutes } from '../model/crm-routes';
|
|
19
|
+
import type { DealDoc } from '../model/deal-board-model';
|
|
20
|
+
export interface DealContactRolesCardProps {
|
|
21
|
+
deal: DealDoc;
|
|
22
|
+
/** The site the page is read under, or `null` at the organization level. */
|
|
23
|
+
hostId: string | null;
|
|
24
|
+
org: CrmOrgDoc;
|
|
25
|
+
routes: CrmRoutes;
|
|
26
|
+
/** The listener's verdict on the deal, for the stale-seed guard. */
|
|
27
|
+
fromCache: boolean;
|
|
28
|
+
unreadable: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Salesforce's Opportunity Contact Roles on a deal's page (AGL-3521): the
|
|
32
|
+
* people on the deal, the part each plays, and which one is Primary.
|
|
33
|
+
*
|
|
34
|
+
* Every edit is one client-direct write of the whole list beside the
|
|
35
|
+
* `contactId` its Primary names — the field every reader that came before
|
|
36
|
+
* roles still reads — and the list fields a contact's page finds the deal
|
|
37
|
+
* by. A role is one of the org's `opportunityContactRole` values, kept on
|
|
38
|
+
* the Deals tab of Fields; a contact keeps the role it holds even once that
|
|
39
|
+
* value is deactivated. Adding opens a dialog rather than a row of fields
|
|
40
|
+
* above the list.
|
|
41
|
+
*/
|
|
42
|
+
export declare function DealContactRolesCard(props: DealContactRolesCardProps): import("react").JSX.Element;
|
|
43
|
+
export declare namespace DealContactRolesCard {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
export default DealContactRolesCard;
|