@open-mercato/core 0.7.0 → 0.7.1-develop.7103.1.41ff100d93
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/.turbo/turbo-build.log +1 -1
- package/dist/helpers/integration/api.js +13 -1
- package/dist/helpers/integration/api.js.map +2 -2
- package/dist/helpers/integration/communicationChannelsFixtures.js +19 -0
- package/dist/helpers/integration/communicationChannelsFixtures.js.map +2 -2
- package/dist/modules/api_keys/api/keys/route.js +1 -1
- package/dist/modules/api_keys/api/keys/route.js.map +2 -2
- package/dist/modules/api_keys/backend/api-keys/page.js +3 -1
- package/dist/modules/api_keys/backend/api-keys/page.js.map +2 -2
- package/dist/modules/api_keys/di.js +9 -0
- package/dist/modules/api_keys/di.js.map +7 -0
- package/dist/modules/api_keys/services/principalService.js +31 -0
- package/dist/modules/api_keys/services/principalService.js.map +7 -0
- package/dist/modules/attachments/api/route.js +2 -2
- package/dist/modules/attachments/api/route.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentLibrary.js +2 -0
- package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
- package/dist/modules/attachments/di.js +11 -1
- package/dist/modules/attachments/di.js.map +2 -2
- package/dist/modules/attachments/index.js.map +1 -1
- package/dist/modules/attachments/lib/attachment-service.js +313 -0
- package/dist/modules/attachments/lib/attachment-service.js.map +7 -0
- package/dist/modules/attachments/lib/scoped-upload-service.js +15 -2
- package/dist/modules/attachments/lib/scoped-upload-service.js.map +2 -2
- package/dist/modules/attachments/lib/upload-limits.js +6 -2
- package/dist/modules/attachments/lib/upload-limits.js.map +2 -2
- package/dist/modules/audit_logs/backend/audit-logs/page.js +6 -0
- package/dist/modules/audit_logs/backend/audit-logs/page.js.map +2 -2
- package/dist/modules/audit_logs/lib/display-helpers.js +19 -11
- package/dist/modules/audit_logs/lib/display-helpers.js.map +2 -2
- package/dist/modules/audit_logs/services/actionLogService.js +57 -12
- package/dist/modules/audit_logs/services/actionLogService.js.map +3 -3
- package/dist/modules/auth/acl.js +30 -5
- package/dist/modules/auth/acl.js.map +2 -2
- package/dist/modules/auth/api/feature-check.js +8 -2
- package/dist/modules/auth/api/feature-check.js.map +2 -2
- package/dist/modules/auth/api/login.js +4 -1
- package/dist/modules/auth/api/login.js.map +2 -2
- package/dist/modules/auth/api/reset/validate.js +55 -0
- package/dist/modules/auth/api/reset/validate.js.map +7 -0
- package/dist/modules/auth/api/roles/acl/route.js +28 -33
- package/dist/modules/auth/api/roles/acl/route.js.map +2 -2
- package/dist/modules/auth/api/session/refresh.js +25 -1
- package/dist/modules/auth/api/session/refresh.js.map +2 -2
- package/dist/modules/auth/api/users/acl/route.js +96 -51
- package/dist/modules/auth/api/users/acl/route.js.map +2 -2
- package/dist/modules/auth/api/users/route.js +13 -5
- package/dist/modules/auth/api/users/route.js.map +2 -2
- package/dist/modules/auth/backend/roles/[id]/edit/page.meta.js +5 -1
- package/dist/modules/auth/backend/roles/[id]/edit/page.meta.js.map +2 -2
- package/dist/modules/auth/backend/roles/page.js +3 -1
- package/dist/modules/auth/backend/roles/page.js.map +2 -2
- package/dist/modules/auth/backend/users/[id]/edit/page.meta.js +5 -1
- package/dist/modules/auth/backend/users/[id]/edit/page.meta.js.map +2 -2
- package/dist/modules/auth/backend/users/page.js +2 -1
- package/dist/modules/auth/backend/users/page.js.map +2 -2
- package/dist/modules/auth/commands/acl.js +254 -0
- package/dist/modules/auth/commands/acl.js.map +7 -0
- package/dist/modules/auth/components/AclEditor.js +39 -30
- package/dist/modules/auth/components/AclEditor.js.map +2 -2
- package/dist/modules/auth/data/entities.js.map +2 -2
- package/dist/modules/auth/data/validators.js +5 -1
- package/dist/modules/auth/data/validators.js.map +2 -2
- package/dist/modules/auth/di.js +35 -9
- package/dist/modules/auth/di.js.map +2 -2
- package/dist/modules/auth/frontend/reset/[token]/page.js +46 -0
- package/dist/modules/auth/frontend/reset/[token]/page.js.map +2 -2
- package/dist/modules/auth/lib/grantChecks.js.map +2 -2
- package/dist/modules/auth/lib/userIdFilter.js +16 -0
- package/dist/modules/auth/lib/userIdFilter.js.map +7 -0
- package/dist/modules/auth/services/authService.js +16 -2
- package/dist/modules/auth/services/authService.js.map +2 -2
- package/dist/modules/auth/services/principalService.js +200 -0
- package/dist/modules/auth/services/principalService.js.map +7 -0
- package/dist/modules/auth/services/rbacService.js +67 -24
- package/dist/modules/auth/services/rbacService.js.map +3 -3
- package/dist/modules/auth/services/roleOrganizationScope.js +41 -0
- package/dist/modules/auth/services/roleOrganizationScope.js.map +7 -0
- package/dist/modules/business_rules/backend/logs/page.js +3 -1
- package/dist/modules/business_rules/backend/logs/page.js.map +2 -2
- package/dist/modules/business_rules/backend/rules/page.js +3 -1
- package/dist/modules/business_rules/backend/rules/page.js.map +2 -2
- package/dist/modules/business_rules/backend/sets/page.js +3 -1
- package/dist/modules/business_rules/backend/sets/page.js.map +2 -2
- package/dist/modules/business_rules/lib/expression-evaluator.js +9 -9
- package/dist/modules/business_rules/lib/expression-evaluator.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-evaluator.js +10 -9
- package/dist/modules/business_rules/lib/rule-evaluator.js.map +2 -2
- package/dist/modules/catalog/ai-agents.js +1 -1
- package/dist/modules/catalog/ai-agents.js.map +1 -1
- package/dist/modules/catalog/ai-tools/merchandising-pack.js +2 -2
- package/dist/modules/catalog/ai-tools/merchandising-pack.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js +5 -2
- package/dist/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.js.map +2 -2
- package/dist/modules/catalog/components/categories/CategoriesDataTable.js +2 -0
- package/dist/modules/catalog/components/categories/CategoriesDataTable.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductsDataTable.js +7 -1
- package/dist/modules/catalog/components/products/ProductsDataTable.js.map +2 -2
- package/dist/modules/catalog/widgets/injection/merchandising-assistant-trigger/widget.client.js +2 -0
- package/dist/modules/catalog/widgets/injection/merchandising-assistant-trigger/widget.client.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js +9 -1
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/test-seed/route.js +95 -10
- package/dist/modules/communication_channels/api/post/test-seed/route.js.map +2 -2
- package/dist/modules/communication_channels/backend/communication_channels/channels/page.js +3 -0
- package/dist/modules/communication_channels/backend/communication_channels/channels/page.js.map +2 -2
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js +14 -1
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js.map +2 -2
- package/dist/modules/communication_channels/di.js +7 -1
- package/dist/modules/communication_channels/di.js.map +2 -2
- package/dist/modules/communication_channels/lib/email-capabilities.js +4 -1
- package/dist/modules/communication_channels/lib/email-capabilities.js.map +2 -2
- package/dist/modules/communication_channels/lib/outbound-recipient.js +33 -0
- package/dist/modules/communication_channels/lib/outbound-recipient.js.map +7 -0
- package/dist/modules/communication_channels/lib/resolve-channel-type.js +51 -0
- package/dist/modules/communication_channels/lib/resolve-channel-type.js.map +7 -0
- package/dist/modules/communication_channels/lib/test-seed.js +41 -2
- package/dist/modules/communication_channels/lib/test-seed.js.map +2 -2
- package/dist/modules/configs/lib/system-status.js +9 -0
- package/dist/modules/configs/lib/system-status.js.map +2 -2
- package/dist/modules/currencies/backend/currencies/page.js +3 -1
- package/dist/modules/currencies/backend/currencies/page.js.map +2 -2
- package/dist/modules/currencies/backend/exchange-rates/page.js +3 -1
- package/dist/modules/currencies/backend/exchange-rates/page.js.map +2 -2
- package/dist/modules/currencies/services/rateFetchingService.js +6 -1
- package/dist/modules/currencies/services/rateFetchingService.js.map +2 -2
- package/dist/modules/customer_accounts/api/admin/domain-mappings.js +9 -0
- package/dist/modules/customer_accounts/api/admin/domain-mappings.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js +3 -1
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js.map +2 -2
- package/dist/modules/customer_accounts/backend/customer_accounts/users/PortalUsersPageClient.js +3 -1
- package/dist/modules/customer_accounts/backend/customer_accounts/users/PortalUsersPageClient.js.map +2 -2
- package/dist/modules/customer_accounts/services/domainMappingService.js +10 -0
- package/dist/modules/customer_accounts/services/domainMappingService.js.map +2 -2
- package/dist/modules/customers/ai-tools/companies-pack.js +4 -1
- package/dist/modules/customers/ai-tools/companies-pack.js.map +2 -2
- package/dist/modules/customers/ai-tools/deal-analyzer-pack.js +13 -2
- package/dist/modules/customers/ai-tools/deal-analyzer-pack.js.map +2 -2
- package/dist/modules/customers/ai-tools/deals-pack.js +52 -6
- package/dist/modules/customers/ai-tools/deals-pack.js.map +2 -2
- package/dist/modules/customers/ai-tools/people-pack.js +4 -1
- package/dist/modules/customers/ai-tools/people-pack.js.map +2 -2
- package/dist/modules/customers/api/activities/route.js +48 -6
- package/dist/modules/customers/api/activities/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/people/route.js +20 -64
- package/dist/modules/customers/api/companies/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/route.js +17 -94
- package/dist/modules/customers/api/companies/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/dashboard/widgets/customer-todos/route.js +8 -5
- package/dist/modules/customers/api/dashboard/widgets/customer-todos/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/companies/route.js +1 -1
- package/dist/modules/customers/api/deals/[id]/companies/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/people/route.js +1 -1
- package/dist/modules/customers/api/deals/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/route.js +8 -25
- package/dist/modules/customers/api/deals/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/stats/route.js +3 -22
- package/dist/modules/customers/api/deals/[id]/stats/route.js.map +2 -2
- package/dist/modules/customers/api/deals/aggregate/route.js +14 -9
- package/dist/modules/customers/api/deals/aggregate/route.js.map +2 -2
- package/dist/modules/customers/api/deals/map/route.js +5 -5
- package/dist/modules/customers/api/deals/map/route.js.map +2 -2
- package/dist/modules/customers/api/deals/route.js +38 -1
- package/dist/modules/customers/api/deals/route.js.map +2 -2
- package/dist/modules/customers/api/entity-roles-factory.js +4 -4
- package/dist/modules/customers/api/entity-roles-factory.js.map +2 -2
- package/dist/modules/customers/api/interactions/route.js +3 -1
- package/dist/modules/customers/api/interactions/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/tasks/route.js +27 -4
- package/dist/modules/customers/api/interactions/tasks/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js +4 -3
- package/dist/modules/customers/api/people/[id]/companies/[linkId]/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/context.js +1 -1
- package/dist/modules/customers/api/people/[id]/companies/context.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js +1 -1
- package/dist/modules/customers/api/people/[id]/companies/enriched/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/route.js +11 -10
- package/dist/modules/customers/api/people/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/people/check-phone/route.js +51 -9
- package/dist/modules/customers/api/people/check-phone/route.js.map +2 -2
- package/dist/modules/customers/api/todos/route.js +30 -5
- package/dist/modules/customers/api/todos/route.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/page.js +4 -2
- package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/page.js +6 -1
- package/dist/modules/customers/backend/customers/deals/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/page.js +5 -2
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/Lane.js +4 -13
- package/dist/modules/customers/backend/customers/deals/pipeline/components/Lane.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.js +85 -14
- package/dist/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/pipeline/components/toneClasses.js +18 -0
- package/dist/modules/customers/backend/customers/deals/pipeline/components/toneClasses.js.map +7 -0
- package/dist/modules/customers/backend/customers/people/page.js +4 -2
- package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
- package/dist/modules/customers/backend/hooks/useEmailDuplicateCheck.js +9 -3
- package/dist/modules/customers/backend/hooks/useEmailDuplicateCheck.js.map +2 -2
- package/dist/modules/customers/commands/deals.js +21 -34
- package/dist/modules/customers/commands/deals.js.map +2 -2
- package/dist/modules/customers/commands/interactions.js.map +1 -1
- package/dist/modules/customers/commands/personCompanyLinks.js +131 -2
- package/dist/modules/customers/commands/personCompanyLinks.js.map +2 -2
- package/dist/modules/customers/components/CustomerTodosTable.js +1 -0
- package/dist/modules/customers/components/CustomerTodosTable.js.map +2 -2
- package/dist/modules/customers/components/DealsKpiStrip.js +7 -6
- package/dist/modules/customers/components/DealsKpiStrip.js.map +2 -2
- package/dist/modules/customers/components/calendar/AgendaList.js +2 -2
- package/dist/modules/customers/components/calendar/AgendaList.js.map +2 -2
- package/dist/modules/customers/components/calendar/CalendarEventEditor.js +1 -1
- package/dist/modules/customers/components/calendar/CalendarEventEditor.js.map +2 -2
- package/dist/modules/customers/components/calendar/CalendarScreen.js +1 -1
- package/dist/modules/customers/components/calendar/CalendarScreen.js.map +2 -2
- package/dist/modules/customers/components/calendar/CalendarSettingsModal.js +1 -1
- package/dist/modules/customers/components/calendar/CalendarSettingsModal.js.map +2 -2
- package/dist/modules/customers/components/calendar/EventBlock.js +1 -1
- package/dist/modules/customers/components/calendar/EventBlock.js.map +2 -2
- package/dist/modules/customers/components/calendar/EventPeekPopover.js +3 -2
- package/dist/modules/customers/components/calendar/EventPeekPopover.js.map +2 -2
- package/dist/modules/customers/components/calendar/editor/PeopleField.js +40 -5
- package/dist/modules/customers/components/calendar/editor/PeopleField.js.map +2 -2
- package/dist/modules/customers/components/calendar/editor/hooks.js +2 -1
- package/dist/modules/customers/components/calendar/editor/hooks.js.map +2 -2
- package/dist/modules/customers/components/calendar/types.js +1 -1
- package/dist/modules/customers/components/calendar/types.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyKpiBar.js +5 -4
- package/dist/modules/customers/components/detail/CompanyKpiBar.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js +3 -1
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +19 -7
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/detail/DealsSection.js +6 -5
- package/dist/modules/customers/components/detail/DealsSection.js.map +2 -2
- package/dist/modules/customers/components/detail/EntityTagsDialog.js +35 -11
- package/dist/modules/customers/components/detail/EntityTagsDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/PersonCompaniesSection.js +3 -1
- package/dist/modules/customers/components/detail/PersonCompaniesSection.js.map +2 -2
- package/dist/modules/customers/components/detail/hooks/usePersonTasks.js +19 -13
- package/dist/modules/customers/components/detail/hooks/usePersonTasks.js.map +2 -2
- package/dist/modules/customers/components/detail/schedule/ParticipantsField.js +4 -4
- package/dist/modules/customers/components/detail/schedule/ParticipantsField.js.map +2 -2
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js +3 -3
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js.map +2 -2
- package/dist/modules/customers/components/detail/utils.js +5 -5
- package/dist/modules/customers/components/detail/utils.js.map +2 -2
- package/dist/modules/customers/data/entities.js.map +1 -1
- package/dist/modules/customers/data/validators.js +32 -3
- package/dist/modules/customers/data/validators.js.map +2 -2
- package/dist/modules/customers/events.js +5 -0
- package/dist/modules/customers/events.js.map +2 -2
- package/dist/modules/customers/lib/calendar/conflicts.js +8 -2
- package/dist/modules/customers/lib/calendar/conflicts.js.map +2 -2
- package/dist/modules/customers/lib/calendar/editorPayload.js +3 -2
- package/dist/modules/customers/lib/calendar/editorPayload.js.map +2 -2
- package/dist/modules/customers/lib/calendar/mapItem.js +8 -3
- package/dist/modules/customers/lib/calendar/mapItem.js.map +2 -2
- package/dist/modules/customers/lib/calendar/participantIdentity.js +9 -0
- package/dist/modules/customers/lib/calendar/participantIdentity.js.map +7 -0
- package/dist/modules/customers/lib/closureStage.js +45 -0
- package/dist/modules/customers/lib/closureStage.js.map +7 -0
- package/dist/modules/customers/lib/dealStatus.js +30 -0
- package/dist/modules/customers/lib/dealStatus.js.map +2 -2
- package/dist/modules/customers/lib/detailReadAccess.js +12 -0
- package/dist/modules/customers/lib/detailReadAccess.js.map +7 -0
- package/dist/modules/customers/lib/findPeopleByAddresses.js +1 -0
- package/dist/modules/customers/lib/findPeopleByAddresses.js.map +2 -2
- package/dist/modules/customers/lib/personCompanies.js +100 -2
- package/dist/modules/customers/lib/personCompanies.js.map +2 -2
- package/dist/modules/customers/lib/todoCompatibility.js +12 -0
- package/dist/modules/customers/lib/todoCompatibility.js.map +2 -2
- package/dist/modules/dashboards/lib/widgetScope.js +6 -1
- package/dist/modules/dashboards/lib/widgetScope.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +3 -1
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/lib/abandoned-run.js +19 -0
- package/dist/modules/data_sync/lib/abandoned-run.js.map +7 -0
- package/dist/modules/data_sync/lib/sync-engine.js +72 -6
- package/dist/modules/data_sync/lib/sync-engine.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-export.js +5 -1
- package/dist/modules/data_sync/workers/sync-export.js.map +2 -2
- package/dist/modules/data_sync/workers/sync-import.js +5 -1
- package/dist/modules/data_sync/workers/sync-import.js.map +2 -2
- package/dist/modules/devices/acl.js +9 -1
- package/dist/modules/devices/acl.js.map +2 -2
- package/dist/modules/devices/api/admin/devices/[id]/route.js +5 -32
- package/dist/modules/devices/api/admin/devices/[id]/route.js.map +2 -2
- package/dist/modules/devices/api/admin/devices/route.js +14 -1
- package/dist/modules/devices/api/admin/devices/route.js.map +2 -2
- package/dist/modules/devices/api/deviceList.js +99 -12
- package/dist/modules/devices/api/deviceList.js.map +2 -2
- package/dist/modules/devices/api/deviceSerialization.js +46 -0
- package/dist/modules/devices/api/deviceSerialization.js.map +7 -0
- package/dist/modules/devices/api/openapi.js +3 -1
- package/dist/modules/devices/api/openapi.js.map +2 -2
- package/dist/modules/devices/api/route.js +9 -1
- package/dist/modules/devices/api/route.js.map +2 -2
- package/dist/modules/devices/backend/devices/[id]/page.js +10 -26
- package/dist/modules/devices/backend/devices/[id]/page.js.map +2 -2
- package/dist/modules/devices/backend/devices/create/page.js +17 -1
- package/dist/modules/devices/backend/devices/create/page.js.map +2 -2
- package/dist/modules/devices/backend/devices/page.js +28 -34
- package/dist/modules/devices/backend/devices/page.js.map +2 -2
- package/dist/modules/devices/backend/devices/useDeviceUserLabels.js +34 -0
- package/dist/modules/devices/backend/devices/useDeviceUserLabels.js.map +7 -0
- package/dist/modules/devices/backend/devices/userOptions.js +52 -0
- package/dist/modules/devices/backend/devices/userOptions.js.map +7 -0
- package/dist/modules/devices/setup.js +6 -2
- package/dist/modules/devices/setup.js.map +2 -2
- package/dist/modules/directory/backend/directory/organizations/page.js +2 -1
- package/dist/modules/directory/backend/directory/organizations/page.js.map +2 -2
- package/dist/modules/directory/backend/directory/tenants/page.js +2 -1
- package/dist/modules/directory/backend/directory/tenants/page.js.map +2 -2
- package/dist/modules/directory/di.js +9 -0
- package/dist/modules/directory/di.js.map +2 -2
- package/dist/modules/directory/services/organizationHierarchyService.js +29 -0
- package/dist/modules/directory/services/organizationHierarchyService.js.map +7 -0
- package/dist/modules/directory/services/organizationScopeService.js +56 -0
- package/dist/modules/directory/services/organizationScopeService.js.map +7 -0
- package/dist/modules/directory/utils/organizationScope.js.map +2 -2
- package/dist/modules/entities/api/records.js +4 -2
- package/dist/modules/entities/api/records.js.map +2 -2
- package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js +3 -1
- package/dist/modules/entities/backend/entities/user/[entityId]/records/page.js.map +2 -2
- package/dist/modules/eudr/api/plots/route.js +5 -1
- package/dist/modules/eudr/api/plots/route.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/evidence-submissions/page.js +3 -0
- package/dist/modules/eudr/backend/eudr/evidence-submissions/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/plots/page.js +3 -0
- package/dist/modules/eudr/backend/eudr/plots/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/product-mappings/page.js +3 -0
- package/dist/modules/eudr/backend/eudr/product-mappings/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/risk-assessments/page.js +3 -0
- package/dist/modules/eudr/backend/eudr/risk-assessments/page.js.map +2 -2
- package/dist/modules/eudr/backend/eudr/statements/page.js +3 -0
- package/dist/modules/eudr/backend/eudr/statements/page.js.map +2 -2
- package/dist/modules/eudr/commands/statements.js +0 -3
- package/dist/modules/eudr/commands/statements.js.map +2 -2
- package/dist/modules/eudr/data/validators.js +4 -1
- package/dist/modules/eudr/data/validators.js.map +2 -2
- package/dist/modules/feature_toggles/components/FeatureTogglesTable.js +1 -0
- package/dist/modules/feature_toggles/components/FeatureTogglesTable.js.map +2 -2
- package/dist/modules/feature_toggles/components/OverridesTable.js +1 -0
- package/dist/modules/feature_toggles/components/OverridesTable.js.map +2 -2
- package/dist/modules/feature_toggles/defaults.json +0 -8
- package/dist/modules/inbox_ops/backend/inbox-ops/log/page.js +3 -0
- package/dist/modules/inbox_ops/backend/inbox-ops/log/page.js.map +2 -2
- package/dist/modules/inbox_ops/backend/inbox-ops/page.js +3 -0
- package/dist/modules/inbox_ops/backend/inbox-ops/page.js.map +2 -2
- package/dist/modules/inbox_ops/lib/htmlToPlainText.js +1 -12
- package/dist/modules/inbox_ops/lib/htmlToPlainText.js.map +2 -2
- package/dist/modules/integrations/api/[id]/credentials/route.js +6 -1
- package/dist/modules/integrations/api/[id]/credentials/route.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/[id]/page.js +38 -29
- package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js +36 -9
- package/dist/modules/integrations/backend/integrations/bundle/[id]/page.js.map +2 -2
- package/dist/modules/integrations/backend/integrations/credential-secret-fields.js +55 -0
- package/dist/modules/integrations/backend/integrations/credential-secret-fields.js.map +7 -0
- package/dist/modules/integrations/data/validators.js +11 -3
- package/dist/modules/integrations/data/validators.js.map +2 -2
- package/dist/modules/integrations/lib/credentials-masking.js +6 -2
- package/dist/modules/integrations/lib/credentials-masking.js.map +2 -2
- package/dist/modules/messages/api/[id]/route.js +29 -1
- package/dist/modules/messages/api/[id]/route.js.map +2 -2
- package/dist/modules/messages/api/openapi.js +17 -2
- package/dist/modules/messages/api/openapi.js.map +2 -2
- package/dist/modules/messages/api/route.js +17 -2
- package/dist/modules/messages/api/route.js.map +2 -2
- package/dist/modules/messages/components/MessagesInboxPageClient.js +7 -14
- package/dist/modules/messages/components/MessagesInboxPageClient.js.map +2 -2
- package/dist/modules/messages/components/inboxFilters.js +15 -0
- package/dist/modules/messages/components/inboxFilters.js.map +2 -2
- package/dist/modules/messages/components/message-detail/hooks/useMessageDetailsConversation.js +11 -1
- package/dist/modules/messages/components/message-detail/hooks/useMessageDetailsConversation.js.map +2 -2
- package/dist/modules/messages/components/message-detail/panels/MessageHeader.js +3 -1
- package/dist/modules/messages/components/message-detail/panels/MessageHeader.js.map +2 -2
- package/dist/modules/messages/components/message-detail/panels/thread-panel.js +2 -1
- package/dist/modules/messages/components/message-detail/panels/thread-panel.js.map +2 -2
- package/dist/modules/messages/components/messageListLabels.js +14 -2
- package/dist/modules/messages/components/messageListLabels.js.map +2 -2
- package/dist/modules/messages/data/validators.js +18 -4
- package/dist/modules/messages/data/validators.js.map +2 -2
- package/dist/modules/messages/lib/channel-sender-identity.js +26 -0
- package/dist/modules/messages/lib/channel-sender-identity.js.map +7 -0
- package/dist/modules/messages/lib/composeSourceChannelType.js +41 -0
- package/dist/modules/messages/lib/composeSourceChannelType.js.map +7 -0
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js +4 -6
- package/dist/modules/payment_gateways/api/webhook/[provider]/route.js.map +2 -2
- package/dist/modules/payment_gateways/backend/payment-gateways/page.js +3 -1
- package/dist/modules/payment_gateways/backend/payment-gateways/page.js.map +2 -2
- package/dist/modules/payment_gateways/lib/webhook-processor.js +7 -0
- package/dist/modules/payment_gateways/lib/webhook-processor.js.map +2 -2
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js +3 -0
- package/dist/modules/planner/backend/planner/availability-rulesets/page.js.map +2 -2
- package/dist/modules/push_notifications/backend/push_notifications/page.js +3 -1
- package/dist/modules/push_notifications/backend/push_notifications/page.js.map +2 -2
- package/dist/modules/push_notifications/backend/push_notifications/send/page.js +1 -1
- package/dist/modules/push_notifications/backend/push_notifications/send/page.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +150 -51
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/query_index/lib/search-entity-policy.js +14 -0
- package/dist/modules/query_index/lib/search-entity-policy.js.map +7 -0
- package/dist/modules/query_index/lib/search-tokens.js +79 -3
- package/dist/modules/query_index/lib/search-tokens.js.map +2 -2
- package/dist/modules/resources/backend/resources/resource-types/page.js +3 -1
- package/dist/modules/resources/backend/resources/resource-types/page.js.map +2 -2
- package/dist/modules/resources/backend/resources/resources/page.js +3 -1
- package/dist/modules/resources/backend/resources/resources/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/offers/page.js +3 -0
- package/dist/modules/sales/backend/sales/channels/offers/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/channels/page.js +3 -0
- package/dist/modules/sales/backend/sales/channels/page.js.map +2 -2
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +10 -8
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +79 -1
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/components/PriceWithCurrency.js +7 -5
- package/dist/modules/sales/components/PriceWithCurrency.js.map +2 -2
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js +3 -0
- package/dist/modules/sales/components/channels/SalesChannelOffersPanel.js.map +2 -2
- package/dist/modules/sales/components/documents/AdjustmentsSection.js +8 -6
- package/dist/modules/sales/components/documents/AdjustmentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +51 -22
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +83 -18
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js +23 -9
- package/dist/modules/sales/components/documents/PaymentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/ReturnsSection.js +8 -6
- package/dist/modules/sales/components/documents/ReturnsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js +68 -14
- package/dist/modules/sales/components/documents/SalesDocumentsTable.js.map +2 -2
- package/dist/modules/sales/components/documents/SalesOrderDraftLines.js +6 -5
- package/dist/modules/sales/components/documents/SalesOrderDraftLines.js.map +2 -2
- package/dist/modules/sales/components/documents/ShipmentDialog.js +5 -4
- package/dist/modules/sales/components/documents/ShipmentDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/ShipmentsSection.js +8 -6
- package/dist/modules/sales/components/documents/ShipmentsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/lineItemShipmentLock.js +54 -0
- package/dist/modules/sales/components/documents/lineItemShipmentLock.js.map +7 -0
- package/dist/modules/sales/components/documents/lineItemUtils.js +2 -2
- package/dist/modules/sales/components/documents/lineItemUtils.js.map +2 -2
- package/dist/modules/sales/data/entities.js +8 -2
- package/dist/modules/sales/data/entities.js.map +2 -2
- package/dist/modules/sales/extension-points.js +1 -0
- package/dist/modules/sales/extension-points.js.map +2 -2
- package/dist/modules/sales/lib/salesChannelsToggleSeed.js +33 -0
- package/dist/modules/sales/lib/salesChannelsToggleSeed.js.map +7 -0
- package/dist/modules/sales/migrations/Migration20260821120000_sales_notes_addresses_context_idx.js +32 -0
- package/dist/modules/sales/migrations/Migration20260821120000_sales_notes_addresses_context_idx.js.map +7 -0
- package/dist/modules/sales/setup.js +2 -0
- package/dist/modules/sales/setup.js.map +2 -2
- package/dist/modules/sales/widgets/injection/payment-gateway-status-column/widget.js +10 -2
- package/dist/modules/sales/widgets/injection/payment-gateway-status-column/widget.js.map +2 -2
- package/dist/modules/sales/widgets/injection-table.js +4 -7
- package/dist/modules/sales/widgets/injection-table.js.map +2 -2
- package/dist/modules/staff/backend/staff/leave-requests/page.js +3 -0
- package/dist/modules/staff/backend/staff/leave-requests/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/my-leave-requests/page.js +3 -0
- package/dist/modules/staff/backend/staff/my-leave-requests/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-members/page.js +3 -0
- package/dist/modules/staff/backend/staff/team-members/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/team-roles/page.js +3 -0
- package/dist/modules/staff/backend/staff/team-roles/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js +3 -0
- package/dist/modules/staff/backend/staff/teams/[id]/edit/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/teams/page.js +3 -0
- package/dist/modules/staff/backend/staff/teams/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/page.js +29 -18
- package/dist/modules/staff/backend/staff/timesheets/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js +3 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js.map +2 -2
- package/dist/modules/sync_excel/lib/adapters/customers.js +1 -0
- package/dist/modules/sync_excel/lib/adapters/customers.js.map +2 -2
- package/dist/modules/warranty_claims/api/assignees/route.js +3 -3
- package/dist/modules/warranty_claims/api/assignees/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/portal/attachments/route.js +2 -2
- package/dist/modules/warranty_claims/api/portal/attachments/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/portal/claims/route.js +12 -9
- package/dist/modules/warranty_claims/api/portal/claims/route.js.map +2 -2
- package/dist/modules/warranty_claims/backend/page.js +3 -0
- package/dist/modules/warranty_claims/backend/page.js.map +2 -2
- package/dist/modules/warranty_claims/backend/warranty_claims/registrations/page.js +3 -0
- package/dist/modules/warranty_claims/backend/warranty_claims/registrations/page.js.map +2 -2
- package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.js +3 -0
- package/dist/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.js.map +2 -2
- package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.js +3 -0
- package/dist/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.js.map +2 -2
- package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.js +3 -0
- package/dist/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.js.map +2 -2
- package/dist/modules/wms/api/warehouseSearch.js +21 -0
- package/dist/modules/wms/api/warehouseSearch.js.map +7 -0
- package/dist/modules/wms/api/warehouses/route.js +13 -9
- package/dist/modules/wms/api/warehouses/route.js.map +2 -2
- package/dist/modules/wms/api/zones/route.js +15 -2
- package/dist/modules/wms/api/zones/route.js.map +2 -2
- package/dist/modules/wms/commands/configuration.js +121 -9
- package/dist/modules/wms/commands/configuration.js.map +2 -2
- package/dist/modules/wms/commands/inventory-actions.js +3 -0
- package/dist/modules/wms/commands/inventory-actions.js.map +2 -2
- package/dist/modules/wms/commands/shared.js +9 -1
- package/dist/modules/wms/commands/shared.js.map +2 -2
- package/dist/modules/wms/components/backend/WarehouseEditDialog.js +158 -0
- package/dist/modules/wms/components/backend/WarehouseEditDialog.js.map +7 -0
- package/dist/modules/wms/components/backend/WmsConfigurationPage.js +76 -111
- package/dist/modules/wms/components/backend/WmsConfigurationPage.js.map +3 -3
- package/dist/modules/wms/components/backend/WmsInventoryConsolePage.js +1 -0
- package/dist/modules/wms/components/backend/WmsInventoryConsolePage.js.map +2 -2
- package/dist/modules/wms/components/backend/WmsLotsListPage.js +1 -0
- package/dist/modules/wms/components/backend/WmsLotsListPage.js.map +2 -2
- package/dist/modules/wms/components/backend/inventoryMutationLoaders.js +27 -20
- package/dist/modules/wms/components/backend/inventoryMutationLoaders.js.map +2 -2
- package/dist/modules/wms/components/backend/warehouseFormOptions.js +66 -0
- package/dist/modules/wms/components/backend/warehouseFormOptions.js.map +7 -0
- package/dist/modules/workflows/backend/definitions/page.js +3 -1
- package/dist/modules/workflows/backend/definitions/page.js.map +2 -2
- package/dist/modules/workflows/backend/events/page.js +3 -1
- package/dist/modules/workflows/backend/events/page.js.map +2 -2
- package/dist/modules/workflows/backend/instances/page.js +3 -1
- package/dist/modules/workflows/backend/instances/page.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/page.js +3 -1
- package/dist/modules/workflows/backend/tasks/page.js.map +2 -2
- package/dist/modules/workflows/lib/activity-executor.js +4 -0
- package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
- package/package.json +9 -10
- package/src/helpers/integration/api.ts +33 -1
- package/src/helpers/integration/communicationChannelsFixtures.ts +69 -1
- package/src/modules/api_keys/api/keys/route.ts +3 -1
- package/src/modules/api_keys/backend/api-keys/page.tsx +4 -1
- package/src/modules/api_keys/di.ts +7 -0
- package/src/modules/api_keys/services/principalService.ts +33 -0
- package/src/modules/attachments/AGENTS.md +15 -0
- package/src/modules/attachments/api/route.ts +2 -2
- package/src/modules/attachments/components/AttachmentLibrary.tsx +3 -0
- package/src/modules/attachments/di.ts +16 -0
- package/src/modules/attachments/i18n/de.json +5 -0
- package/src/modules/attachments/i18n/en.json +5 -0
- package/src/modules/attachments/i18n/es.json +5 -0
- package/src/modules/attachments/i18n/ko.json +5 -0
- package/src/modules/attachments/i18n/pl.json +5 -0
- package/src/modules/attachments/index.ts +10 -0
- package/src/modules/attachments/lib/attachment-service.ts +468 -0
- package/src/modules/attachments/lib/scoped-upload-service.ts +46 -0
- package/src/modules/attachments/lib/upload-limits.ts +6 -2
- package/src/modules/audit_logs/backend/audit-logs/page.tsx +8 -0
- package/src/modules/audit_logs/lib/display-helpers.tsx +42 -32
- package/src/modules/audit_logs/services/actionLogService.ts +74 -11
- package/src/modules/auth/acl.ts +30 -6
- package/src/modules/auth/api/feature-check.ts +10 -3
- package/src/modules/auth/api/login.ts +9 -1
- package/src/modules/auth/api/reset/validate.ts +57 -0
- package/src/modules/auth/api/roles/acl/route.ts +42 -39
- package/src/modules/auth/api/session/refresh.ts +32 -1
- package/src/modules/auth/api/users/acl/route.ts +177 -53
- package/src/modules/auth/api/users/route.ts +18 -5
- package/src/modules/auth/backend/roles/[id]/edit/page.meta.ts +5 -2
- package/src/modules/auth/backend/roles/page.tsx +4 -2
- package/src/modules/auth/backend/users/[id]/edit/page.meta.ts +5 -2
- package/src/modules/auth/backend/users/page.tsx +3 -2
- package/src/modules/auth/commands/acl.ts +495 -0
- package/src/modules/auth/components/AclEditor.tsx +63 -33
- package/src/modules/auth/data/entities.ts +4 -1
- package/src/modules/auth/data/validators.ts +5 -0
- package/src/modules/auth/di.ts +46 -16
- package/src/modules/auth/frontend/reset/[token]/page.tsx +74 -0
- package/src/modules/auth/i18n/de.json +389 -0
- package/src/modules/auth/i18n/en.json +389 -0
- package/src/modules/auth/i18n/es.json +389 -0
- package/src/modules/auth/i18n/ko.json +389 -0
- package/src/modules/auth/i18n/pl.json +391 -2
- package/src/modules/auth/lib/grantChecks.ts +6 -0
- package/src/modules/auth/lib/userIdFilter.ts +31 -0
- package/src/modules/auth/services/authService.ts +18 -2
- package/src/modules/auth/services/principalService.ts +266 -0
- package/src/modules/auth/services/rbacService.ts +110 -24
- package/src/modules/auth/services/roleOrganizationScope.ts +70 -0
- package/src/modules/business_rules/backend/logs/page.tsx +4 -1
- package/src/modules/business_rules/backend/rules/page.tsx +4 -1
- package/src/modules/business_rules/backend/sets/page.tsx +4 -1
- package/src/modules/business_rules/lib/expression-evaluator.ts +9 -9
- package/src/modules/business_rules/lib/rule-evaluator.ts +10 -9
- package/src/modules/catalog/ai-agents.ts +1 -1
- package/src/modules/catalog/ai-tools/merchandising-pack.ts +2 -2
- package/src/modules/catalog/backend/catalog/products/MerchandisingAssistantSheet.tsx +12 -5
- package/src/modules/catalog/components/categories/CategoriesDataTable.tsx +3 -0
- package/src/modules/catalog/components/products/ProductsDataTable.tsx +7 -0
- package/src/modules/catalog/i18n/de.json +1 -0
- package/src/modules/catalog/i18n/en.json +1 -0
- package/src/modules/catalog/i18n/es.json +1 -0
- package/src/modules/catalog/i18n/ko.json +1 -0
- package/src/modules/catalog/i18n/pl.json +1 -0
- package/src/modules/catalog/widgets/injection/merchandising-assistant-trigger/widget.client.tsx +4 -0
- package/src/modules/communication_channels/api/post/channels/[id]/test-send/route.ts +17 -1
- package/src/modules/communication_channels/api/post/test-seed/route.ts +155 -16
- package/src/modules/communication_channels/backend/communication_channels/channels/page.tsx +4 -0
- package/src/modules/communication_channels/commands/ingest-inbound-message.ts +38 -1
- package/src/modules/communication_channels/di.ts +7 -0
- package/src/modules/communication_channels/lib/adapter.ts +14 -0
- package/src/modules/communication_channels/lib/email-capabilities.ts +4 -0
- package/src/modules/communication_channels/lib/outbound-recipient.ts +71 -0
- package/src/modules/communication_channels/lib/resolve-channel-type.ts +99 -0
- package/src/modules/communication_channels/lib/test-seed.ts +64 -4
- package/src/modules/configs/i18n/de.json +2 -0
- package/src/modules/configs/i18n/en.json +2 -0
- package/src/modules/configs/i18n/es.json +2 -0
- package/src/modules/configs/i18n/ko.json +2 -0
- package/src/modules/configs/i18n/pl.json +2 -0
- package/src/modules/configs/lib/system-status.ts +9 -0
- package/src/modules/currencies/AGENTS.md +3 -0
- package/src/modules/currencies/backend/currencies/page.tsx +4 -1
- package/src/modules/currencies/backend/exchange-rates/page.tsx +4 -1
- package/src/modules/currencies/services/README.md +45 -0
- package/src/modules/currencies/services/rateFetchingService.ts +6 -1
- package/src/modules/customer_accounts/api/admin/domain-mappings.ts +7 -0
- package/src/modules/customer_accounts/backend/customer_accounts/roles/page.tsx +4 -1
- package/src/modules/customer_accounts/backend/customer_accounts/users/PortalUsersPageClient.tsx +4 -1
- package/src/modules/customer_accounts/services/domainMappingService.ts +10 -0
- package/src/modules/customers/ai-tools/companies-pack.ts +4 -1
- package/src/modules/customers/ai-tools/deal-analyzer-pack.ts +17 -2
- package/src/modules/customers/ai-tools/deals-pack.ts +66 -1
- package/src/modules/customers/ai-tools/people-pack.ts +4 -1
- package/src/modules/customers/api/activities/route.ts +45 -0
- package/src/modules/customers/api/companies/[id]/people/route.ts +24 -73
- package/src/modules/customers/api/companies/[id]/route.ts +24 -107
- package/src/modules/customers/api/dashboard/widgets/customer-todos/route.ts +16 -8
- package/src/modules/customers/api/deals/[id]/companies/route.ts +4 -1
- package/src/modules/customers/api/deals/[id]/people/route.ts +4 -1
- package/src/modules/customers/api/deals/[id]/route.ts +17 -28
- package/src/modules/customers/api/deals/[id]/stats/route.ts +10 -25
- package/src/modules/customers/api/deals/aggregate/route.ts +17 -9
- package/src/modules/customers/api/deals/map/route.ts +4 -4
- package/src/modules/customers/api/deals/route.ts +50 -1
- package/src/modules/customers/api/entity-roles-factory.ts +8 -4
- package/src/modules/customers/api/interactions/route.ts +8 -2
- package/src/modules/customers/api/interactions/tasks/route.ts +24 -1
- package/src/modules/customers/api/people/[id]/companies/[linkId]/route.ts +12 -4
- package/src/modules/customers/api/people/[id]/companies/context.ts +4 -1
- package/src/modules/customers/api/people/[id]/companies/enriched/route.ts +4 -1
- package/src/modules/customers/api/people/[id]/route.ts +16 -11
- package/src/modules/customers/api/people/check-phone/route.ts +75 -10
- package/src/modules/customers/api/todos/route.ts +27 -2
- package/src/modules/customers/backend/customers/companies/page.tsx +5 -2
- package/src/modules/customers/backend/customers/deals/[id]/page.tsx +7 -2
- package/src/modules/customers/backend/customers/deals/page.tsx +8 -2
- package/src/modules/customers/backend/customers/deals/pipeline/components/Lane.tsx +5 -14
- package/src/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.tsx +109 -27
- package/src/modules/customers/backend/customers/deals/pipeline/components/toneClasses.ts +21 -0
- package/src/modules/customers/backend/customers/people/page.tsx +5 -2
- package/src/modules/customers/backend/hooks/useEmailDuplicateCheck.ts +12 -4
- package/src/modules/customers/commands/deals.ts +34 -59
- package/src/modules/customers/commands/interactions.ts +1 -1
- package/src/modules/customers/commands/personCompanyLinks.ts +224 -8
- package/src/modules/customers/components/CustomerTodosTable.tsx +2 -0
- package/src/modules/customers/components/DealsKpiStrip.tsx +7 -7
- package/src/modules/customers/components/calendar/AgendaList.tsx +3 -3
- package/src/modules/customers/components/calendar/CalendarEventEditor.tsx +1 -1
- package/src/modules/customers/components/calendar/CalendarScreen.tsx +1 -1
- package/src/modules/customers/components/calendar/CalendarSettingsModal.tsx +1 -1
- package/src/modules/customers/components/calendar/EventBlock.tsx +2 -2
- package/src/modules/customers/components/calendar/EventPeekPopover.tsx +4 -2
- package/src/modules/customers/components/calendar/editor/PeopleField.tsx +61 -5
- package/src/modules/customers/components/calendar/editor/hooks.ts +7 -1
- package/src/modules/customers/components/calendar/types.ts +2 -2
- package/src/modules/customers/components/detail/CompanyKpiBar.tsx +5 -4
- package/src/modules/customers/components/detail/CompanyPeopleSection.tsx +8 -1
- package/src/modules/customers/components/detail/DealForm.tsx +22 -2
- package/src/modules/customers/components/detail/DealsSection.tsx +11 -5
- package/src/modules/customers/components/detail/EntityTagsDialog.tsx +58 -12
- package/src/modules/customers/components/detail/PersonCompaniesSection.tsx +8 -1
- package/src/modules/customers/components/detail/hooks/usePersonTasks.ts +23 -14
- package/src/modules/customers/components/detail/schedule/ParticipantsField.tsx +5 -5
- package/src/modules/customers/components/detail/schedule/useScheduleFormState.ts +5 -5
- package/src/modules/customers/components/detail/types.ts +1 -1
- package/src/modules/customers/components/detail/utils.ts +15 -5
- package/src/modules/customers/data/entities.ts +1 -1
- package/src/modules/customers/data/validators.ts +50 -9
- package/src/modules/customers/events.ts +5 -0
- package/src/modules/customers/i18n/de.json +9 -1
- package/src/modules/customers/i18n/en.json +9 -1
- package/src/modules/customers/i18n/es.json +9 -1
- package/src/modules/customers/i18n/ko.json +9 -1
- package/src/modules/customers/i18n/pl.json +9 -1
- package/src/modules/customers/lib/calendar/conflicts.ts +10 -2
- package/src/modules/customers/lib/calendar/editorPayload.ts +4 -3
- package/src/modules/customers/lib/calendar/mapItem.ts +8 -3
- package/src/modules/customers/lib/calendar/participantIdentity.ts +17 -0
- package/src/modules/customers/lib/closureStage.ts +76 -0
- package/src/modules/customers/lib/dealStatus.ts +42 -0
- package/src/modules/customers/lib/detailReadAccess.ts +35 -0
- package/src/modules/customers/lib/findPeopleByAddresses.ts +8 -6
- package/src/modules/customers/lib/personCompanies.ts +136 -1
- package/src/modules/customers/lib/todoCompatibility.ts +19 -1
- package/src/modules/dashboards/i18n/es.json +4 -4
- package/src/modules/dashboards/i18n/pl.json +7 -7
- package/src/modules/dashboards/lib/widgetScope.ts +6 -0
- package/src/modules/data_sync/AGENTS.md +1 -1
- package/src/modules/data_sync/backend/data-sync/page.tsx +4 -1
- package/src/modules/data_sync/lib/abandoned-run.ts +56 -0
- package/src/modules/data_sync/lib/adapter.ts +36 -0
- package/src/modules/data_sync/lib/sync-engine.ts +113 -5
- package/src/modules/data_sync/workers/sync-export.ts +4 -0
- package/src/modules/data_sync/workers/sync-import.ts +4 -0
- package/src/modules/devices/AGENTS.md +20 -1
- package/src/modules/devices/acl.ts +9 -1
- package/src/modules/devices/api/admin/devices/[id]/route.ts +5 -34
- package/src/modules/devices/api/admin/devices/route.ts +14 -1
- package/src/modules/devices/api/deviceList.ts +135 -11
- package/src/modules/devices/api/deviceSerialization.ts +50 -0
- package/src/modules/devices/api/openapi.ts +9 -1
- package/src/modules/devices/api/route.ts +9 -1
- package/src/modules/devices/backend/devices/[id]/page.tsx +18 -32
- package/src/modules/devices/backend/devices/create/page.tsx +17 -1
- package/src/modules/devices/backend/devices/page.tsx +44 -45
- package/src/modules/devices/backend/devices/useDeviceUserLabels.ts +45 -0
- package/src/modules/devices/backend/devices/userOptions.ts +99 -0
- package/src/modules/devices/i18n/de.json +3 -2
- package/src/modules/devices/i18n/en.json +3 -2
- package/src/modules/devices/i18n/es.json +3 -2
- package/src/modules/devices/i18n/ko.json +3 -2
- package/src/modules/devices/i18n/pl.json +3 -2
- package/src/modules/devices/setup.ts +6 -2
- package/src/modules/directory/backend/directory/organizations/page.tsx +3 -1
- package/src/modules/directory/backend/directory/tenants/page.tsx +3 -1
- package/src/modules/directory/di.ts +14 -2
- package/src/modules/directory/services/organizationHierarchyService.ts +34 -0
- package/src/modules/directory/services/organizationScopeService.ts +85 -0
- package/src/modules/directory/utils/organizationScope.ts +4 -15
- package/src/modules/entities/api/records.ts +2 -0
- package/src/modules/entities/backend/entities/user/[entityId]/records/page.tsx +4 -1
- package/src/modules/eudr/api/plots/route.ts +4 -0
- package/src/modules/eudr/backend/eudr/evidence-submissions/page.tsx +4 -0
- package/src/modules/eudr/backend/eudr/plots/page.tsx +4 -0
- package/src/modules/eudr/backend/eudr/product-mappings/page.tsx +4 -0
- package/src/modules/eudr/backend/eudr/risk-assessments/page.tsx +4 -0
- package/src/modules/eudr/backend/eudr/statements/page.tsx +4 -0
- package/src/modules/eudr/commands/statements.ts +0 -3
- package/src/modules/eudr/data/validators.ts +16 -1
- package/src/modules/feature_toggles/components/FeatureTogglesTable.tsx +2 -1
- package/src/modules/feature_toggles/components/OverridesTable.tsx +2 -1
- package/src/modules/feature_toggles/defaults.json +0 -8
- package/src/modules/inbox_ops/backend/inbox-ops/log/page.tsx +4 -0
- package/src/modules/inbox_ops/backend/inbox-ops/page.tsx +4 -0
- package/src/modules/inbox_ops/lib/htmlToPlainText.ts +1 -17
- package/src/modules/integrations/api/[id]/credentials/route.ts +6 -4
- package/src/modules/integrations/backend/integrations/[id]/page.tsx +61 -31
- package/src/modules/integrations/backend/integrations/bundle/[id]/page.tsx +44 -9
- package/src/modules/integrations/backend/integrations/credential-secret-fields.ts +84 -0
- package/src/modules/integrations/data/validators.ts +12 -2
- package/src/modules/integrations/i18n/de.json +1 -0
- package/src/modules/integrations/i18n/en.json +1 -0
- package/src/modules/integrations/i18n/es.json +1 -0
- package/src/modules/integrations/i18n/ko.json +1 -0
- package/src/modules/integrations/i18n/pl.json +1 -0
- package/src/modules/integrations/lib/credentials-masking.ts +10 -6
- package/src/modules/messages/api/[id]/route.ts +55 -1
- package/src/modules/messages/api/openapi.ts +20 -0
- package/src/modules/messages/api/route.ts +31 -2
- package/src/modules/messages/components/MessagesInboxPageClient.tsx +9 -16
- package/src/modules/messages/components/inboxFilters.ts +36 -0
- package/src/modules/messages/components/message-detail/hooks/useMessageDetailsConversation.ts +14 -1
- package/src/modules/messages/components/message-detail/panels/MessageHeader.tsx +3 -1
- package/src/modules/messages/components/message-detail/panels/thread-panel.tsx +2 -1
- package/src/modules/messages/components/message-detail/types.ts +3 -0
- package/src/modules/messages/components/messageListLabels.ts +52 -3
- package/src/modules/messages/data/validators.ts +43 -4
- package/src/modules/messages/lib/channel-sender-identity.ts +55 -0
- package/src/modules/messages/lib/composeSourceChannelType.ts +95 -0
- package/src/modules/payment_gateways/api/webhook/[provider]/route.ts +4 -6
- package/src/modules/payment_gateways/backend/payment-gateways/page.tsx +4 -1
- package/src/modules/payment_gateways/lib/webhook-processor.ts +11 -0
- package/src/modules/planner/backend/planner/availability-rulesets/page.tsx +4 -0
- package/src/modules/push_notifications/backend/push_notifications/page.tsx +4 -1
- package/src/modules/push_notifications/backend/push_notifications/send/page.tsx +4 -4
- package/src/modules/query_index/lib/engine.ts +249 -61
- package/src/modules/query_index/lib/search-entity-policy.ts +46 -0
- package/src/modules/query_index/lib/search-tokens.ts +135 -3
- package/src/modules/resources/backend/resources/resource-types/page.tsx +4 -1
- package/src/modules/resources/backend/resources/resources/page.tsx +4 -1
- package/src/modules/sales/backend/sales/channels/offers/page.tsx +4 -0
- package/src/modules/sales/backend/sales/channels/page.tsx +4 -0
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +14 -8
- package/src/modules/sales/commands/documents.ts +93 -0
- package/src/modules/sales/components/PriceWithCurrency.tsx +17 -5
- package/src/modules/sales/components/channels/SalesChannelOffersPanel.tsx +4 -0
- package/src/modules/sales/components/documents/AdjustmentsSection.tsx +6 -5
- package/src/modules/sales/components/documents/ItemsSection.tsx +56 -18
- package/src/modules/sales/components/documents/LineItemDialog.tsx +137 -20
- package/src/modules/sales/components/documents/PaymentsSection.tsx +20 -9
- package/src/modules/sales/components/documents/ReturnsSection.tsx +6 -5
- package/src/modules/sales/components/documents/SalesDocumentsTable.tsx +106 -14
- package/src/modules/sales/components/documents/SalesOrderDraftLines.tsx +6 -5
- package/src/modules/sales/components/documents/ShipmentDialog.tsx +5 -4
- package/src/modules/sales/components/documents/ShipmentsSection.tsx +6 -5
- package/src/modules/sales/components/documents/lineItemShipmentLock.ts +74 -0
- package/src/modules/sales/components/documents/lineItemUtils.ts +7 -2
- package/src/modules/sales/data/entities.ts +6 -0
- package/src/modules/sales/extension-points.ts +1 -0
- package/src/modules/sales/i18n/de.json +8 -0
- package/src/modules/sales/i18n/en.json +8 -0
- package/src/modules/sales/i18n/es.json +8 -0
- package/src/modules/sales/i18n/ko.json +8 -0
- package/src/modules/sales/i18n/pl.json +8 -0
- package/src/modules/sales/lib/salesChannelsToggleSeed.ts +42 -0
- package/src/modules/sales/migrations/.snapshot-open-mercato.json +60 -0
- package/src/modules/sales/migrations/Migration20260821120000_sales_notes_addresses_context_idx.ts +87 -0
- package/src/modules/sales/setup.ts +2 -0
- package/src/modules/sales/widgets/injection/payment-gateway-status-column/widget.ts +9 -1
- package/src/modules/sales/widgets/injection-table.ts +4 -7
- package/src/modules/staff/backend/staff/leave-requests/page.tsx +4 -0
- package/src/modules/staff/backend/staff/my-leave-requests/page.tsx +4 -0
- package/src/modules/staff/backend/staff/team-members/page.tsx +6 -0
- package/src/modules/staff/backend/staff/team-roles/page.tsx +4 -0
- package/src/modules/staff/backend/staff/teams/[id]/edit/page.tsx +4 -0
- package/src/modules/staff/backend/staff/teams/page.tsx +4 -0
- package/src/modules/staff/backend/staff/timesheets/page.tsx +12 -1
- package/src/modules/staff/backend/staff/timesheets/projects/page.tsx +4 -0
- package/src/modules/sync_excel/lib/adapters/customers.ts +5 -0
- package/src/modules/warranty_claims/api/assignees/route.ts +3 -3
- package/src/modules/warranty_claims/api/portal/attachments/route.ts +2 -2
- package/src/modules/warranty_claims/api/portal/claims/route.ts +12 -9
- package/src/modules/warranty_claims/backend/page.tsx +4 -0
- package/src/modules/warranty_claims/backend/warranty_claims/registrations/page.tsx +4 -0
- package/src/modules/warranty_claims/backend/warranty_claims/troubleshooting-guides/page.tsx +4 -0
- package/src/modules/warranty_claims/backend/warranty_claims/vendor-policies/page.tsx +4 -0
- package/src/modules/warranty_claims/frontend/[orgSlug]/portal/claims/page.tsx +4 -0
- package/src/modules/wms/api/warehouseSearch.ts +23 -0
- package/src/modules/wms/api/warehouses/route.ts +13 -9
- package/src/modules/wms/api/zones/route.ts +16 -0
- package/src/modules/wms/commands/configuration.ts +159 -10
- package/src/modules/wms/commands/inventory-actions.ts +3 -0
- package/src/modules/wms/commands/shared.ts +17 -0
- package/src/modules/wms/components/backend/WarehouseEditDialog.tsx +216 -0
- package/src/modules/wms/components/backend/WmsConfigurationPage.tsx +95 -141
- package/src/modules/wms/components/backend/WmsInventoryConsolePage.tsx +2 -0
- package/src/modules/wms/components/backend/WmsLotsListPage.tsx +2 -0
- package/src/modules/wms/components/backend/inventoryMutationLoaders.ts +36 -20
- package/src/modules/wms/components/backend/warehouseFormOptions.ts +72 -0
- package/src/modules/wms/i18n/de.json +2 -0
- package/src/modules/wms/i18n/en.json +2 -0
- package/src/modules/wms/i18n/es.json +2 -0
- package/src/modules/wms/i18n/ko.json +2 -0
- package/src/modules/wms/i18n/pl.json +2 -0
- package/src/modules/workflows/backend/definitions/page.tsx +4 -1
- package/src/modules/workflows/backend/events/page.tsx +4 -1
- package/src/modules/workflows/backend/instances/page.tsx +4 -1
- package/src/modules/workflows/backend/tasks/page.tsx +4 -1
- package/src/modules/workflows/lib/activity-executor.ts +9 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/modules/customers/backend/customers/deals/pipeline/components/Lane.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useDroppable } from '@dnd-kit/core'\nimport { EmptyState } from '@open-mercato/ui/primitives/empty-state'\nimport type { RowActionItem } from '@open-mercato/ui/backend/RowActions'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { translateWithFallback } from '@open-mercato/shared/lib/i18n/translate'\nimport type { FilterOptionTone } from '@open-mercato/shared/lib/query/advanced-filter'\nimport { DealCard, type DealCardData } from './DealCard'\nimport { DashedTileButton } from './DashedTileButton'\nimport { LANE_WIDTH_PX } from './constants'\nimport { LaneCurrencyBreakdown } from './LaneCurrencyBreakdown'\nimport { LaneResizeHandle } from './LaneResizeHandle'\n\nexport type LaneStage = {\n id: string\n label: string\n tone: FilterOptionTone | null\n}\n\nexport type LaneAggregateProp = {\n count: number\n totalInBaseCurrency: number\n byCurrency: Array<{ currency: string; total: number; count: number }>\n baseCurrencyCode: string | null\n /** `true` when every currency in `byCurrency` was convertible to the base currency. */\n convertedAll: boolean\n /** Currencies present in `byCurrency` that lack an FX rate to base \u2014 excluded from totals. */\n missingRateCurrencies: string[]\n}\n\ntype LaneProps = {\n stage: LaneStage\n deals: DealCardData[]\n /** Server-side aggregate for accurate counts/totals across all deals in this stage, not just loaded ones */\n aggregate?: LaneAggregateProp | null\n selectedDealIds: Set<string>\n buildMenuItems: (deal: DealCardData) => RowActionItem[]\n activeDragDealId?: string | null\n isLoadingMore?: boolean\n /** Pixel width override (when the user has resized the column). Falls back to the default class. */\n width?: number | null\n onToggleSelect: (dealId: string) => void\n onComposeActivity: (dealId: string, type: 'call' | 'email' | 'note') => void\n onOpenDetail: (dealId: string) => void\n onQuickAddClick: (stageId: string) => void\n onLoadMore?: (stageId: string) => void\n /** Drag-resize callbacks. When provided, a vertical drag handle is rendered on the lane edge. */\n onResize?: (stageId: string, deltaPx: number) => void\n onResizeEnd?: (stageId: string) => void\n onResetWidth?: (stageId: string) => void\n}\n\n// 4px color bar tone \u2014 uses saturated icon tokens so the bar is visibly colored, not pale\nconst ACCENT_TONE_CLASS: Record<FilterOptionTone, string> = {\n success: 'bg-status-success-icon',\n error: 'bg-status-error-icon',\n warning: 'bg-status-warning-icon',\n info: 'bg-status-info-icon',\n neutral: 'bg-status-neutral-icon',\n brand: 'bg-brand-violet',\n pink: 'bg-status-pink-icon',\n}\n\n// Count pill bg uses very-light status background, text uses status text color\nconst COUNT_BADGE_TONE_CLASS: Record<FilterOptionTone, string> = {\n success: 'bg-status-success-bg text-status-success-text',\n error: 'bg-status-error-bg text-status-error-text',\n warning: 'bg-status-warning-bg text-status-warning-text',\n info: 'bg-status-info-bg text-status-info-text',\n neutral: 'bg-status-neutral-bg text-status-neutral-text',\n brand: 'bg-brand-violet/14 text-brand-violet',\n pink: 'bg-status-pink-bg text-status-pink-text',\n}\n\nfunction getAccentClass(tone: FilterOptionTone | null): string {\n if (tone && tone in ACCENT_TONE_CLASS) return ACCENT_TONE_CLASS[tone]\n return 'bg-border'\n}\n\nfunction getCountBadgeClass(tone: FilterOptionTone | null): string {\n if (tone && tone in COUNT_BADGE_TONE_CLASS) return COUNT_BADGE_TONE_CLASS[tone]\n return 'bg-muted text-muted-foreground'\n}\n\nfunction compactCurrency(amount: number): string {\n if (amount >= 1_000_000) {\n const value = amount / 1_000_000\n return value >= 100 ? `${Math.round(value)}M` : `${value.toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (amount >= 1_000) {\n const value = amount / 1_000\n return value >= 100 ? `${Math.round(value)}k` : `${value.toFixed(1).replace(/\\.0$/, '')}k`\n }\n return String(Math.round(amount))\n}\n\ntype CurrencyRow = { currency: string; total: number; count: number }\n\ntype LaneStats = {\n count: number\n /** Headline amount and the currency it is denominated in (largest single currency, raw, never converted). */\n primaryAmount: number\n primaryCurrency: string | null\n /** Per-currency rows sorted desc by total \u2014 the popover renders these one per line. */\n rows: CurrencyRow[]\n /** Sum of `rows` converted to base currency (zero when no base is configured / nothing converted). */\n totalInBaseCurrency: number\n baseCurrencyCode: string | null\n convertedAll: boolean\n missingRateCurrencies: string[]\n}\n\n/**\n * Build display stats.\n * - If a server aggregate is provided, prefer it (covers all deals, converts to tenant base currency).\n * - Otherwise fall back to summing loaded deals (used before aggregate query loads).\n *\n * The headline currency on the lane header is intentionally the LARGEST raw currency\n * (not the base-currency converted total) because the converted total can be misleading\n * when FX rates are missing \u2014 operators see a smaller number than the headline suggests.\n * The base-currency converted total is reserved for the breakdown popover footer, where\n * a partial-conversion indicator can disclose what's excluded.\n */\nfunction buildLaneStats(deals: DealCardData[], aggregate?: LaneAggregateProp | null): LaneStats {\n if (aggregate) {\n const rows = aggregate.byCurrency\n // Pick the single currency with the largest raw total to surface in the header. This\n // is always honest: the operator sees the actual largest cluster of value rather than\n // a synthetic base-currency total that may be partial.\n const headline = rows.length > 0 ? rows[0] : null\n return {\n count: aggregate.count,\n primaryAmount: headline ? headline.total : 0,\n primaryCurrency: headline ? headline.currency : null,\n rows,\n totalInBaseCurrency: aggregate.totalInBaseCurrency,\n baseCurrencyCode: aggregate.baseCurrencyCode,\n convertedAll: aggregate.convertedAll,\n missingRateCurrencies: aggregate.missingRateCurrencies,\n }\n }\n const totalsByCurrency = new Map<string, { total: number; count: number }>()\n for (const deal of deals) {\n if (typeof deal.valueAmount !== 'number' || !Number.isFinite(deal.valueAmount)) continue\n const code = deal.valueCurrency && deal.valueCurrency.length === 3\n ? deal.valueCurrency.toUpperCase()\n : 'USD'\n const entry = totalsByCurrency.get(code) ?? { total: 0, count: 0 }\n entry.total += deal.valueAmount\n entry.count += 1\n totalsByCurrency.set(code, entry)\n }\n const rows: CurrencyRow[] = Array.from(totalsByCurrency.entries())\n .map(([currency, value]) => ({ currency, total: value.total, count: value.count }))\n .sort((a, b) => b.total - a.total)\n if (rows.length === 0) {\n return {\n count: deals.length,\n primaryAmount: 0,\n primaryCurrency: null,\n rows,\n totalInBaseCurrency: 0,\n baseCurrencyCode: null,\n convertedAll: true,\n missingRateCurrencies: [],\n }\n }\n return {\n count: deals.length,\n primaryAmount: rows[0].total,\n primaryCurrency: rows[0].currency,\n rows,\n totalInBaseCurrency: 0,\n baseCurrencyCode: null,\n // We don't have rates client-side; mark as \"not converted\" only when there are\n // multiple currencies so the popover can show a \"configure FX rates\" hint.\n convertedAll: rows.length === 1,\n missingRateCurrencies: rows.length > 1 ? rows.slice(1).map((row) => row.currency) : [],\n }\n}\n\nfunction LaneImpl({\n stage,\n deals,\n aggregate,\n selectedDealIds,\n buildMenuItems,\n activeDragDealId,\n isLoadingMore = false,\n width,\n onToggleSelect,\n onComposeActivity,\n onOpenDetail,\n onQuickAddClick,\n onLoadMore,\n onResize,\n onResizeEnd,\n onResetWidth,\n}: LaneProps): React.ReactElement {\n const t = useT()\n const { setNodeRef, isOver } = useDroppable({\n id: `lane:${stage.id}`,\n data: { type: 'lane', stageId: stage.id },\n })\n const isDragActive = !!activeDragDealId\n const sourceLane = isDragActive && deals.some((deal) => deal.id === activeDragDealId)\n // Highlight drop zone when:\n // - the lane has the pointer over it during a drag, OR\n // - any drag is active and this lane is not the source (so all candidate targets are clearly tagged)\n const showDropHighlight = isOver || (isDragActive && !sourceLane)\n const stats = React.useMemo(() => buildLaneStats(deals, aggregate), [deals, aggregate])\n // Pull boolean out of the Set so each DealCard receives a stable primitive \u2014 that lets\n // React.memo on DealCard skip re-renders when the Set reference changes but its emptiness\n // does not. Flipping false\u2192true (first selection) or true\u2192false (last cleared) forces a\n // full pass over the lane's cards so their checkbox visibility updates atomically.\n const bulkSelectionActive = selectedDealIds.size > 0\n const totalLabel = stats.primaryAmount > 0 && stats.primaryCurrency\n ? `${compactCurrency(stats.primaryAmount)} ${stats.primaryCurrency}`\n : null\n const visibleCount = deals.length\n const totalCount = stats.count\n const hasMoreDeals = totalCount > visibleCount\n const accentClass = getAccentClass(stage.tone)\n const countBadgeClass = getCountBadgeClass(stage.tone)\n\n const handleQuickAdd = React.useCallback(() => {\n onQuickAddClick(stage.id)\n }, [onQuickAddClick, stage.id])\n\n return (\n <div\n className=\"relative flex flex-none flex-col gap-3\"\n style={{ width: typeof width === 'number' && Number.isFinite(width) ? `${width}px` : `${LANE_WIDTH_PX}px` }}\n >\n <div className=\"flex flex-col gap-2.5 overflow-clip rounded-lg bg-muted/40 px-4 py-3.5\">\n <div className={`h-1.5 w-full rounded-sm ${accentClass}`} aria-hidden=\"true\" />\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2.5\">\n <span className=\"truncate text-sm font-bold uppercase leading-normal text-foreground\">\n {stage.label}\n </span>\n <span\n className={`inline-flex shrink-0 items-center rounded-full px-2 py-1 text-xs font-bold leading-normal ${countBadgeClass}`}\n title={\n hasMoreDeals\n ? translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.partialCount',\n 'Showing {visible} of {total}',\n { visible: visibleCount, total: totalCount },\n )\n : undefined\n }\n >\n {totalCount}\n </span>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {totalLabel ? (\n <span className=\"text-sm font-bold leading-normal text-foreground\">\n {totalLabel}\n </span>\n ) : null}\n {stats.rows.length > 1 ? (\n <LaneCurrencyBreakdown\n rows={stats.rows}\n baseCurrencyCode={stats.baseCurrencyCode}\n totalInBaseCurrency={stats.totalInBaseCurrency}\n convertedAll={stats.convertedAll}\n missingRateCurrencies={stats.missingRateCurrencies}\n triggerLabel={`+${stats.rows.length - 1}`}\n headingLabel={stage.label.toUpperCase()}\n headingCount={totalCount}\n />\n ) : null}\n </div>\n </div>\n </div>\n\n <DashedTileButton\n onClick={handleQuickAdd}\n className=\"h-11\"\n ariaLabel={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.quickAdd',\n 'Quickly add a deal to {stage}',\n { stage: stage.label },\n )}\n >\n <span className=\"text-base font-bold leading-none\">+</span>\n <span>{translateWithFallback(t, 'customers.deals.kanban.cta.quickDeal', 'Quick deal')}</span>\n </DashedTileButton>\n\n <div\n ref={setNodeRef}\n className={`flex min-h-[40vh] flex-col gap-3 rounded-lg p-1.5 ${\n isOver\n ? 'bg-accent-indigo/10 outline-dashed outline-2 outline-accent-indigo -outline-offset-[2px]'\n : showDropHighlight\n ? 'bg-muted/40 outline-dashed outline-1 outline-muted-foreground/40 -outline-offset-[2px]'\n : ''\n }`}\n >\n {deals.length === 0 ? (\n <EmptyState\n size=\"sm\"\n title={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.empty',\n 'No deals in this stage yet.',\n )}\n />\n ) : (\n deals.map((deal) => (\n <DealCard\n key={deal.id}\n deal={deal}\n selected={selectedDealIds.has(deal.id)}\n bulkSelectionActive={bulkSelectionActive}\n buildMenuItems={buildMenuItems}\n isActiveDrag={activeDragDealId === deal.id}\n onToggleSelect={onToggleSelect}\n onComposeActivity={onComposeActivity}\n onOpenDetail={onOpenDetail}\n />\n ))\n )}\n {hasMoreDeals && onLoadMore ? (\n <DashedTileButton\n onClick={() => onLoadMore(stage.id)}\n disabled={isLoadingMore}\n className=\"mt-0.75 px-3 py-2.5 text-muted-foreground\"\n ariaLabel={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.loadMore',\n 'Load more deals in {stage}',\n { stage: stage.label },\n )}\n >\n {isLoadingMore\n ? translateWithFallback(t, 'customers.deals.kanban.lane.loadingMore', 'Loading\u2026')\n : translateWithFallback(\n t,\n 'customers.deals.kanban.lane.loadMore',\n 'Show more ({remaining})',\n { remaining: totalCount - visibleCount },\n )}\n </DashedTileButton>\n ) : null}\n </div>\n {onResize ? (\n <LaneResizeHandle\n onResize={(delta) => onResize(stage.id, delta)}\n onResizeEnd={() => onResizeEnd?.(stage.id)}\n onReset={() => onResetWidth?.(stage.id)}\n />\n ) : null}\n </div>\n )\n}\n\n// Memoize the lane so changes in a different lane (or in the active drag) don't re-render us.\n// Page passes booleans (isDragActive) instead of activeDragDealId so most lanes can skip re-rendering.\nexport const Lane = React.memo(LaneImpl, (prev, next) => {\n if (prev.stage !== next.stage) return false\n if (prev.deals !== next.deals) return false\n if (prev.aggregate !== next.aggregate) return false\n if (prev.selectedDealIds !== next.selectedDealIds) return false\n if (prev.buildMenuItems !== next.buildMenuItems) return false\n if (prev.activeDragDealId !== next.activeDragDealId) return false\n if (prev.isLoadingMore !== next.isLoadingMore) return false\n if (prev.width !== next.width) return false\n return true\n})\n\nexport default Lane\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useDroppable } from '@dnd-kit/core'\nimport { EmptyState } from '@open-mercato/ui/primitives/empty-state'\nimport type { RowActionItem } from '@open-mercato/ui/backend/RowActions'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { translateWithFallback } from '@open-mercato/shared/lib/i18n/translate'\nimport type { FilterOptionTone } from '@open-mercato/shared/lib/query/advanced-filter'\nimport { toneToDotClass } from './toneClasses'\nimport { DealCard, type DealCardData } from './DealCard'\nimport { DashedTileButton } from './DashedTileButton'\nimport { LANE_WIDTH_PX } from './constants'\nimport { LaneCurrencyBreakdown } from './LaneCurrencyBreakdown'\nimport { LaneResizeHandle } from './LaneResizeHandle'\n\nexport type LaneStage = {\n id: string\n label: string\n tone: FilterOptionTone | null\n}\n\nexport type LaneAggregateProp = {\n count: number\n totalInBaseCurrency: number\n byCurrency: Array<{ currency: string; total: number; count: number }>\n baseCurrencyCode: string | null\n /** `true` when every currency in `byCurrency` was convertible to the base currency. */\n convertedAll: boolean\n /** Currencies present in `byCurrency` that lack an FX rate to base \u2014 excluded from totals. */\n missingRateCurrencies: string[]\n}\n\ntype LaneProps = {\n stage: LaneStage\n deals: DealCardData[]\n /** Server-side aggregate for accurate counts/totals across all deals in this stage, not just loaded ones */\n aggregate?: LaneAggregateProp | null\n selectedDealIds: Set<string>\n buildMenuItems: (deal: DealCardData) => RowActionItem[]\n activeDragDealId?: string | null\n isLoadingMore?: boolean\n /** Pixel width override (when the user has resized the column). Falls back to the default class. */\n width?: number | null\n onToggleSelect: (dealId: string) => void\n onComposeActivity: (dealId: string, type: 'call' | 'email' | 'note') => void\n onOpenDetail: (dealId: string) => void\n onQuickAddClick: (stageId: string) => void\n onLoadMore?: (stageId: string) => void\n /** Drag-resize callbacks. When provided, a vertical drag handle is rendered on the lane edge. */\n onResize?: (stageId: string, deltaPx: number) => void\n onResizeEnd?: (stageId: string) => void\n onResetWidth?: (stageId: string) => void\n}\n\n// 4px color bar tone \u2014 saturated icon tokens shared with the status filter pills\n// (toneClasses.ts) so the lane bar and the filter dots stay in lockstep (#5107 review).\nfunction getAccentClass(tone: FilterOptionTone | null): string {\n return toneToDotClass(tone, 'bg-border')\n}\n\n// Count pill bg uses very-light status background, text uses status text color\nconst COUNT_BADGE_TONE_CLASS: Record<FilterOptionTone, string> = {\n success: 'bg-status-success-bg text-status-success-text',\n error: 'bg-status-error-bg text-status-error-text',\n warning: 'bg-status-warning-bg text-status-warning-text',\n info: 'bg-status-info-bg text-status-info-text',\n neutral: 'bg-status-neutral-bg text-status-neutral-text',\n brand: 'bg-brand-violet/14 text-brand-violet',\n pink: 'bg-status-pink-bg text-status-pink-text',\n}\n\nfunction getCountBadgeClass(tone: FilterOptionTone | null): string {\n if (tone && tone in COUNT_BADGE_TONE_CLASS) return COUNT_BADGE_TONE_CLASS[tone]\n return 'bg-muted text-muted-foreground'\n}\n\nfunction compactCurrency(amount: number): string {\n if (amount >= 1_000_000) {\n const value = amount / 1_000_000\n return value >= 100 ? `${Math.round(value)}M` : `${value.toFixed(1).replace(/\\.0$/, '')}M`\n }\n if (amount >= 1_000) {\n const value = amount / 1_000\n return value >= 100 ? `${Math.round(value)}k` : `${value.toFixed(1).replace(/\\.0$/, '')}k`\n }\n return String(Math.round(amount))\n}\n\ntype CurrencyRow = { currency: string; total: number; count: number }\n\ntype LaneStats = {\n count: number\n /** Headline amount and the currency it is denominated in (largest single currency, raw, never converted). */\n primaryAmount: number\n primaryCurrency: string | null\n /** Per-currency rows sorted desc by total \u2014 the popover renders these one per line. */\n rows: CurrencyRow[]\n /** Sum of `rows` converted to base currency (zero when no base is configured / nothing converted). */\n totalInBaseCurrency: number\n baseCurrencyCode: string | null\n convertedAll: boolean\n missingRateCurrencies: string[]\n}\n\n/**\n * Build display stats.\n * - If a server aggregate is provided, prefer it (covers all deals, converts to tenant base currency).\n * - Otherwise fall back to summing loaded deals (used before aggregate query loads).\n *\n * The headline currency on the lane header is intentionally the LARGEST raw currency\n * (not the base-currency converted total) because the converted total can be misleading\n * when FX rates are missing \u2014 operators see a smaller number than the headline suggests.\n * The base-currency converted total is reserved for the breakdown popover footer, where\n * a partial-conversion indicator can disclose what's excluded.\n */\nfunction buildLaneStats(deals: DealCardData[], aggregate?: LaneAggregateProp | null): LaneStats {\n if (aggregate) {\n const rows = aggregate.byCurrency\n // Pick the single currency with the largest raw total to surface in the header. This\n // is always honest: the operator sees the actual largest cluster of value rather than\n // a synthetic base-currency total that may be partial.\n const headline = rows.length > 0 ? rows[0] : null\n return {\n count: aggregate.count,\n primaryAmount: headline ? headline.total : 0,\n primaryCurrency: headline ? headline.currency : null,\n rows,\n totalInBaseCurrency: aggregate.totalInBaseCurrency,\n baseCurrencyCode: aggregate.baseCurrencyCode,\n convertedAll: aggregate.convertedAll,\n missingRateCurrencies: aggregate.missingRateCurrencies,\n }\n }\n const totalsByCurrency = new Map<string, { total: number; count: number }>()\n for (const deal of deals) {\n if (typeof deal.valueAmount !== 'number' || !Number.isFinite(deal.valueAmount)) continue\n const code = deal.valueCurrency && deal.valueCurrency.length === 3\n ? deal.valueCurrency.toUpperCase()\n : 'USD'\n const entry = totalsByCurrency.get(code) ?? { total: 0, count: 0 }\n entry.total += deal.valueAmount\n entry.count += 1\n totalsByCurrency.set(code, entry)\n }\n const rows: CurrencyRow[] = Array.from(totalsByCurrency.entries())\n .map(([currency, value]) => ({ currency, total: value.total, count: value.count }))\n .sort((a, b) => b.total - a.total)\n if (rows.length === 0) {\n return {\n count: deals.length,\n primaryAmount: 0,\n primaryCurrency: null,\n rows,\n totalInBaseCurrency: 0,\n baseCurrencyCode: null,\n convertedAll: true,\n missingRateCurrencies: [],\n }\n }\n return {\n count: deals.length,\n primaryAmount: rows[0].total,\n primaryCurrency: rows[0].currency,\n rows,\n totalInBaseCurrency: 0,\n baseCurrencyCode: null,\n // We don't have rates client-side; mark as \"not converted\" only when there are\n // multiple currencies so the popover can show a \"configure FX rates\" hint.\n convertedAll: rows.length === 1,\n missingRateCurrencies: rows.length > 1 ? rows.slice(1).map((row) => row.currency) : [],\n }\n}\n\nfunction LaneImpl({\n stage,\n deals,\n aggregate,\n selectedDealIds,\n buildMenuItems,\n activeDragDealId,\n isLoadingMore = false,\n width,\n onToggleSelect,\n onComposeActivity,\n onOpenDetail,\n onQuickAddClick,\n onLoadMore,\n onResize,\n onResizeEnd,\n onResetWidth,\n}: LaneProps): React.ReactElement {\n const t = useT()\n const { setNodeRef, isOver } = useDroppable({\n id: `lane:${stage.id}`,\n data: { type: 'lane', stageId: stage.id },\n })\n const isDragActive = !!activeDragDealId\n const sourceLane = isDragActive && deals.some((deal) => deal.id === activeDragDealId)\n // Highlight drop zone when:\n // - the lane has the pointer over it during a drag, OR\n // - any drag is active and this lane is not the source (so all candidate targets are clearly tagged)\n const showDropHighlight = isOver || (isDragActive && !sourceLane)\n const stats = React.useMemo(() => buildLaneStats(deals, aggregate), [deals, aggregate])\n // Pull boolean out of the Set so each DealCard receives a stable primitive \u2014 that lets\n // React.memo on DealCard skip re-renders when the Set reference changes but its emptiness\n // does not. Flipping false\u2192true (first selection) or true\u2192false (last cleared) forces a\n // full pass over the lane's cards so their checkbox visibility updates atomically.\n const bulkSelectionActive = selectedDealIds.size > 0\n const totalLabel = stats.primaryAmount > 0 && stats.primaryCurrency\n ? `${compactCurrency(stats.primaryAmount)} ${stats.primaryCurrency}`\n : null\n const visibleCount = deals.length\n const totalCount = stats.count\n const hasMoreDeals = totalCount > visibleCount\n const accentClass = getAccentClass(stage.tone)\n const countBadgeClass = getCountBadgeClass(stage.tone)\n\n const handleQuickAdd = React.useCallback(() => {\n onQuickAddClick(stage.id)\n }, [onQuickAddClick, stage.id])\n\n return (\n <div\n className=\"relative flex flex-none flex-col gap-3\"\n style={{ width: typeof width === 'number' && Number.isFinite(width) ? `${width}px` : `${LANE_WIDTH_PX}px` }}\n >\n <div className=\"flex flex-col gap-2.5 overflow-clip rounded-lg bg-muted/40 px-4 py-3.5\">\n <div className={`h-1.5 w-full rounded-sm ${accentClass}`} aria-hidden=\"true\" />\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2.5\">\n <span className=\"truncate text-sm font-bold uppercase leading-normal text-foreground\">\n {stage.label}\n </span>\n <span\n className={`inline-flex shrink-0 items-center rounded-full px-2 py-1 text-xs font-bold leading-normal ${countBadgeClass}`}\n title={\n hasMoreDeals\n ? translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.partialCount',\n 'Showing {visible} of {total}',\n { visible: visibleCount, total: totalCount },\n )\n : undefined\n }\n >\n {totalCount}\n </span>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {totalLabel ? (\n <span className=\"text-sm font-bold leading-normal text-foreground\">\n {totalLabel}\n </span>\n ) : null}\n {stats.rows.length > 1 ? (\n <LaneCurrencyBreakdown\n rows={stats.rows}\n baseCurrencyCode={stats.baseCurrencyCode}\n totalInBaseCurrency={stats.totalInBaseCurrency}\n convertedAll={stats.convertedAll}\n missingRateCurrencies={stats.missingRateCurrencies}\n triggerLabel={`+${stats.rows.length - 1}`}\n headingLabel={stage.label.toUpperCase()}\n headingCount={totalCount}\n />\n ) : null}\n </div>\n </div>\n </div>\n\n <DashedTileButton\n onClick={handleQuickAdd}\n className=\"h-11\"\n ariaLabel={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.quickAdd',\n 'Quickly add a deal to {stage}',\n { stage: stage.label },\n )}\n >\n <span className=\"text-base font-bold leading-none\">+</span>\n <span>{translateWithFallback(t, 'customers.deals.kanban.cta.quickDeal', 'Quick deal')}</span>\n </DashedTileButton>\n\n <div\n ref={setNodeRef}\n className={`flex min-h-[40vh] flex-col gap-3 rounded-lg p-1.5 ${\n isOver\n ? 'bg-accent-indigo/10 outline-dashed outline-2 outline-accent-indigo -outline-offset-[2px]'\n : showDropHighlight\n ? 'bg-muted/40 outline-dashed outline-1 outline-muted-foreground/40 -outline-offset-[2px]'\n : ''\n }`}\n >\n {deals.length === 0 ? (\n <EmptyState\n size=\"sm\"\n title={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.empty',\n 'No deals in this stage yet.',\n )}\n />\n ) : (\n deals.map((deal) => (\n <DealCard\n key={deal.id}\n deal={deal}\n selected={selectedDealIds.has(deal.id)}\n bulkSelectionActive={bulkSelectionActive}\n buildMenuItems={buildMenuItems}\n isActiveDrag={activeDragDealId === deal.id}\n onToggleSelect={onToggleSelect}\n onComposeActivity={onComposeActivity}\n onOpenDetail={onOpenDetail}\n />\n ))\n )}\n {hasMoreDeals && onLoadMore ? (\n <DashedTileButton\n onClick={() => onLoadMore(stage.id)}\n disabled={isLoadingMore}\n className=\"mt-0.75 px-3 py-2.5 text-muted-foreground\"\n ariaLabel={translateWithFallback(\n t,\n 'customers.deals.kanban.lane.aria.loadMore',\n 'Load more deals in {stage}',\n { stage: stage.label },\n )}\n >\n {isLoadingMore\n ? translateWithFallback(t, 'customers.deals.kanban.lane.loadingMore', 'Loading\u2026')\n : translateWithFallback(\n t,\n 'customers.deals.kanban.lane.loadMore',\n 'Show more ({remaining})',\n { remaining: totalCount - visibleCount },\n )}\n </DashedTileButton>\n ) : null}\n </div>\n {onResize ? (\n <LaneResizeHandle\n onResize={(delta) => onResize(stage.id, delta)}\n onResizeEnd={() => onResizeEnd?.(stage.id)}\n onReset={() => onResetWidth?.(stage.id)}\n />\n ) : null}\n </div>\n )\n}\n\n// Memoize the lane so changes in a different lane (or in the active drag) don't re-render us.\n// Page passes booleans (isDragActive) instead of activeDragDealId so most lanes can skip re-rendering.\nexport const Lane = React.memo(LaneImpl, (prev, next) => {\n if (prev.stage !== next.stage) return false\n if (prev.deals !== next.deals) return false\n if (prev.aggregate !== next.aggregate) return false\n if (prev.selectedDealIds !== next.selectedDealIds) return false\n if (prev.buildMenuItems !== next.buildMenuItems) return false\n if (prev.activeDragDealId !== next.activeDragDealId) return false\n if (prev.isLoadingMore !== next.isLoadingMore) return false\n if (prev.width !== next.width) return false\n return true\n})\n\nexport default Lane\n"],
|
|
5
|
+
"mappings": ";AAoOQ,cAEE,YAFF;AAlOR,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAE3B,SAAS,YAAY;AACrB,SAAS,6BAA6B;AAEtC,SAAS,sBAAsB;AAC/B,SAAS,gBAAmC;AAC5C,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AA2CjC,SAAS,eAAe,MAAuC;AAC7D,SAAO,eAAe,MAAM,WAAW;AACzC;AAGA,MAAM,yBAA2D;AAAA,EAC/D,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AACR;AAEA,SAAS,mBAAmB,MAAuC;AACjE,MAAI,QAAQ,QAAQ,uBAAwB,QAAO,uBAAuB,IAAI;AAC9E,SAAO;AACT;AAEA,SAAS,gBAAgB,QAAwB;AAC/C,MAAI,UAAU,KAAW;AACvB,UAAM,QAAQ,SAAS;AACvB,WAAO,SAAS,MAAM,GAAG,KAAK,MAAM,KAAK,CAAC,MAAM,GAAG,MAAM,QAAQ,CAAC,EAAE,QAAQ,QAAQ,EAAE,CAAC;AAAA,EACzF;AACA,MAAI,UAAU,KAAO;AAC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a,aAAa;AAAA,kBACzC;AAAA;AAAA,cACN,IACE;AAAA;AAAA;AAAA,QACN;AAAA,QACC,WACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,CAAC,UAAU,SAAS,MAAM,IAAI,KAAK;AAAA,YAC7C,aAAa,MAAM,cAAc,MAAM,EAAE;AAAA,YACzC,SAAS,MAAM,eAAe,MAAM,EAAE;AAAA;AAAA,QACxC,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;AAIO,MAAM,OAAO,MAAM,KAAK,UAAU,CAAC,MAAM,SAAS;AACvD,MAAI,KAAK,UAAU,KAAK,MAAO,QAAO;AACtC,MAAI,KAAK,UAAU,KAAK,MAAO,QAAO;AACtC,MAAI,KAAK,cAAc,KAAK,UAAW,QAAO;AAC9C,MAAI,KAAK,oBAAoB,KAAK,gBAAiB,QAAO;AAC1D,MAAI,KAAK,mBAAmB,KAAK,eAAgB,QAAO;AACxD,MAAI,KAAK,qBAAqB,KAAK,iBAAkB,QAAO;AAC5D,MAAI,KAAK,kBAAkB,KAAK,cAAe,QAAO;AACtD,MAAI,KAAK,UAAU,KAAK,MAAO,QAAO;AACtC,SAAO;AACT,CAAC;AAED,IAAO,eAAQ;",
|
|
6
6
|
"names": ["rows"]
|
|
7
7
|
}
|
package/dist/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.js
CHANGED
|
@@ -10,43 +10,107 @@ import {
|
|
|
10
10
|
} from "@open-mercato/ui/primitives/popover";
|
|
11
11
|
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
12
12
|
import { translateWithFallback } from "@open-mercato/shared/lib/i18n/translate";
|
|
13
|
+
import { useOrganizationScopeVersion } from "@open-mercato/shared/lib/frontend/useOrganizationScope";
|
|
14
|
+
import { mapDictionaryColorToTone } from "@open-mercato/shared/lib/query/advanced-filter";
|
|
15
|
+
import { Spinner } from "@open-mercato/ui/primitives/spinner";
|
|
16
|
+
import { useCustomerDictionary } from "../../../../../components/detail/hooks/useCustomerDictionary.js";
|
|
17
|
+
import { canonicalDealStatus } from "../../../../../lib/dealStatus.js";
|
|
18
|
+
import { toneToDotClass } from "./toneClasses.js";
|
|
13
19
|
import { ChipButton } from "./ChipButton.js";
|
|
14
20
|
import { FilterPopoverShell } from "./FilterPopoverShell.js";
|
|
15
|
-
const
|
|
21
|
+
const FALLBACK_STATUS_OPTIONS = [
|
|
16
22
|
{
|
|
17
23
|
value: "open",
|
|
18
24
|
labelKey: "customers.deals.kanban.filter.status.open",
|
|
19
25
|
labelFallback: "Open",
|
|
20
|
-
|
|
26
|
+
// Tones mirror mapDictionaryColorToTone over the seeded dictionary colors
|
|
27
|
+
// (#2563eb → info, #22c55e → success, #ef4444 → error) so the fallback pills
|
|
28
|
+
// render identically to the dictionary-driven ones.
|
|
29
|
+
dotClass: "bg-status-info-icon"
|
|
21
30
|
},
|
|
22
31
|
{
|
|
23
32
|
value: "win",
|
|
24
33
|
labelKey: "customers.deals.kanban.filter.status.won",
|
|
25
34
|
labelFallback: "Won",
|
|
26
|
-
dotClass: "bg-status-
|
|
35
|
+
dotClass: "bg-status-success-icon"
|
|
27
36
|
},
|
|
28
37
|
{
|
|
29
38
|
value: "loose",
|
|
30
39
|
labelKey: "customers.deals.kanban.filter.status.lost",
|
|
31
40
|
labelFallback: "Lost",
|
|
41
|
+
dotClass: "bg-status-error-icon"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
value: "closed",
|
|
45
|
+
labelKey: "customers.deals.kanban.filter.status.closed",
|
|
46
|
+
labelFallback: "Closed",
|
|
32
47
|
dotClass: "bg-status-neutral-icon"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "in_progress",
|
|
51
|
+
labelKey: "customers.deals.kanban.filter.status.inProgress",
|
|
52
|
+
labelFallback: "In progress",
|
|
53
|
+
dotClass: "bg-status-warning-icon"
|
|
33
54
|
}
|
|
34
55
|
];
|
|
35
56
|
function StatusFilterPopover({ values, onApply }) {
|
|
36
57
|
const t = useT();
|
|
58
|
+
const scopeVersion = useOrganizationScopeVersion();
|
|
59
|
+
const { data: dictionaryData, isLoading: dictionaryLoading } = useCustomerDictionary(
|
|
60
|
+
"deal-statuses",
|
|
61
|
+
scopeVersion
|
|
62
|
+
);
|
|
37
63
|
const [open, setOpen] = React.useState(false);
|
|
38
|
-
const
|
|
64
|
+
const normalizedValues = React.useMemo(
|
|
65
|
+
() => Array.from(new Set(values.map(canonicalDealStatus))),
|
|
66
|
+
[values]
|
|
67
|
+
);
|
|
68
|
+
const [draft, setDraft] = React.useState(normalizedValues);
|
|
39
69
|
React.useEffect(() => {
|
|
40
|
-
if (open) setDraft(
|
|
41
|
-
}, [open,
|
|
70
|
+
if (open) setDraft(normalizedValues);
|
|
71
|
+
}, [open, normalizedValues]);
|
|
72
|
+
const statusOptions = React.useMemo(() => {
|
|
73
|
+
const entries = dictionaryData?.entries;
|
|
74
|
+
if (entries && entries.length > 0) {
|
|
75
|
+
const byCanonical = /* @__PURE__ */ new Map();
|
|
76
|
+
for (const entry of entries) {
|
|
77
|
+
const canonical = canonicalDealStatus(entry.value);
|
|
78
|
+
if (byCanonical.has(canonical)) continue;
|
|
79
|
+
const tone = mapDictionaryColorToTone(entry.color ?? null);
|
|
80
|
+
byCanonical.set(canonical, {
|
|
81
|
+
value: canonical,
|
|
82
|
+
label: entry.label,
|
|
83
|
+
dotClass: toneToDotClass(tone)
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return Array.from(byCanonical.values()).sort(
|
|
87
|
+
(a, b) => a.label.localeCompare(b.label, void 0, { sensitivity: "base" })
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
return FALLBACK_STATUS_OPTIONS.map((entry) => ({
|
|
91
|
+
value: entry.value,
|
|
92
|
+
label: translateWithFallback(t, entry.labelKey, entry.labelFallback),
|
|
93
|
+
dotClass: entry.dotClass
|
|
94
|
+
}));
|
|
95
|
+
}, [dictionaryData, t]);
|
|
96
|
+
const labelByValue = React.useMemo(() => {
|
|
97
|
+
const map = /* @__PURE__ */ new Map();
|
|
98
|
+
for (const option of statusOptions) {
|
|
99
|
+
map.set(option.value, option.label);
|
|
100
|
+
}
|
|
101
|
+
for (const fallback of FALLBACK_STATUS_OPTIONS) {
|
|
102
|
+
if (!map.has(fallback.value)) {
|
|
103
|
+
map.set(fallback.value, translateWithFallback(t, fallback.labelKey, fallback.labelFallback));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return map;
|
|
107
|
+
}, [statusOptions, t]);
|
|
42
108
|
const chipLabel = translateWithFallback(t, "customers.deals.kanban.filter.status", "Status");
|
|
43
|
-
const chipValue =
|
|
44
|
-
const option = STATUS_OPTIONS.find((entry) => entry.value === value);
|
|
45
|
-
return option ? translateWithFallback(t, option.labelKey, option.labelFallback) : value;
|
|
46
|
-
}).join(", ");
|
|
109
|
+
const chipValue = normalizedValues.length === 0 ? translateWithFallback(t, "customers.deals.kanban.filter.all", "All") : normalizedValues.map((value) => labelByValue.get(value) ?? value).join(", ");
|
|
47
110
|
const toggleDraft = (value) => {
|
|
111
|
+
const normalized = canonicalDealStatus(value);
|
|
48
112
|
setDraft(
|
|
49
|
-
(prev) => prev.includes(
|
|
113
|
+
(prev) => prev.includes(normalized) ? prev.filter((entry) => entry !== normalized) : [...prev, normalized]
|
|
50
114
|
);
|
|
51
115
|
};
|
|
52
116
|
const handleApply = () => {
|
|
@@ -60,7 +124,7 @@ function StatusFilterPopover({ values, onApply }) {
|
|
|
60
124
|
}
|
|
61
125
|
};
|
|
62
126
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
63
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(ChipButton, { label: chipLabel, value: chipValue, active:
|
|
127
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(ChipButton, { label: chipLabel, value: chipValue, active: normalizedValues.length > 0 }) }),
|
|
64
128
|
/* @__PURE__ */ jsx(
|
|
65
129
|
PopoverContent,
|
|
66
130
|
{
|
|
@@ -84,9 +148,16 @@ function StatusFilterPopover({ values, onApply }) {
|
|
|
84
148
|
] }),
|
|
85
149
|
children: [
|
|
86
150
|
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold uppercase leading-normal tracking-wide text-muted-foreground", children: translateWithFallback(t, "customers.deals.kanban.filter.status", "Status") }),
|
|
87
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-x-1.5 gap-y-2", children:
|
|
151
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-x-1.5 gap-y-2", children: dictionaryLoading ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-xs text-muted-foreground", role: "status", "aria-live": "polite", children: [
|
|
152
|
+
/* @__PURE__ */ jsx(Spinner, { className: "size-3" }),
|
|
153
|
+
translateWithFallback(
|
|
154
|
+
t,
|
|
155
|
+
"customers.deals.kanban.filter.status.loading",
|
|
156
|
+
"Loading statuses\u2026"
|
|
157
|
+
)
|
|
158
|
+
] }) : statusOptions.map((option) => {
|
|
88
159
|
const isSelected = draft.includes(option.value);
|
|
89
|
-
const label =
|
|
160
|
+
const label = option.label;
|
|
90
161
|
return /* @__PURE__ */ jsxs(
|
|
91
162
|
Button,
|
|
92
163
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../src/modules/customers/backend/customers/deals/pipeline/components/StatusFilterPopover.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { X } from 'lucide-react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@open-mercato/ui/primitives/popover'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { translateWithFallback } from '@open-mercato/shared/lib/i18n/translate'\nimport { ChipButton } from './ChipButton'\nimport { FilterPopoverShell } from './FilterPopoverShell'\n\n/**\n * Filter options exposed to the operator.\n *\n * The deal `status` column
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { X } from 'lucide-react'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@open-mercato/ui/primitives/popover'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { translateWithFallback } from '@open-mercato/shared/lib/i18n/translate'\nimport { useOrganizationScopeVersion } from '@open-mercato/shared/lib/frontend/useOrganizationScope'\nimport { mapDictionaryColorToTone } from '@open-mercato/shared/lib/query/advanced-filter'\nimport { Spinner } from '@open-mercato/ui/primitives/spinner'\nimport { useCustomerDictionary } from '../../../../../components/detail/hooks/useCustomerDictionary'\nimport { canonicalDealStatus } from '../../../../../lib/dealStatus'\nimport { toneToDotClass } from './toneClasses'\nimport { ChipButton } from './ChipButton'\nimport { FilterPopoverShell } from './FilterPopoverShell'\n\n/**\n * Filter options exposed to the operator.\n *\n * The deal `status` column is dictionary-driven (`deal-statuses`); the seeded dictionary\n * carries five values (`open`, `closed`, `win`, `loose`, `in_progress`) plus any\n * tenant-custom entries. We render every dictionary entry de-duplicated by canonical\n * spelling so the kanban Status pill stays aligned with the list page's advanced filter\n * (which also uses the dictionary). A hard-coded fallback keeps the popover usable while\n * the dictionary is loading or when a tenant has no entries.\n *\n * `won` / `lost` are accepted as aliases for `win` / `loose` at the API layer (see\n * `lib/dealStatus.ts:expandDealStatusAliases`, shared by the deals list route and the\n * kanban aggregate route). The UI only exposes the canonical values to avoid duplicate\n * pills, but `canonicalDealStatus` normalizes any alias passed in through `values` so\n * the chip and draft selection render the correct label.\n */\nconst FALLBACK_STATUS_OPTIONS: Array<{\n value: string\n labelKey: string\n labelFallback: string\n dotClass: string\n}> = [\n {\n value: 'open',\n labelKey: 'customers.deals.kanban.filter.status.open',\n labelFallback: 'Open',\n // Tones mirror mapDictionaryColorToTone over the seeded dictionary colors\n // (#2563eb \u2192 info, #22c55e \u2192 success, #ef4444 \u2192 error) so the fallback pills\n // render identically to the dictionary-driven ones.\n dotClass: 'bg-status-info-icon',\n },\n {\n value: 'win',\n labelKey: 'customers.deals.kanban.filter.status.won',\n labelFallback: 'Won',\n dotClass: 'bg-status-success-icon',\n },\n {\n value: 'loose',\n labelKey: 'customers.deals.kanban.filter.status.lost',\n labelFallback: 'Lost',\n dotClass: 'bg-status-error-icon',\n },\n {\n value: 'closed',\n labelKey: 'customers.deals.kanban.filter.status.closed',\n labelFallback: 'Closed',\n dotClass: 'bg-status-neutral-icon',\n },\n {\n value: 'in_progress',\n labelKey: 'customers.deals.kanban.filter.status.inProgress',\n labelFallback: 'In progress',\n dotClass: 'bg-status-warning-icon',\n },\n]\n\ntype StatusFilterPopoverProps = {\n values: string[]\n onApply: (next: string[]) => void\n}\n\nexport function StatusFilterPopover({ values, onApply }: StatusFilterPopoverProps): React.ReactElement {\n const t = useT()\n const scopeVersion = useOrganizationScopeVersion()\n const { data: dictionaryData, isLoading: dictionaryLoading } = useCustomerDictionary(\n 'deal-statuses',\n scopeVersion,\n )\n const [open, setOpen] = React.useState(false)\n const normalizedValues = React.useMemo(\n () => Array.from(new Set(values.map(canonicalDealStatus))),\n [values],\n )\n const [draft, setDraft] = React.useState<string[]>(normalizedValues)\n\n React.useEffect(() => {\n if (open) setDraft(normalizedValues)\n }, [open, normalizedValues])\n\n const statusOptions = React.useMemo(() => {\n const entries = dictionaryData?.entries\n if (entries && entries.length > 0) {\n const byCanonical = new Map<string, { value: string; label: string; dotClass: string }>()\n for (const entry of entries) {\n const canonical = canonicalDealStatus(entry.value)\n if (byCanonical.has(canonical)) continue\n const tone = mapDictionaryColorToTone(entry.color ?? null)\n byCanonical.set(canonical, {\n value: canonical,\n label: entry.label,\n dotClass: toneToDotClass(tone),\n })\n }\n // Sort by label exactly like the List page's advanced filter\n // (backend/customers/deals/page.tsx dictionaryOptions) so both surfaces render\n // the same pills in the same order.\n return Array.from(byCanonical.values()).sort((a, b) =>\n a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }),\n )\n }\n return FALLBACK_STATUS_OPTIONS.map((entry) => ({\n value: entry.value,\n label: translateWithFallback(t, entry.labelKey, entry.labelFallback),\n dotClass: entry.dotClass,\n }))\n }, [dictionaryData, t])\n\n const labelByValue = React.useMemo(() => {\n const map = new Map<string, string>()\n for (const option of statusOptions) {\n map.set(option.value, option.label)\n }\n for (const fallback of FALLBACK_STATUS_OPTIONS) {\n if (!map.has(fallback.value)) {\n map.set(fallback.value, translateWithFallback(t, fallback.labelKey, fallback.labelFallback))\n }\n }\n return map\n }, [statusOptions, t])\n\n const chipLabel = translateWithFallback(t, 'customers.deals.kanban.filter.status', 'Status')\n const chipValue =\n normalizedValues.length === 0\n ? translateWithFallback(t, 'customers.deals.kanban.filter.all', 'All')\n : normalizedValues\n .map((value) => labelByValue.get(value) ?? value)\n .join(', ')\n\n const toggleDraft = (value: string) => {\n const normalized = canonicalDealStatus(value)\n setDraft((prev) =>\n prev.includes(normalized) ? prev.filter((entry) => entry !== normalized) : [...prev, normalized],\n )\n }\n\n const handleApply = () => {\n onApply(draft)\n setOpen(false)\n }\n\n // Cmd/Ctrl+Enter from anywhere inside the popover confirms \u2014 parity with the dialog\n // primary-action shortcut (`AGENTS.md` UI Interaction rules).\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') {\n event.preventDefault()\n handleApply()\n }\n }\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <ChipButton label={chipLabel} value={chipValue} active={normalizedValues.length > 0} />\n </PopoverTrigger>\n <PopoverContent\n className=\"w-96 rounded-2xl border-border bg-transparent p-0 shadow-xl\"\n align=\"start\"\n onKeyDown={handleKeyDown}\n >\n <FilterPopoverShell\n title={\n <>\n <span className=\"font-bold\">\n {translateWithFallback(t, 'customers.deals.kanban.filter.status.title.label', 'Filter : ')}\n </span>\n <span className=\"font-normal\">\n {translateWithFallback(t, 'customers.deals.kanban.filter.status', 'Status')}\n </span>\n </>\n }\n onClose={() => setOpen(false)}\n onCancel={() => setOpen(false)}\n onApply={handleApply}\n footerLeft={\n <span>\n {draft.length}{' '}\n {translateWithFallback(t, 'customers.deals.kanban.filter.selected', 'selected')}\n </span>\n }\n >\n <span className=\"text-xs font-semibold uppercase leading-normal tracking-wide text-muted-foreground\">\n {translateWithFallback(t, 'customers.deals.kanban.filter.status', 'Status')}\n </span>\n <div className=\"flex flex-wrap items-center gap-x-1.5 gap-y-2\">\n {dictionaryLoading ? (\n <span className=\"flex items-center gap-2 text-xs text-muted-foreground\" role=\"status\" aria-live=\"polite\">\n <Spinner className=\"size-3\" />\n {translateWithFallback(\n t,\n 'customers.deals.kanban.filter.status.loading',\n 'Loading statuses\u2026',\n )}\n </span>\n ) : (\n statusOptions.map((option) => {\n const isSelected = draft.includes(option.value)\n const label = option.label\n return (\n <Button\n key={option.value}\n type=\"button\"\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => toggleDraft(option.value)}\n aria-pressed={isSelected}\n className={`gap-1.5 rounded-full px-2.5 py-1.5 text-xs leading-normal ${\n isSelected\n ? 'bg-muted font-semibold text-foreground'\n : 'border border-border bg-card font-normal text-muted-foreground hover:bg-muted'\n }`}\n >\n <span\n className={`inline-block size-2 shrink-0 rounded-full ${option.dotClass}`}\n aria-hidden=\"true\"\n />\n <span>{label}</span>\n {isSelected ? (\n <X className=\"size-2.5 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n ) : null}\n </Button>\n )\n })\n )}\n </div>\n </FilterPopoverShell>\n </PopoverContent>\n </Popover>\n )\n}\n\nexport default StatusFilterPopover\n"],
|
|
5
|
+
"mappings": ";AA8KQ,SASI,UATJ,KASI,YATJ;AA5KR,YAAY,WAAW;AACvB,SAAS,SAAS;AAClB,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SA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,GAC5E;AAAA,cACA,oBAAC,SAAI,WAAU,iDACZ,8BACC,qBAAC,UAAK,WAAU,yDAAwD,MAAK,UAAS,aAAU,UAC9F;AAAA,oCAAC,WAAQ,WAAU,UAAS;AAAA,gBAC3B;AAAA,kBACC;AAAA,kBACA;AAAA,kBACA;AAAA,gBACF;AAAA,iBACF,IAEA,cAAc,IAAI,CAAC,WAAW;AAC9B,sBAAM,aAAa,MAAM,SAAS,OAAO,KAAK;AAC9C,sBAAM,QAAQ,OAAO;AACrB,uBACE;AAAA,kBAAC;AAAA;AAAA,oBAEC,MAAK;AAAA,oBACL,SAAQ;AAAA,oBACR,MAAK;AAAA,oBACL,SAAS,MAAM,YAAY,OAAO,KAAK;AAAA,oBACvC,gBAAc;AAAA,oBACd,WAAW,6DACT,aACI,2CACA,+EACN;AAAA,oBAEA;AAAA;AAAA,wBAAC;AAAA;AAAA,0BACC,WAAW,6CAA6C,OAAO,QAAQ;AAAA,0BACvE,eAAY;AAAA;AAAA,sBACd;AAAA,sBACA,oBAAC,UAAM,iBAAM;AAAA,sBACZ,aACC,oBAAC,KAAE,WAAU,2CAA0C,eAAY,QAAO,IACxE;AAAA;AAAA;AAAA,kBAnBC,OAAO;AAAA,gBAoBd;AAAA,cAEF,CAAC,GAEL;AAAA;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,IAAO,8BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const TONE_DOT_CLASS = {
|
|
2
|
+
success: "bg-status-success-icon",
|
|
3
|
+
error: "bg-status-error-icon",
|
|
4
|
+
warning: "bg-status-warning-icon",
|
|
5
|
+
info: "bg-status-info-icon",
|
|
6
|
+
neutral: "bg-status-neutral-icon",
|
|
7
|
+
brand: "bg-brand-violet",
|
|
8
|
+
pink: "bg-status-pink-icon"
|
|
9
|
+
};
|
|
10
|
+
function toneToDotClass(tone, fallback = "bg-status-neutral-icon") {
|
|
11
|
+
if (tone && tone in TONE_DOT_CLASS) return TONE_DOT_CLASS[tone];
|
|
12
|
+
return fallback;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
TONE_DOT_CLASS,
|
|
16
|
+
toneToDotClass
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=toneClasses.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/modules/customers/backend/customers/deals/pipeline/components/toneClasses.ts"],
|
|
4
|
+
"sourcesContent": ["import type { FilterOptionTone } from '@open-mercato/shared/lib/query/advanced-filter'\n\n// Saturated icon tokens shared by the kanban lane accent bar and the status filter\n// pills, so both surfaces render the same tone identically (#5107 review).\nexport const TONE_DOT_CLASS: Record<FilterOptionTone, string> = {\n success: 'bg-status-success-icon',\n error: 'bg-status-error-icon',\n warning: 'bg-status-warning-icon',\n info: 'bg-status-info-icon',\n neutral: 'bg-status-neutral-icon',\n brand: 'bg-brand-violet',\n pink: 'bg-status-pink-icon',\n}\n\nexport function toneToDotClass(\n tone: FilterOptionTone | null | undefined,\n fallback = 'bg-status-neutral-icon',\n): string {\n if (tone && tone in TONE_DOT_CLASS) return TONE_DOT_CLASS[tone]\n return fallback\n}\n"],
|
|
5
|
+
"mappings": "AAIO,MAAM,iBAAmD;AAAA,EAC9D,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AACR;AAEO,SAAS,eACd,MACA,WAAW,0BACH;AACR,MAAI,QAAQ,QAAQ,eAAgB,QAAO,eAAe,IAAI;AAC9D,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -154,9 +154,10 @@ function CustomersPeoplePage() {
|
|
|
154
154
|
const [sorting, setSorting] = React.useState([]);
|
|
155
155
|
const [total, setTotal] = React.useState(0);
|
|
156
156
|
const [totalPages, setTotalPages] = React.useState(1);
|
|
157
|
-
const [
|
|
157
|
+
const [totalIsCapped, setTotalIsCapped] = React.useState(false);
|
|
158
158
|
const pathname = usePathname();
|
|
159
159
|
const searchParams = useSearchParams();
|
|
160
|
+
const [search, setSearch] = React.useState(() => searchParams?.get("search")?.trim() ?? "");
|
|
160
161
|
const initialFilterTree = React.useMemo(() => {
|
|
161
162
|
if (!searchParams) return createEmptyTree();
|
|
162
163
|
const record = {};
|
|
@@ -340,6 +341,7 @@ function CustomersPeoplePage() {
|
|
|
340
341
|
setRows(items.map((item) => mapApiItem(item)).filter((row) => !!row));
|
|
341
342
|
setTotal(typeof payload.total === "number" ? payload.total : items.length);
|
|
342
343
|
setTotalPages(typeof payload.totalPages === "number" ? payload.totalPages : 1);
|
|
344
|
+
setTotalIsCapped(payload?.totalIsCapped === true);
|
|
343
345
|
} catch (err) {
|
|
344
346
|
if (!cancelled) {
|
|
345
347
|
setCacheStatus(null);
|
|
@@ -854,7 +856,7 @@ function CustomersPeoplePage() {
|
|
|
854
856
|
}
|
|
855
857
|
),
|
|
856
858
|
virtualized: true,
|
|
857
|
-
pagination: { page, pageSize, total, totalPages, onPageChange: setPage, cacheStatus, pageSizeOptions: [10, 25, 50, 100], onPageSizeChange: handlePageSizeChange },
|
|
859
|
+
pagination: { page, pageSize, total, totalPages, totalIsCapped, onPageChange: setPage, cacheStatus, pageSizeOptions: [10, 25, 50, 100], onPageSizeChange: handlePageSizeChange },
|
|
858
860
|
isLoading
|
|
859
861
|
}
|
|
860
862
|
),
|