@multiplatform.one/backoffice 7.22.0 → 7.23.1
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/dist/cjs/list/DoctypeListScreen.cjs +4 -42
- package/dist/cjs/list/DoctypeListScreen.native.js +5 -43
- package/dist/cjs/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/cjs/list/filter-chips.cjs +3 -3
- package/dist/cjs/list/filter-chips.native.js +3 -3
- package/dist/cjs/list/filter-chips.native.js.map +1 -1
- package/dist/cjs/list/filter-editor.cjs +10 -11
- package/dist/cjs/list/filter-editor.native.js +10 -11
- package/dist/cjs/list/filter-editor.native.js.map +1 -1
- package/dist/cjs/list/filter-fields.cjs +15 -267
- package/dist/cjs/list/filter-fields.native.js +15 -337
- package/dist/cjs/list/filter-fields.native.js.map +1 -1
- package/dist/cjs/list/filter-standard.cjs +5 -6
- package/dist/cjs/list/filter-standard.native.js +5 -6
- package/dist/cjs/list/filter-standard.native.js.map +1 -1
- package/dist/cjs/list/list-tools-sheet.cjs +2 -2
- package/dist/cjs/list/list-tools-sheet.native.js +2 -2
- package/dist/cjs/list/list-tools-sheet.native.js.map +1 -1
- package/dist/cjs/list/listColumns.cjs +2 -371
- package/dist/cjs/list/listColumns.native.js +2 -418
- package/dist/cjs/list/listColumns.native.js.map +1 -1
- package/dist/cjs/list/listFields.cjs +4 -24
- package/dist/cjs/list/listFields.native.js +4 -50
- package/dist/cjs/list/listFields.native.js.map +1 -1
- package/dist/cjs/list/listFormat.cjs +7 -42
- package/dist/cjs/list/listFormat.native.js +7 -45
- package/dist/cjs/list/listFormat.native.js.map +1 -1
- package/dist/cjs/list/statusColors.cjs +2 -76
- package/dist/cjs/list/statusColors.native.js +2 -80
- package/dist/cjs/list/statusColors.native.js.map +1 -1
- package/dist/cjs/report/queryReportColumns.cjs +2 -2
- package/dist/cjs/report/queryReportColumns.native.js +2 -2
- package/dist/cjs/report/queryReportColumns.native.js.map +1 -1
- package/dist/cjs/report/queryReportFilterBar.cjs +5 -6
- package/dist/cjs/report/queryReportFilterBar.native.js +5 -6
- package/dist/cjs/report/queryReportFilterBar.native.js.map +1 -1
- package/dist/cjs/report/report-grid.cjs +2 -2
- package/dist/cjs/report/report-grid.native.js +2 -2
- package/dist/cjs/report/report-grid.native.js.map +1 -1
- package/dist/cjs/report/report-toolbar.cjs +2 -2
- package/dist/cjs/report/report-toolbar.native.js +2 -2
- package/dist/cjs/report/report-toolbar.native.js.map +1 -1
- package/dist/cjs/report/reportViewModel.cjs +3 -3
- package/dist/cjs/report/reportViewModel.native.js +3 -3
- package/dist/cjs/report/reportViewModel.native.js.map +1 -1
- package/dist/esm/list/DoctypeListScreen.mjs +3 -41
- package/dist/esm/list/DoctypeListScreen.mjs.map +1 -1
- package/dist/esm/list/DoctypeListScreen.native.js +4 -42
- package/dist/esm/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/esm/list/filter-chips.mjs +1 -1
- package/dist/esm/list/filter-chips.native.js +1 -1
- package/dist/esm/list/filter-chips.native.js.map +1 -1
- package/dist/esm/list/filter-editor.mjs +1 -2
- package/dist/esm/list/filter-editor.mjs.map +1 -1
- package/dist/esm/list/filter-editor.native.js +1 -2
- package/dist/esm/list/filter-editor.native.js.map +1 -1
- package/dist/esm/list/filter-fields.mjs +1 -253
- package/dist/esm/list/filter-fields.mjs.map +1 -1
- package/dist/esm/list/filter-fields.native.js +1 -323
- package/dist/esm/list/filter-fields.native.js.map +1 -1
- package/dist/esm/list/filter-standard.mjs +1 -2
- package/dist/esm/list/filter-standard.mjs.map +1 -1
- package/dist/esm/list/filter-standard.native.js +1 -2
- package/dist/esm/list/filter-standard.native.js.map +1 -1
- package/dist/esm/list/list-tools-sheet.mjs +1 -1
- package/dist/esm/list/list-tools-sheet.native.js +1 -1
- package/dist/esm/list/list-tools-sheet.native.js.map +1 -1
- package/dist/esm/list/listColumns.mjs +1 -370
- package/dist/esm/list/listColumns.mjs.map +1 -1
- package/dist/esm/list/listColumns.native.js +1 -417
- package/dist/esm/list/listColumns.native.js.map +1 -1
- package/dist/esm/list/listFields.mjs +1 -21
- package/dist/esm/list/listFields.mjs.map +1 -1
- package/dist/esm/list/listFields.native.js +1 -47
- package/dist/esm/list/listFields.native.js.map +1 -1
- package/dist/esm/list/listFormat.mjs +1 -36
- package/dist/esm/list/listFormat.mjs.map +1 -1
- package/dist/esm/list/listFormat.native.js +1 -39
- package/dist/esm/list/listFormat.native.js.map +1 -1
- package/dist/esm/list/statusColors.mjs +1 -75
- package/dist/esm/list/statusColors.mjs.map +1 -1
- package/dist/esm/list/statusColors.native.js +1 -79
- package/dist/esm/list/statusColors.native.js.map +1 -1
- package/dist/esm/report/queryReportColumns.mjs +1 -1
- package/dist/esm/report/queryReportColumns.native.js +1 -1
- package/dist/esm/report/queryReportColumns.native.js.map +1 -1
- package/dist/esm/report/queryReportFilterBar.mjs +1 -2
- package/dist/esm/report/queryReportFilterBar.mjs.map +1 -1
- package/dist/esm/report/queryReportFilterBar.native.js +1 -2
- package/dist/esm/report/queryReportFilterBar.native.js.map +1 -1
- package/dist/esm/report/report-grid.mjs +1 -1
- package/dist/esm/report/report-grid.native.js +1 -1
- package/dist/esm/report/report-grid.native.js.map +1 -1
- package/dist/esm/report/report-toolbar.mjs +1 -1
- package/dist/esm/report/report-toolbar.native.js +1 -1
- package/dist/esm/report/report-toolbar.native.js.map +1 -1
- package/dist/esm/report/reportViewModel.mjs +1 -1
- package/dist/esm/report/reportViewModel.mjs.map +1 -1
- package/dist/esm/report/reportViewModel.native.js +1 -1
- package/dist/esm/report/reportViewModel.native.js.map +1 -1
- package/dist/jsx/chrome/BackofficeAwesomebar.native.js +1 -1
- package/dist/jsx/chrome/BackofficeAwesomebar.native.js.map +1 -1
- package/dist/jsx/chrome/CommandPalette.native.js +1 -1
- package/dist/jsx/chrome/CommandPalette.native.js.map +1 -1
- package/dist/jsx/chrome/HelpMenu.native.js +1 -1
- package/dist/jsx/chrome/HelpMenu.native.js.map +1 -1
- package/dist/jsx/chrome/NotificationsButton.native.js +1 -1
- package/dist/jsx/chrome/NotificationsButton.native.js.map +1 -1
- package/dist/jsx/chrome/UserMenu.native.js +1 -1
- package/dist/jsx/chrome/UserMenu.native.js.map +1 -1
- package/dist/jsx/chrome/awesomebar-data.native.js.map +1 -1
- package/dist/jsx/chrome/command-palette-model.native.js +1 -1
- package/dist/jsx/chrome/command-palette-model.native.js.map +1 -1
- package/dist/jsx/chrome/help-about-dialog.native.js +1 -1
- package/dist/jsx/chrome/help-about-dialog.native.js.map +1 -1
- package/dist/jsx/chrome/help-shortcuts-dialog.native.js +1 -1
- package/dist/jsx/chrome/help-shortcuts-dialog.native.js.map +1 -1
- package/dist/jsx/chrome/notifications-data.native.js.map +1 -1
- package/dist/jsx/chrome/notifications-panel.native.js +1 -1
- package/dist/jsx/chrome/notifications-panel.native.js.map +1 -1
- package/dist/jsx/chrome/notifications-utils.native.js.map +1 -1
- package/dist/jsx/chrome/shortcuts.native.js.map +1 -1
- package/dist/jsx/chrome/user-session.native.js.map +1 -1
- package/dist/jsx/config/BackofficeProvider.native.js +1 -1
- package/dist/jsx/config/BackofficeProvider.native.js.map +1 -1
- package/dist/jsx/config/capabilities.native.js.map +1 -1
- package/dist/jsx/config/events.native.js.map +1 -1
- package/dist/jsx/config/slots.native.js.map +1 -1
- package/dist/jsx/desk/Desk.native.js.map +1 -1
- package/dist/jsx/desk/DeskSurface.native.js.map +1 -1
- package/dist/jsx/desk/resolveDeskPath.native.js.map +1 -1
- package/dist/jsx/desk/scope.native.js.map +1 -1
- package/dist/jsx/desk/target.native.js.map +1 -1
- package/dist/jsx/form/DocFormScreen.native.js +1 -1
- package/dist/jsx/form/DocFormScreen.native.js.map +1 -1
- package/dist/jsx/form/FormConnections.native.js +1 -1
- package/dist/jsx/form/FormConnections.native.js.map +1 -1
- package/dist/jsx/form/FormDialogs.native.js +1 -1
- package/dist/jsx/form/FormDialogs.native.js.map +1 -1
- package/dist/jsx/form/FormErrorBoundary.native.js +1 -1
- package/dist/jsx/form/FormErrorBoundary.native.js.map +1 -1
- package/dist/jsx/form/FormHeaderCluster.native.js +1 -1
- package/dist/jsx/form/FormHeaderCluster.native.js.map +1 -1
- package/dist/jsx/form/FormSidebarPanel.native.js +1 -1
- package/dist/jsx/form/FormSidebarPanel.native.js.map +1 -1
- package/dist/jsx/form/FormTimeline.native.js +1 -1
- package/dist/jsx/form/FormTimeline.native.js.map +1 -1
- package/dist/jsx/form/FormToolbar.native.js +1 -1
- package/dist/jsx/form/FormToolbar.native.js.map +1 -1
- package/dist/jsx/form/connections-data.native.js.map +1 -1
- package/dist/jsx/form/createPrefill.native.js.map +1 -1
- package/dist/jsx/form/dependsOn.native.js.map +1 -1
- package/dist/jsx/form/dirtyTracking.native.js.map +1 -1
- package/dist/jsx/form/docinfo.native.js.map +1 -1
- package/dist/jsx/form/fetchFrom.native.js.map +1 -1
- package/dist/jsx/form/fieldPermissions.native.js.map +1 -1
- package/dist/jsx/form/formActions.native.js.map +1 -1
- package/dist/jsx/form/formLayout.native.js.map +1 -1
- package/dist/jsx/form/platformHooks.native.js.map +1 -1
- package/dist/jsx/form/sidebar-attachments.native.js +1 -1
- package/dist/jsx/form/sidebar-attachments.native.js.map +1 -1
- package/dist/jsx/form/sidebar-dialogs.native.js +1 -1
- package/dist/jsx/form/sidebar-dialogs.native.js.map +1 -1
- package/dist/jsx/form/sidebar-people.native.js +1 -1
- package/dist/jsx/form/sidebar-people.native.js.map +1 -1
- package/dist/jsx/form/sidebar-rpc.native.js.map +1 -1
- package/dist/jsx/form/sidebar-utils.native.js.map +1 -1
- package/dist/jsx/form/timeline-entries.native.js.map +1 -1
- package/dist/jsx/form/timeline-utils.native.js.map +1 -1
- package/dist/jsx/form/useFormEngine.native.js.map +1 -1
- package/dist/jsx/i18n/en.native.js.map +1 -1
- package/dist/jsx/i18n/index.native.js.map +1 -1
- package/dist/jsx/index.native.js +1 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/list/AddTagsDialog.native.js +1 -1
- package/dist/jsx/list/AddTagsDialog.native.js.map +1 -1
- package/dist/jsx/list/AssignToDialog.native.js +1 -1
- package/dist/jsx/list/AssignToDialog.native.js.map +1 -1
- package/dist/jsx/list/DoctypeListScreen.mjs +3 -41
- package/dist/jsx/list/DoctypeListScreen.mjs.map +1 -1
- package/dist/jsx/list/DoctypeListScreen.native.js +6 -44
- package/dist/jsx/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/jsx/list/ListBulkActionsBar.native.js +1 -1
- package/dist/jsx/list/ListBulkActionsBar.native.js.map +1 -1
- package/dist/jsx/list/ListFilterBar.native.js +1 -1
- package/dist/jsx/list/ListFilterBar.native.js.map +1 -1
- package/dist/jsx/list/ListSidebar.native.js +1 -1
- package/dist/jsx/list/ListSidebar.native.js.map +1 -1
- package/dist/jsx/list/bulk-edit-dialog.native.js +1 -1
- package/dist/jsx/list/bulk-edit-dialog.native.js.map +1 -1
- package/dist/jsx/list/bulk-export.native.js.map +1 -1
- package/dist/jsx/list/bulk-submit-cancel.native.js.map +1 -1
- package/dist/jsx/list/bulkActions.native.js.map +1 -1
- package/dist/jsx/list/filter-chips.mjs +1 -1
- package/dist/jsx/list/filter-chips.native.js +4 -4
- package/dist/jsx/list/filter-chips.native.js.map +1 -1
- package/dist/jsx/list/filter-editor.mjs +1 -2
- package/dist/jsx/list/filter-editor.mjs.map +1 -1
- package/dist/jsx/list/filter-editor.native.js +11 -12
- package/dist/jsx/list/filter-editor.native.js.map +1 -1
- package/dist/jsx/list/filter-fields.mjs +1 -253
- package/dist/jsx/list/filter-fields.mjs.map +1 -1
- package/dist/jsx/list/filter-fields.native.js +15 -337
- package/dist/jsx/list/filter-fields.native.js.map +1 -1
- package/dist/jsx/list/filter-saved.native.js +1 -1
- package/dist/jsx/list/filter-saved.native.js.map +1 -1
- package/dist/jsx/list/filter-sort.native.js +1 -1
- package/dist/jsx/list/filter-sort.native.js.map +1 -1
- package/dist/jsx/list/filter-standard.mjs +1 -2
- package/dist/jsx/list/filter-standard.mjs.map +1 -1
- package/dist/jsx/list/filter-standard.native.js +5 -6
- package/dist/jsx/list/filter-standard.native.js.map +1 -1
- package/dist/jsx/list/filterConversion.native.js.map +1 -1
- package/dist/jsx/list/list-tools-sheet.mjs +1 -1
- package/dist/jsx/list/list-tools-sheet.native.js +3 -3
- package/dist/jsx/list/list-tools-sheet.native.js.map +1 -1
- package/dist/jsx/list/listColumns.mjs +1 -370
- package/dist/jsx/list/listColumns.mjs.map +1 -1
- package/dist/jsx/list/listColumns.native.js +2 -418
- package/dist/jsx/list/listColumns.native.js.map +1 -1
- package/dist/jsx/list/listFields.mjs +1 -21
- package/dist/jsx/list/listFields.mjs.map +1 -1
- package/dist/jsx/list/listFields.native.js +4 -50
- package/dist/jsx/list/listFields.native.js.map +1 -1
- package/dist/jsx/list/listFormat.mjs +1 -36
- package/dist/jsx/list/listFormat.mjs.map +1 -1
- package/dist/jsx/list/listFormat.native.js +7 -45
- package/dist/jsx/list/listFormat.native.js.map +1 -1
- package/dist/jsx/list/listUrlState.native.js.map +1 -1
- package/dist/jsx/list/sidebar-section.native.js +1 -1
- package/dist/jsx/list/sidebar-section.native.js.map +1 -1
- package/dist/jsx/list/sidebar-stats.native.js.map +1 -1
- package/dist/jsx/list/statusColors.mjs +1 -75
- package/dist/jsx/list/statusColors.mjs.map +1 -1
- package/dist/jsx/list/statusColors.native.js +2 -80
- package/dist/jsx/list/statusColors.native.js.map +1 -1
- package/dist/jsx/navigation/navigator.native.js.map +1 -1
- package/dist/jsx/navigation/paths.native.js.map +1 -1
- package/dist/jsx/oneAdapter/index.native.js.map +1 -1
- package/dist/jsx/quickEntry/QuickEntryDialog.native.js +1 -1
- package/dist/jsx/quickEntry/QuickEntryDialog.native.js.map +1 -1
- package/dist/jsx/quickEntry/quickEntryPlan.native.js.map +1 -1
- package/dist/jsx/report/DoctypeReportView.native.js +1 -1
- package/dist/jsx/report/DoctypeReportView.native.js.map +1 -1
- package/dist/jsx/report/QueryReportScreen.native.js +1 -1
- package/dist/jsx/report/QueryReportScreen.native.js.map +1 -1
- package/dist/jsx/report/queryReportColumns.mjs +1 -1
- package/dist/jsx/report/queryReportColumns.native.js +2 -2
- package/dist/jsx/report/queryReportColumns.native.js.map +1 -1
- package/dist/jsx/report/queryReportFilterBar.mjs +1 -2
- package/dist/jsx/report/queryReportFilterBar.mjs.map +1 -1
- package/dist/jsx/report/queryReportFilterBar.native.js +6 -7
- package/dist/jsx/report/queryReportFilterBar.native.js.map +1 -1
- package/dist/jsx/report/queryReportUrlState.native.js.map +1 -1
- package/dist/jsx/report/report-grid.mjs +1 -1
- package/dist/jsx/report/report-grid.native.js +3 -3
- package/dist/jsx/report/report-grid.native.js.map +1 -1
- package/dist/jsx/report/report-toolbar.mjs +1 -1
- package/dist/jsx/report/report-toolbar.native.js +3 -3
- package/dist/jsx/report/report-toolbar.native.js.map +1 -1
- package/dist/jsx/report/reportShapes.native.js.map +1 -1
- package/dist/jsx/report/reportViewModel.mjs +1 -1
- package/dist/jsx/report/reportViewModel.mjs.map +1 -1
- package/dist/jsx/report/reportViewModel.native.js +3 -3
- package/dist/jsx/report/reportViewModel.native.js.map +1 -1
- package/dist/jsx/report/savedReports.native.js.map +1 -1
- package/dist/jsx/report/useQueryReport.native.js.map +1 -1
- package/dist/jsx/shared/deskLinks.native.js.map +1 -1
- package/dist/jsx/shared/listNavContext.native.js.map +1 -1
- package/dist/jsx/shared/types.native.js.map +1 -1
- package/dist/jsx/shared/useDocinfo.native.js.map +1 -1
- package/dist/jsx/shared/useDoctypeMeta.native.js.map +1 -1
- package/dist/jsx/shared/useFrappeApp.native.js.map +1 -1
- package/dist/jsx/shared/useRecentVisit.native.js.map +1 -1
- package/dist/jsx/shared/useSessionUserId.native.js.map +1 -1
- package/dist/jsx/shared/useSlugTarget.native.js.map +1 -1
- package/dist/jsx/shared/useUserRoles.native.js.map +1 -1
- package/dist/jsx/shell/BackofficeShell.native.js +1 -1
- package/dist/jsx/shell/BackofficeShell.native.js.map +1 -1
- package/dist/jsx/shell/HomeRedirect.native.js +1 -1
- package/dist/jsx/shell/HomeRedirect.native.js.map +1 -1
- package/dist/jsx/shell/NotFoundScreen.native.js +1 -1
- package/dist/jsx/shell/NotFoundScreen.native.js.map +1 -1
- package/dist/jsx/shell/SlugScreen.native.js +1 -1
- package/dist/jsx/shell/SlugScreen.native.js.map +1 -1
- package/dist/jsx/shell/WorkspaceSidebar.native.js +1 -1
- package/dist/jsx/shell/WorkspaceSidebar.native.js.map +1 -1
- package/dist/jsx/shell/useWorkspaces.native.js.map +1 -1
- package/dist/jsx/shell/workspaceIcons.native.js.map +1 -1
- package/dist/jsx/views/CalendarView.native.js +1 -1
- package/dist/jsx/views/CalendarView.native.js.map +1 -1
- package/dist/jsx/views/DashboardView.native.js +1 -1
- package/dist/jsx/views/DashboardView.native.js.map +1 -1
- package/dist/jsx/views/DoctypeViewScreen.native.js.map +1 -1
- package/dist/jsx/views/ImageView.native.js +1 -1
- package/dist/jsx/views/ImageView.native.js.map +1 -1
- package/dist/jsx/views/KanbanView.native.js +1 -1
- package/dist/jsx/views/KanbanView.native.js.map +1 -1
- package/dist/jsx/views/ReportView.native.js +1 -1
- package/dist/jsx/views/ReportView.native.js.map +1 -1
- package/dist/jsx/views/TreeView.native.js +1 -1
- package/dist/jsx/views/TreeView.native.js.map +1 -1
- package/dist/jsx/views/ViewHeader.native.js +1 -1
- package/dist/jsx/views/ViewHeader.native.js.map +1 -1
- package/dist/jsx/views/ViewStates.native.js +1 -1
- package/dist/jsx/views/ViewStates.native.js.map +1 -1
- package/dist/jsx/views/ViewSwitcherMenu.native.js +1 -1
- package/dist/jsx/views/ViewSwitcherMenu.native.js.map +1 -1
- package/dist/jsx/views/calendar-field-selector.native.js +1 -1
- package/dist/jsx/views/calendar-field-selector.native.js.map +1 -1
- package/dist/jsx/views/connection.native.js.map +1 -1
- package/dist/jsx/views/dashboard-data.native.js.map +1 -1
- package/dist/jsx/views/deskViewConfigs.native.js.map +1 -1
- package/dist/jsx/views/kanban-board-controls.native.js +1 -1
- package/dist/jsx/views/kanban-board-controls.native.js.map +1 -1
- package/dist/jsx/views/kanban-field-picker.native.js +1 -1
- package/dist/jsx/views/kanban-field-picker.native.js.map +1 -1
- package/dist/jsx/views/kanbanBoardOps.native.js.map +1 -1
- package/dist/jsx/views/report-controls.native.js +1 -1
- package/dist/jsx/views/report-controls.native.js.map +1 -1
- package/dist/jsx/views/viewAvailability.native.js.map +1 -1
- package/dist/jsx/views/viewMeta.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceChartBlock.native.js +1 -1
- package/dist/jsx/workspace/WorkspaceChartBlock.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceGrid.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceLinkCard.native.js +1 -1
- package/dist/jsx/workspace/WorkspaceLinkCard.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceLinkDirectory.native.js +1 -1
- package/dist/jsx/workspace/WorkspaceLinkDirectory.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceNumberCard.native.js +1 -1
- package/dist/jsx/workspace/WorkspaceNumberCard.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceQuickList.native.js +1 -1
- package/dist/jsx/workspace/WorkspaceQuickList.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceRecents.native.js +1 -1
- package/dist/jsx/workspace/WorkspaceRecents.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceScreen.native.js +1 -1
- package/dist/jsx/workspace/WorkspaceScreen.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceShortcut.native.js +1 -1
- package/dist/jsx/workspace/WorkspaceShortcut.native.js.map +1 -1
- package/dist/jsx/workspace/parseContent.native.js.map +1 -1
- package/dist/jsx/workspace/types.native.js.map +1 -1
- package/dist/jsx/workspace/useDashboardChart.native.js.map +1 -1
- package/dist/jsx/workspace/useWorkspaceDoc.native.js.map +1 -1
- package/package.json +12 -12
- package/src/backofficeScreens.designLaw.spec.ts +1 -3
- package/src/list/DoctypeListScreen.auth.spec.tsx +84 -0
- package/src/list/DoctypeListScreen.tsx +18 -51
- package/src/list/filter-chips.tsx +1 -1
- package/src/list/filter-editor.tsx +2 -2
- package/src/list/filter-fields.tsx +29 -356
- package/src/list/filter-standard.tsx +2 -2
- package/src/list/list-tools-sheet.tsx +1 -1
- package/src/list/listColumns.tsx +11 -488
- package/src/list/listFields.ts +9 -66
- package/src/list/listFormat.ts +12 -77
- package/src/list/listShim.spec.ts +101 -0
- package/src/list/statusColors.ts +7 -92
- package/src/report/queryReportColumns.tsx +1 -1
- package/src/report/queryReportFilterBar.tsx +7 -2
- package/src/report/report-grid.tsx +1 -1
- package/src/report/report-toolbar.tsx +1 -1
- package/src/report/reportViewModel.ts +5 -1
- package/types/list/DoctypeListScreen.d.ts +1 -1
- package/types/list/DoctypeListScreen.d.ts.map +1 -1
- package/types/list/filter-editor.d.ts.map +1 -1
- package/types/list/filter-fields.d.ts +10 -78
- package/types/list/filter-fields.d.ts.map +1 -1
- package/types/list/filter-standard.d.ts.map +1 -1
- package/types/list/listColumns.d.ts +10 -40
- package/types/list/listColumns.d.ts.map +1 -1
- package/types/list/listFields.d.ts +5 -13
- package/types/list/listFields.d.ts.map +1 -1
- package/types/list/listFormat.d.ts +5 -27
- package/types/list/listFormat.d.ts.map +1 -1
- package/types/list/statusColors.d.ts +6 -11
- package/types/list/statusColors.d.ts.map +1 -1
- package/types/report/queryReportFilterBar.d.ts.map +1 -1
- package/types/report/reportViewModel.d.ts +1 -1
- package/types/report/reportViewModel.d.ts.map +1 -1
- package/src/list/filter-fields.spec.ts +0 -29
- package/src/list/listFields.spec.ts +0 -148
- package/src/list/listFormat.spec.ts +0 -151
- package/src/list/statusColors.spec.ts +0 -100
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import type { DoctypeMeta } from "../shared/useDoctypeMeta";
|
|
3
|
-
import { standardFiltersFromMeta } from "./filter-fields";
|
|
4
|
-
|
|
5
|
-
const todoMeta: DoctypeMeta = {
|
|
6
|
-
name: "ToDo",
|
|
7
|
-
title_field: "description",
|
|
8
|
-
fields: [
|
|
9
|
-
{
|
|
10
|
-
fieldname: "status",
|
|
11
|
-
fieldtype: "Select",
|
|
12
|
-
label: "Status",
|
|
13
|
-
options: "Open\nClosed",
|
|
14
|
-
in_standard_filter: 1,
|
|
15
|
-
},
|
|
16
|
-
{ fieldname: "description", fieldtype: "Small Text", label: "Description" },
|
|
17
|
-
{ fieldname: "priority", fieldtype: "Select", label: "Priority", in_list_view: 1 },
|
|
18
|
-
],
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
describe("standardFiltersFromMeta", () => {
|
|
22
|
-
it("prepends ID and the title field when they are not already standard filters", () => {
|
|
23
|
-
const names = standardFiltersFromMeta(todoMeta).map((field) => field.fieldname);
|
|
24
|
-
expect(names[0]).toBe("name");
|
|
25
|
-
expect(names).toContain("description");
|
|
26
|
-
expect(names).toContain("status");
|
|
27
|
-
expect(names).not.toContain("priority");
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* listFields — permlevel column pruning (desk parity with base_list.js
|
|
3
|
-
* `get_fields_in_list_view`: in_list_view fields above the session roles'
|
|
4
|
-
* READ permlevel never render as columns). The matrix itself is the form
|
|
5
|
-
* workstream's fieldPermissions module (perm.js parity) — reused, not forked.
|
|
6
|
-
* buildListColumns maps listViewFields 1:1 into column defs, so pruning is
|
|
7
|
-
* asserted here on the pure module (the features vitest node environment
|
|
8
|
-
* cannot import the JSX/components barrel — see vitest.config.mjs).
|
|
9
|
-
*/
|
|
10
|
-
import { describe, expect, it } from "vitest";
|
|
11
|
-
import { buildPermLevelMatrix, type PermLevelMatrix } from "../form/fieldPermissions";
|
|
12
|
-
import type { DoctypeMeta } from "../shared/useDoctypeMeta";
|
|
13
|
-
import { listDocumentColumnIds, listFieldsToFetch, listViewFields } from "./listFields";
|
|
14
|
-
|
|
15
|
-
const meta: DoctypeMeta = {
|
|
16
|
-
name: "User",
|
|
17
|
-
title_field: "full_name",
|
|
18
|
-
fields: [
|
|
19
|
-
{ fieldname: "full_name", fieldtype: "Data", label: "Full Name", in_list_view: 1 },
|
|
20
|
-
{ fieldname: "enabled", fieldtype: "Check", label: "Enabled", in_list_view: 1 },
|
|
21
|
-
{
|
|
22
|
-
fieldname: "role_profile_name",
|
|
23
|
-
fieldtype: "Link",
|
|
24
|
-
label: "Role Profile",
|
|
25
|
-
in_list_view: 1,
|
|
26
|
-
permlevel: 1,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
fieldname: "api_secret_hint",
|
|
30
|
-
fieldtype: "Data",
|
|
31
|
-
label: "API Secret Hint",
|
|
32
|
-
in_list_view: 1,
|
|
33
|
-
permlevel: 2,
|
|
34
|
-
},
|
|
35
|
-
{ fieldname: "bio", fieldtype: "Small Text", label: "Bio" },
|
|
36
|
-
],
|
|
37
|
-
permissions: [
|
|
38
|
-
{ role: "System Manager", permlevel: 0, read: 1, write: 1 },
|
|
39
|
-
{ role: "System Manager", permlevel: 1, read: 1, write: 1 },
|
|
40
|
-
// No rows at permlevel 2 — desk gap-fills {} and hides those fields.
|
|
41
|
-
],
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
function viewFieldnames(matrix?: PermLevelMatrix): string[] {
|
|
45
|
-
return listViewFields(meta, meta.title_field ?? "name", matrix).map((field) => field.fieldname);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
describe("listViewFields permlevel pruning", () => {
|
|
49
|
-
it("without a matrix (fixtures / roles unavailable) prunes nothing", () => {
|
|
50
|
-
const names = viewFieldnames(undefined);
|
|
51
|
-
expect(names).toContain("enabled");
|
|
52
|
-
expect(names).toContain("role_profile_name");
|
|
53
|
-
expect(names).toContain("api_secret_hint");
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("keeps fields whose permlevel the roles can read, prunes the rest", () => {
|
|
57
|
-
const matrix = buildPermLevelMatrix(meta.permissions, ["System Manager"]);
|
|
58
|
-
const names = viewFieldnames(matrix);
|
|
59
|
-
expect(names).toContain("enabled"); // level 0
|
|
60
|
-
expect(names).toContain("role_profile_name"); // level 1 granted
|
|
61
|
-
// Level 2 has no granting rows at all → hidden (desk gap-fill).
|
|
62
|
-
expect(names).not.toContain("api_secret_hint");
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it("prunes every above-zero level for roles with no granting rows", () => {
|
|
66
|
-
const matrix = buildPermLevelMatrix(meta.permissions, ["Desk User"]);
|
|
67
|
-
const names = viewFieldnames(matrix);
|
|
68
|
-
expect(names).toContain("enabled");
|
|
69
|
-
expect(names).not.toContain("role_profile_name");
|
|
70
|
-
expect(names).not.toContain("api_secret_hint");
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it("excludes the title field regardless of the matrix (title column owns it)", () => {
|
|
74
|
-
expect(viewFieldnames(undefined)).not.toContain("full_name");
|
|
75
|
-
const matrix = buildPermLevelMatrix(meta.permissions, ["Desk User"]);
|
|
76
|
-
expect(viewFieldnames(matrix)).not.toContain("full_name");
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it("never includes fields that are not in_list_view", () => {
|
|
80
|
-
expect(viewFieldnames(undefined)).not.toContain("bio");
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
describe("listFieldsToFetch permlevel pruning", () => {
|
|
85
|
-
it("skips unreadable in_list_view fields but keeps bookkeeping fields", () => {
|
|
86
|
-
const matrix = buildPermLevelMatrix(meta.permissions, ["Desk User"]);
|
|
87
|
-
const fields = listFieldsToFetch(meta, matrix);
|
|
88
|
-
expect(fields).toEqual(
|
|
89
|
-
expect.arrayContaining(["name", "modified", "full_name", "enabled", "_comments"]),
|
|
90
|
-
);
|
|
91
|
-
expect(fields).not.toContain("role_profile_name");
|
|
92
|
-
expect(fields).not.toContain("api_secret_hint");
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it("fetches everything in_list_view when no matrix is available", () => {
|
|
96
|
-
const fields = listFieldsToFetch(meta, undefined);
|
|
97
|
-
expect(fields).toContain("role_profile_name");
|
|
98
|
-
expect(fields).toContain("api_secret_hint");
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
// frappe/model/__init__.py default_fields and optional_fields: the only names
|
|
103
|
-
// frappe.desk.reportview.validate_fields lets through without a DocField.
|
|
104
|
-
// Anything else that isn't a field of the doctype answers 417 "Field not
|
|
105
|
-
// permitted in query" for every user without the query bypass (MPO-389).
|
|
106
|
-
const frappeStandardFields = new Set([
|
|
107
|
-
"doctype",
|
|
108
|
-
"name",
|
|
109
|
-
"owner",
|
|
110
|
-
"creation",
|
|
111
|
-
"modified",
|
|
112
|
-
"modified_by",
|
|
113
|
-
"docstatus",
|
|
114
|
-
"idx",
|
|
115
|
-
"_user_tags",
|
|
116
|
-
"_comments",
|
|
117
|
-
"_assign",
|
|
118
|
-
"_liked_by",
|
|
119
|
-
"_seen",
|
|
120
|
-
]);
|
|
121
|
-
|
|
122
|
-
describe("listFieldsToFetch asks only for columns Frappe will select", () => {
|
|
123
|
-
it("names nothing but the doctype's fields and Frappe's standard columns", () => {
|
|
124
|
-
const fieldnames = new Set(meta.fields.map((field) => field.fieldname));
|
|
125
|
-
const rejected = listFieldsToFetch(meta, undefined).filter(
|
|
126
|
-
(name) => !fieldnames.has(name) && !frappeStandardFields.has(name),
|
|
127
|
-
);
|
|
128
|
-
expect(rejected).toEqual([]);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it("reads the comment count from _comments instead of the computed _comment_count", () => {
|
|
132
|
-
const fields = listFieldsToFetch(meta, undefined);
|
|
133
|
-
expect(fields).toContain("_comments");
|
|
134
|
-
expect(fields).not.toContain("_comment_count");
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
describe("listDocumentColumnIds desk list anatomy", () => {
|
|
139
|
-
it("is title, in_list_view values, then the activity cluster — no extra ID/modified", () => {
|
|
140
|
-
expect(listDocumentColumnIds(meta)).toEqual([
|
|
141
|
-
"full_name",
|
|
142
|
-
"enabled",
|
|
143
|
-
"role_profile_name",
|
|
144
|
-
"api_secret_hint",
|
|
145
|
-
"_activity",
|
|
146
|
-
]);
|
|
147
|
-
});
|
|
148
|
-
});
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* listFormat — frappe datetime parsing and desk-style list-cell display
|
|
3
|
-
* helpers. Time-ago fixtures anchor `now` to the parsed date itself so the
|
|
4
|
-
* assertions are timezone-independent.
|
|
5
|
-
*/
|
|
6
|
-
import { describe, expect, it } from "vitest";
|
|
7
|
-
import {
|
|
8
|
-
formatDateCell,
|
|
9
|
-
formatTimeAgo,
|
|
10
|
-
parseFrappeDate,
|
|
11
|
-
parseTagsField,
|
|
12
|
-
parseUserListField,
|
|
13
|
-
stripHtmlPreview,
|
|
14
|
-
} from "./listFormat";
|
|
15
|
-
|
|
16
|
-
describe("parseFrappeDate", () => {
|
|
17
|
-
it("parses frappe datetime strings (space-separated, microseconds)", () => {
|
|
18
|
-
const date = parseFrappeDate("2026-08-12 08:50:24.691936");
|
|
19
|
-
expect(date).toBeInstanceOf(Date);
|
|
20
|
-
expect(date?.getFullYear()).toBe(2026);
|
|
21
|
-
expect(date?.getMonth()).toBe(7); // August
|
|
22
|
-
expect(date?.getDate()).toBe(12);
|
|
23
|
-
expect(date?.getHours()).toBe(8);
|
|
24
|
-
expect(date?.getMinutes()).toBe(50);
|
|
25
|
-
expect(date?.getSeconds()).toBe(24);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("parses plain dates", () => {
|
|
29
|
-
const date = parseFrappeDate("2026-08-12");
|
|
30
|
-
expect(date).toBeInstanceOf(Date);
|
|
31
|
-
expect(Number.isNaN(date?.getTime())).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("returns undefined for invalid input", () => {
|
|
35
|
-
expect(parseFrappeDate("not a date")).toBeUndefined();
|
|
36
|
-
expect(parseFrappeDate("")).toBeUndefined();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe("formatDateCell (LC-12 compact-absolute display register)", () => {
|
|
41
|
-
// Anchor `now` inside the stamp's year so current-year elision is stable.
|
|
42
|
-
const now = parseFrappeDate("2026-01-01 00:00:00") as Date;
|
|
43
|
-
|
|
44
|
-
it("renders the house compact-absolute register, never raw ISO", () => {
|
|
45
|
-
expect(formatDateCell("2026-08-12 08:50:24", now)).toBe("Aug 12");
|
|
46
|
-
expect(formatDateCell("2026-08-12 08:50:24.691936", now)).toBe("Aug 12");
|
|
47
|
-
expect(formatDateCell("2026-08-12", now)).toBe("Aug 12");
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it("keeps the year when not current (display register year:auto)", () => {
|
|
51
|
-
expect(formatDateCell("2025-07-01", now)).toBe("Jul 1, 2025");
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it("passes unparseable input through unchanged (honest passthrough)", () => {
|
|
55
|
-
expect(formatDateCell("garbage", now)).toBe("garbage");
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
describe("formatTimeAgo (LC-12 relative register)", () => {
|
|
60
|
-
const stamp = "2026-08-12 08:00:00";
|
|
61
|
-
const base = parseFrappeDate(stamp) as Date;
|
|
62
|
-
const after = (ms: number) => new Date(base.getTime() + ms);
|
|
63
|
-
const MINUTE = 60_000;
|
|
64
|
-
const HOUR = 60 * MINUTE;
|
|
65
|
-
const DAY = 24 * HOUR;
|
|
66
|
-
|
|
67
|
-
it("speaks the house relative register — one voice, unambiguous units", () => {
|
|
68
|
-
expect(formatTimeAgo(stamp, after(0))).toBe("just now");
|
|
69
|
-
expect(formatTimeAgo(stamp, after(59_000))).toBe("just now");
|
|
70
|
-
expect(formatTimeAgo(stamp, after(MINUTE))).toBe("1m ago");
|
|
71
|
-
expect(formatTimeAgo(stamp, after(59 * MINUTE))).toBe("59m ago");
|
|
72
|
-
expect(formatTimeAgo(stamp, after(HOUR))).toBe("1h ago");
|
|
73
|
-
expect(formatTimeAgo(stamp, after(23 * HOUR + 59 * MINUTE))).toBe("23h ago");
|
|
74
|
-
expect(formatTimeAgo(stamp, after(DAY))).toBe("1 day ago");
|
|
75
|
-
expect(formatTimeAgo(stamp, after(29 * DAY))).toBe("29 days ago");
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it("months use 'mo', never an ambiguous capital M", () => {
|
|
79
|
-
expect(formatTimeAgo(stamp, after(31 * DAY))).toBe("1mo ago");
|
|
80
|
-
expect(formatTimeAgo(stamp, after(330 * DAY))).toBe("11mo ago");
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it("shows years beyond ~12 months", () => {
|
|
84
|
-
expect(formatTimeAgo(stamp, after(366 * DAY))).toBe("1y ago");
|
|
85
|
-
expect(formatTimeAgo(stamp, after(2 * 366 * DAY))).toBe("2y ago");
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("returns the raw value when unparseable", () => {
|
|
89
|
-
expect(formatTimeAgo("garbage", new Date())).toBe("garbage");
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it("treats future timestamps as just now (clamped, never negative)", () => {
|
|
93
|
-
expect(formatTimeAgo(stamp, after(-5 * HOUR))).toBe("just now");
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
describe("parseUserListField (_assign / _liked_by JSON-array-string columns)", () => {
|
|
98
|
-
it("parses the bench shape: a JSON array string", () => {
|
|
99
|
-
expect(parseUserListField('["admin@example.com", "test@example.com"]')).toEqual([
|
|
100
|
-
"admin@example.com",
|
|
101
|
-
"test@example.com",
|
|
102
|
-
]);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it("passes real arrays through, stringifying members", () => {
|
|
106
|
-
expect(parseUserListField(["a@b.c", 42])).toEqual(["a@b.c", "42"]);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it("returns [] for empty, malformed, or non-array JSON", () => {
|
|
110
|
-
expect(parseUserListField("")).toEqual([]);
|
|
111
|
-
expect(parseUserListField(null)).toEqual([]);
|
|
112
|
-
expect(parseUserListField(undefined)).toEqual([]);
|
|
113
|
-
expect(parseUserListField("not json")).toEqual([]);
|
|
114
|
-
expect(parseUserListField('{"a":1}')).toEqual([]);
|
|
115
|
-
expect(parseUserListField(42)).toEqual([]);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
describe("stripHtmlPreview (rich-text cell previews, desk strip_html parity)", () => {
|
|
120
|
-
it("strips Text Editor markup down to its text", () => {
|
|
121
|
-
expect(stripHtmlPreview('<div class="ql-editor read-mode"><p>Call the vendor</p></div>')).toBe(
|
|
122
|
-
"Call the vendor",
|
|
123
|
-
);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it("collapses tags and entities into single spaces", () => {
|
|
127
|
-
expect(stripHtmlPreview("<p>a</p><p>b c</p>")).toBe("a b c");
|
|
128
|
-
expect(stripHtmlPreview("x & y <z>")).toBe("x & y <z>");
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it("passes plain text through untouched (fast path)", () => {
|
|
132
|
-
expect(stripHtmlPreview("plain description")).toBe("plain description");
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
describe("parseTagsField (_user_tags comma-joined column)", () => {
|
|
137
|
-
it("parses the bench shape: leading-comma joined tags", () => {
|
|
138
|
-
expect(parseTagsField(",Urgent,Follow Up")).toEqual(["Urgent", "Follow Up"]);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
it("trims whitespace and drops empty segments", () => {
|
|
142
|
-
expect(parseTagsField(" , a , ,b, ")).toEqual(["a", "b"]);
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
it("returns [] for empty or non-string values", () => {
|
|
146
|
-
expect(parseTagsField("")).toEqual([]);
|
|
147
|
-
expect(parseTagsField(null)).toEqual([]);
|
|
148
|
-
expect(parseTagsField(undefined)).toEqual([]);
|
|
149
|
-
expect(parseTagsField(["a"])).toEqual([]);
|
|
150
|
-
});
|
|
151
|
-
});
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* statusColors — desk indicator-color parity for the list status pill.
|
|
3
|
-
* Workflow `states` from the doctype meta must win over the heuristic
|
|
4
|
-
* word map; everything unknown lands on gray.
|
|
5
|
-
*/
|
|
6
|
-
import { describe, expect, it } from "vitest";
|
|
7
|
-
import type { DoctypeMeta } from "../shared/useDoctypeMeta";
|
|
8
|
-
import { statusPillColors } from "./statusColors";
|
|
9
|
-
|
|
10
|
-
function makeMeta(states: Array<{ title?: string; color?: string }>): DoctypeMeta {
|
|
11
|
-
return { name: "ToDo", fields: [], states } as DoctypeMeta;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
describe("statusPillColors heuristics (no meta)", () => {
|
|
15
|
-
it("maps done/healthy words to green", () => {
|
|
16
|
-
for (const status of ["Closed", "Completed", "Approved", "Paid", "Active", "Delivered"]) {
|
|
17
|
-
expect(statusPillColors(status)).toEqual({ background: "$green3", text: "$green11" });
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("maps in-flight words to orange", () => {
|
|
22
|
-
for (const status of ["Open", "Pending", "In Progress", "Overdue", "Medium"]) {
|
|
23
|
-
expect(statusPillColors(status)).toEqual({ background: "$orange3", text: "$orange11" });
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("maps informational words to blue", () => {
|
|
28
|
-
for (const status of ["Submitted", "Running", "New", "In Review", "Low"]) {
|
|
29
|
-
expect(statusPillColors(status)).toEqual({ background: "$blue3", text: "$blue11" });
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it("maps failed/stopped words to red", () => {
|
|
34
|
-
for (const status of ["Cancelled", "Canceled", "Failed", "Rejected", "Urgent", "High"]) {
|
|
35
|
-
expect(statusPillColors(status)).toEqual({ background: "$red3", text: "$red11" });
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("maps draft and unknown values to gray", () => {
|
|
40
|
-
expect(statusPillColors("Draft")).toEqual({ background: "$gray3", text: "$gray11" });
|
|
41
|
-
expect(statusPillColors("Something Custom")).toEqual({
|
|
42
|
-
background: "$gray3",
|
|
43
|
-
text: "$gray11",
|
|
44
|
-
});
|
|
45
|
-
expect(statusPillColors("")).toEqual({ background: "$gray3", text: "$gray11" });
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it("normalizes case and whitespace", () => {
|
|
49
|
-
expect(statusPillColors(" OPEN ")).toEqual({ background: "$orange3", text: "$orange11" });
|
|
50
|
-
expect(statusPillColors("paid")).toEqual({ background: "$green3", text: "$green11" });
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
describe("statusPillColors with workflow states", () => {
|
|
55
|
-
it("prefers the workflow state color over the word heuristic", () => {
|
|
56
|
-
// Heuristic would say orange for "Open"; the workflow says Red.
|
|
57
|
-
const meta = makeMeta([{ title: "Open", color: "Red" }]);
|
|
58
|
-
expect(statusPillColors("Open", meta)).toEqual({ background: "$red3", text: "$red11" });
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it("matches state titles case-insensitively and trims", () => {
|
|
62
|
-
const meta = makeMeta([{ title: " open ", color: "Green" }]);
|
|
63
|
-
expect(statusPillColors("Open", meta)).toEqual({ background: "$green3", text: "$green11" });
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("maps desk color aliases onto ramp families", () => {
|
|
67
|
-
const cases: Array<[string, string]> = [
|
|
68
|
-
["Light-Blue", "blue"],
|
|
69
|
-
["cyan", "blue"],
|
|
70
|
-
["Amber", "yellow"],
|
|
71
|
-
["Grey", "gray"],
|
|
72
|
-
["darkgrey", "gray"],
|
|
73
|
-
["Purple", "purple"],
|
|
74
|
-
["Pink", "pink"],
|
|
75
|
-
];
|
|
76
|
-
for (const [deskColor, ramp] of cases) {
|
|
77
|
-
const meta = makeMeta([{ title: "Custom", color: deskColor }]);
|
|
78
|
-
expect(statusPillColors("Custom", meta)).toEqual({
|
|
79
|
-
background: `$${ramp}3`,
|
|
80
|
-
text: `$${ramp}11`,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("falls back to the heuristic for unknown desk colors", () => {
|
|
86
|
-
const meta = makeMeta([{ title: "Open", color: "Teal" }]);
|
|
87
|
-
expect(statusPillColors("Open", meta)).toEqual({ background: "$orange3", text: "$orange11" });
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it("falls back to the heuristic when the state has no color or no match", () => {
|
|
91
|
-
expect(statusPillColors("Open", makeMeta([{ title: "Open" }]))).toEqual({
|
|
92
|
-
background: "$orange3",
|
|
93
|
-
text: "$orange11",
|
|
94
|
-
});
|
|
95
|
-
expect(statusPillColors("Closed", makeMeta([{ title: "Open", color: "Red" }]))).toEqual({
|
|
96
|
-
background: "$green3",
|
|
97
|
-
text: "$green11",
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|