@multiplatform.one/backoffice 7.76.0 → 7.77.0
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/chrome/BackofficeAwesomebar.native.js +1 -1
- package/dist/cjs/chrome/BackofficeAwesomebar.native.js.map +1 -1
- package/dist/cjs/chrome/CommandPalette.native.js +1 -1
- package/dist/cjs/chrome/CommandPalette.native.js.map +1 -1
- package/dist/cjs/chrome/HelpMenu.native.js +1 -1
- package/dist/cjs/chrome/HelpMenu.native.js.map +1 -1
- package/dist/cjs/chrome/NotificationsButton.native.js +1 -1
- package/dist/cjs/chrome/NotificationsButton.native.js.map +1 -1
- package/dist/cjs/chrome/UserMenu.native.js +1 -1
- package/dist/cjs/chrome/UserMenu.native.js.map +1 -1
- package/dist/cjs/chrome/awesomebar-data.cjs +79 -33
- package/dist/cjs/chrome/awesomebar-data.native.js +101 -45
- package/dist/cjs/chrome/awesomebar-data.native.js.map +1 -1
- package/dist/cjs/chrome/command-palette-model.native.js +1 -1
- package/dist/cjs/chrome/command-palette-model.native.js.map +1 -1
- package/dist/cjs/chrome/help-about-dialog.native.js +1 -1
- package/dist/cjs/chrome/help-about-dialog.native.js.map +1 -1
- package/dist/cjs/chrome/help-shortcuts-dialog.native.js +1 -1
- package/dist/cjs/chrome/help-shortcuts-dialog.native.js.map +1 -1
- package/dist/cjs/chrome/notifications-data.native.js.map +1 -1
- package/dist/cjs/chrome/notifications-panel.native.js +1 -1
- package/dist/cjs/chrome/notifications-panel.native.js.map +1 -1
- package/dist/cjs/chrome/notifications-utils.native.js.map +1 -1
- package/dist/cjs/chrome/shortcuts.native.js.map +1 -1
- package/dist/cjs/chrome/user-session.native.js.map +1 -1
- package/dist/cjs/config/BackofficeProvider.native.js +1 -1
- package/dist/cjs/config/BackofficeProvider.native.js.map +1 -1
- package/dist/cjs/config/capabilities.cjs +4 -0
- package/dist/cjs/config/capabilities.native.js +4 -0
- package/dist/cjs/config/capabilities.native.js.map +1 -1
- package/dist/cjs/config/events.native.js.map +1 -1
- package/dist/cjs/config/slots.native.js.map +1 -1
- package/dist/cjs/desk/Desk.cjs +6 -1
- package/dist/cjs/desk/Desk.native.js +6 -1
- package/dist/cjs/desk/Desk.native.js.map +1 -1
- package/dist/cjs/desk/DeskSurface.cjs +3 -0
- package/dist/cjs/desk/DeskSurface.native.js +3 -0
- package/dist/cjs/desk/DeskSurface.native.js.map +1 -1
- package/dist/cjs/desk/resolveDeskPath.cjs +5 -0
- package/dist/cjs/desk/resolveDeskPath.native.js +5 -0
- package/dist/cjs/desk/resolveDeskPath.native.js.map +1 -1
- package/dist/cjs/desk/scope.native.js.map +1 -1
- package/dist/cjs/desk/target.cjs +4 -0
- package/dist/cjs/desk/target.native.js +4 -0
- package/dist/cjs/desk/target.native.js.map +1 -1
- package/dist/cjs/form/DocFormScreen.native.js +1 -1
- package/dist/cjs/form/DocFormScreen.native.js.map +1 -1
- package/dist/cjs/form/FormConnections.native.js +1 -1
- package/dist/cjs/form/FormConnections.native.js.map +1 -1
- package/dist/cjs/form/FormDialogs.native.js +1 -1
- package/dist/cjs/form/FormDialogs.native.js.map +1 -1
- package/dist/cjs/form/FormErrorBoundary.native.js +1 -1
- package/dist/cjs/form/FormErrorBoundary.native.js.map +1 -1
- package/dist/cjs/form/FormHeaderCluster.native.js +1 -1
- package/dist/cjs/form/FormHeaderCluster.native.js.map +1 -1
- package/dist/cjs/form/FormSidebarPanel.native.js +1 -1
- package/dist/cjs/form/FormSidebarPanel.native.js.map +1 -1
- package/dist/cjs/form/FormTimeline.native.js +1 -1
- package/dist/cjs/form/FormTimeline.native.js.map +1 -1
- package/dist/cjs/form/FormToolbar.native.js +1 -1
- package/dist/cjs/form/FormToolbar.native.js.map +1 -1
- package/dist/cjs/form/connections-data.native.js.map +1 -1
- package/dist/cjs/form/createPrefill.native.js.map +1 -1
- package/dist/cjs/form/dependsOn.native.js.map +1 -1
- package/dist/cjs/form/dirtyTracking.native.js.map +1 -1
- package/dist/cjs/form/docinfo.native.js.map +1 -1
- package/dist/cjs/form/fetchFrom.native.js.map +1 -1
- package/dist/cjs/form/fieldPermissions.native.js.map +1 -1
- package/dist/cjs/form/formActions.native.js.map +1 -1
- package/dist/cjs/form/formLayout.native.js.map +1 -1
- package/dist/cjs/form/platformHooks.native.js.map +1 -1
- package/dist/cjs/form/sidebar-attachments.native.js +1 -1
- package/dist/cjs/form/sidebar-attachments.native.js.map +1 -1
- package/dist/cjs/form/sidebar-dialogs.native.js +1 -1
- package/dist/cjs/form/sidebar-dialogs.native.js.map +1 -1
- package/dist/cjs/form/sidebar-people.native.js +1 -1
- package/dist/cjs/form/sidebar-people.native.js.map +1 -1
- package/dist/cjs/form/sidebar-rpc.native.js.map +1 -1
- package/dist/cjs/form/sidebar-utils.native.js.map +1 -1
- package/dist/cjs/form/timeline-entries.native.js.map +1 -1
- package/dist/cjs/form/timeline-utils.native.js.map +1 -1
- package/dist/cjs/form/useFormEngine.native.js.map +1 -1
- package/dist/cjs/formBuilder/DoctypePicker.native.js +1 -1
- package/dist/cjs/formBuilder/DoctypePicker.native.js.map +1 -1
- package/dist/cjs/formBuilder/FieldPalette.native.js +1 -1
- package/dist/cjs/formBuilder/FieldPalette.native.js.map +1 -1
- package/dist/cjs/formBuilder/FieldPropertiesPanel.native.js +1 -1
- package/dist/cjs/formBuilder/FieldPropertiesPanel.native.js.map +1 -1
- package/dist/cjs/formBuilder/FormBuilderCanvas.native.js +1 -1
- package/dist/cjs/formBuilder/FormBuilderCanvas.native.js.map +1 -1
- package/dist/cjs/formBuilder/FormBuilderScreen.native.js +1 -1
- package/dist/cjs/formBuilder/FormBuilderScreen.native.js.map +1 -1
- package/dist/cjs/formBuilder/api.native.js.map +1 -1
- package/dist/cjs/formBuilder/fieldtypes.native.js.map +1 -1
- package/dist/cjs/formBuilder/index.native.js.map +1 -1
- package/dist/cjs/formBuilder/model.native.js.map +1 -1
- package/dist/cjs/formBuilder/useFormBuilderDrag.native.js +1 -1
- package/dist/cjs/formBuilder/useFormBuilderDrag.native.js.map +1 -1
- package/dist/cjs/i18n/en.native.js.map +1 -1
- package/dist/cjs/i18n/index.native.js.map +1 -1
- package/dist/cjs/index.cjs +6 -0
- package/dist/cjs/index.native.js +8 -2
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/list/AddTagsDialog.native.js +1 -1
- package/dist/cjs/list/AddTagsDialog.native.js.map +1 -1
- package/dist/cjs/list/AssignToDialog.native.js +1 -1
- package/dist/cjs/list/AssignToDialog.native.js.map +1 -1
- package/dist/cjs/list/DoctypeListScreen.native.js +1 -1
- package/dist/cjs/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/cjs/list/ListBulkActionsBar.native.js +1 -1
- package/dist/cjs/list/ListBulkActionsBar.native.js.map +1 -1
- package/dist/cjs/list/ListFilterBar.native.js +1 -1
- package/dist/cjs/list/ListFilterBar.native.js.map +1 -1
- package/dist/cjs/list/ListSidebar.native.js +1 -1
- package/dist/cjs/list/ListSidebar.native.js.map +1 -1
- package/dist/cjs/list/bulk-edit-dialog.native.js +1 -1
- package/dist/cjs/list/bulk-edit-dialog.native.js.map +1 -1
- package/dist/cjs/list/bulk-export.native.js.map +1 -1
- package/dist/cjs/list/bulk-submit-cancel.native.js.map +1 -1
- package/dist/cjs/list/bulkActions.native.js.map +1 -1
- package/dist/cjs/list/filter-chips.native.js +1 -1
- package/dist/cjs/list/filter-chips.native.js.map +1 -1
- package/dist/cjs/list/filter-editor.native.js +1 -1
- package/dist/cjs/list/filter-editor.native.js.map +1 -1
- package/dist/cjs/list/filter-fields.native.js.map +1 -1
- package/dist/cjs/list/filter-saved.native.js +1 -1
- package/dist/cjs/list/filter-saved.native.js.map +1 -1
- package/dist/cjs/list/filter-sort.native.js +1 -1
- package/dist/cjs/list/filter-sort.native.js.map +1 -1
- package/dist/cjs/list/filter-standard.native.js.map +1 -1
- package/dist/cjs/list/filterConversion.native.js.map +1 -1
- package/dist/cjs/list/list-paging.native.js +1 -1
- package/dist/cjs/list/list-paging.native.js.map +1 -1
- package/dist/cjs/list/list-tools-sheet.native.js +1 -1
- package/dist/cjs/list/list-tools-sheet.native.js.map +1 -1
- package/dist/cjs/list/listColumns.native.js.map +1 -1
- package/dist/cjs/list/listFields.native.js.map +1 -1
- package/dist/cjs/list/listFormat.native.js.map +1 -1
- package/dist/cjs/list/listUrlState.native.js.map +1 -1
- package/dist/cjs/list/sidebar-section.native.js +1 -1
- package/dist/cjs/list/sidebar-section.native.js.map +1 -1
- package/dist/cjs/list/sidebar-stats.native.js.map +1 -1
- package/dist/cjs/list/statusColors.native.js.map +1 -1
- package/dist/cjs/navigation/navigator.native.js.map +1 -1
- package/dist/cjs/navigation/paths.cjs +8 -1
- package/dist/cjs/navigation/paths.native.js +9 -0
- package/dist/cjs/navigation/paths.native.js.map +1 -1
- package/dist/cjs/oneAdapter/index.native.js.map +1 -1
- package/dist/cjs/quickEntry/QuickEntryDialog.native.js +1 -1
- package/dist/cjs/quickEntry/QuickEntryDialog.native.js.map +1 -1
- package/dist/cjs/quickEntry/quickEntryPlan.native.js.map +1 -1
- package/dist/cjs/report/DoctypeReportView.native.js.map +1 -1
- package/dist/cjs/report/QueryReportScreen.native.js +1 -1
- package/dist/cjs/report/QueryReportScreen.native.js.map +1 -1
- package/dist/cjs/report/queryReportColumns.native.js.map +1 -1
- package/dist/cjs/report/queryReportFilterBar.native.js +1 -1
- package/dist/cjs/report/queryReportFilterBar.native.js.map +1 -1
- package/dist/cjs/report/queryReportUrlState.native.js.map +1 -1
- package/dist/cjs/report/report-grid.native.js.map +1 -1
- package/dist/cjs/report/report-toolbar.native.js.map +1 -1
- package/dist/cjs/report/reportShapes.native.js.map +1 -1
- package/dist/cjs/report/reportViewModel.native.js.map +1 -1
- package/dist/cjs/report/savedReports.native.js.map +1 -1
- package/dist/cjs/report/useQueryReport.native.js.map +1 -1
- package/dist/cjs/shared/deskLinks.native.js.map +1 -1
- package/dist/cjs/shared/listNavContext.native.js.map +1 -1
- package/dist/cjs/shared/measures.native.js.map +1 -1
- package/dist/cjs/shared/sessionUser.native.js.map +1 -1
- package/dist/cjs/shared/types.native.js.map +1 -1
- package/dist/cjs/shared/useDocinfo.native.js.map +1 -1
- package/dist/cjs/shared/useDoctypeMeta.native.js.map +1 -1
- package/dist/cjs/shared/useFrappeApp.native.js.map +1 -1
- package/dist/cjs/shared/useRecentVisit.native.js.map +1 -1
- package/dist/cjs/shared/useSessionUserId.native.js.map +1 -1
- package/dist/cjs/shared/useSlugTarget.native.js.map +1 -1
- package/dist/cjs/shared/useUserRoles.native.js.map +1 -1
- package/dist/cjs/shell/AllDoctypesScreen.cjs +331 -0
- package/dist/cjs/shell/AllDoctypesScreen.native.js +460 -0
- package/dist/cjs/shell/AllDoctypesScreen.native.js.map +1 -0
- package/dist/cjs/shell/BackofficeShell.native.js +1 -1
- package/dist/cjs/shell/BackofficeShell.native.js.map +1 -1
- package/dist/cjs/shell/HomeRedirect.native.js +1 -1
- package/dist/cjs/shell/HomeRedirect.native.js.map +1 -1
- package/dist/cjs/shell/NotFoundScreen.native.js +1 -1
- package/dist/cjs/shell/NotFoundScreen.native.js.map +1 -1
- package/dist/cjs/shell/SlugScreen.native.js +1 -1
- package/dist/cjs/shell/SlugScreen.native.js.map +1 -1
- package/dist/cjs/shell/WorkspaceSidebar.cjs +34 -11
- package/dist/cjs/shell/WorkspaceSidebar.native.js +37 -12
- package/dist/cjs/shell/WorkspaceSidebar.native.js.map +1 -1
- package/dist/cjs/shell/shellSidebarSlot.native.js.map +1 -1
- package/dist/cjs/shell/shellTopBarSlot.native.js.map +1 -1
- package/dist/cjs/shell/useWorkspaces.native.js.map +1 -1
- package/dist/cjs/shell/workspaceIcons.cjs +32 -0
- package/dist/cjs/shell/workspaceIcons.native.js +32 -0
- package/dist/cjs/shell/workspaceIcons.native.js.map +1 -1
- package/dist/cjs/views/CalendarView.native.js +1 -1
- package/dist/cjs/views/CalendarView.native.js.map +1 -1
- package/dist/cjs/views/DashboardView.native.js +1 -1
- package/dist/cjs/views/DashboardView.native.js.map +1 -1
- package/dist/cjs/views/DoctypeViewScreen.native.js.map +1 -1
- package/dist/cjs/views/ImageView.native.js +1 -1
- package/dist/cjs/views/ImageView.native.js.map +1 -1
- package/dist/cjs/views/KanbanView.native.js +1 -1
- package/dist/cjs/views/KanbanView.native.js.map +1 -1
- package/dist/cjs/views/ReportView.native.js.map +1 -1
- package/dist/cjs/views/TreeView.native.js +1 -1
- package/dist/cjs/views/TreeView.native.js.map +1 -1
- package/dist/cjs/views/ViewHeader.native.js +1 -1
- package/dist/cjs/views/ViewHeader.native.js.map +1 -1
- package/dist/cjs/views/ViewStates.native.js +1 -1
- package/dist/cjs/views/ViewStates.native.js.map +1 -1
- package/dist/cjs/views/ViewSwitcherMenu.native.js +1 -1
- package/dist/cjs/views/ViewSwitcherMenu.native.js.map +1 -1
- package/dist/cjs/views/calendar-field-selector.native.js +1 -1
- package/dist/cjs/views/calendar-field-selector.native.js.map +1 -1
- package/dist/cjs/views/connection.native.js.map +1 -1
- package/dist/cjs/views/dashboard-data.native.js.map +1 -1
- package/dist/cjs/views/deskViewConfigs.native.js.map +1 -1
- package/dist/cjs/views/kanban-board-controls.native.js +1 -1
- package/dist/cjs/views/kanban-board-controls.native.js.map +1 -1
- package/dist/cjs/views/kanban-field-picker.native.js +1 -1
- package/dist/cjs/views/kanban-field-picker.native.js.map +1 -1
- package/dist/cjs/views/kanbanBoardOps.native.js.map +1 -1
- package/dist/cjs/views/report-controls.native.js +1 -1
- package/dist/cjs/views/report-controls.native.js.map +1 -1
- package/dist/cjs/views/viewAvailability.native.js.map +1 -1
- package/dist/cjs/views/viewMeta.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceChartBlock.native.js +1 -1
- package/dist/cjs/workspace/WorkspaceChartBlock.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceGrid.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceLinkCard.native.js +1 -1
- package/dist/cjs/workspace/WorkspaceLinkCard.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceLinkDirectory.native.js +1 -1
- package/dist/cjs/workspace/WorkspaceLinkDirectory.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceNumberCard.native.js +1 -1
- package/dist/cjs/workspace/WorkspaceNumberCard.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceQuickList.native.js +1 -1
- package/dist/cjs/workspace/WorkspaceQuickList.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceRecents.native.js +1 -1
- package/dist/cjs/workspace/WorkspaceRecents.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceScreen.native.js +1 -1
- package/dist/cjs/workspace/WorkspaceScreen.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceShortcut.native.js +1 -1
- package/dist/cjs/workspace/WorkspaceShortcut.native.js.map +1 -1
- package/dist/cjs/workspace/parseContent.native.js.map +1 -1
- package/dist/cjs/workspace/types.native.js.map +1 -1
- package/dist/cjs/workspace/useDashboardChart.native.js.map +1 -1
- package/dist/cjs/workspace/useWorkspaceDoc.native.js.map +1 -1
- package/dist/esm/chrome/awesomebar-data.mjs +79 -33
- package/dist/esm/chrome/awesomebar-data.mjs.map +1 -1
- package/dist/esm/chrome/awesomebar-data.native.js +101 -45
- package/dist/esm/chrome/awesomebar-data.native.js.map +1 -1
- package/dist/esm/config/BackofficeProvider.mjs.map +1 -1
- package/dist/esm/config/BackofficeProvider.native.js.map +1 -1
- package/dist/esm/config/capabilities.mjs +4 -0
- package/dist/esm/config/capabilities.mjs.map +1 -1
- package/dist/esm/config/capabilities.native.js +4 -0
- package/dist/esm/config/capabilities.native.js.map +1 -1
- package/dist/esm/desk/Desk.mjs +6 -1
- package/dist/esm/desk/Desk.mjs.map +1 -1
- package/dist/esm/desk/Desk.native.js +6 -1
- package/dist/esm/desk/Desk.native.js.map +1 -1
- package/dist/esm/desk/DeskSurface.mjs +3 -0
- package/dist/esm/desk/DeskSurface.mjs.map +1 -1
- package/dist/esm/desk/DeskSurface.native.js +3 -0
- package/dist/esm/desk/DeskSurface.native.js.map +1 -1
- package/dist/esm/desk/resolveDeskPath.mjs +6 -1
- package/dist/esm/desk/resolveDeskPath.mjs.map +1 -1
- package/dist/esm/desk/resolveDeskPath.native.js +6 -1
- package/dist/esm/desk/resolveDeskPath.native.js.map +1 -1
- package/dist/esm/desk/target.mjs +4 -0
- package/dist/esm/desk/target.mjs.map +1 -1
- package/dist/esm/desk/target.native.js +4 -0
- package/dist/esm/desk/target.native.js.map +1 -1
- package/dist/esm/index.mjs +4 -3
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +4 -3
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/navigation/paths.mjs +7 -2
- package/dist/esm/navigation/paths.mjs.map +1 -1
- package/dist/esm/navigation/paths.native.js +8 -1
- package/dist/esm/navigation/paths.native.js.map +1 -1
- package/dist/esm/shell/AllDoctypesScreen.mjs +304 -0
- package/dist/esm/shell/AllDoctypesScreen.mjs.map +1 -0
- package/dist/esm/shell/AllDoctypesScreen.native.js +430 -0
- package/dist/esm/shell/AllDoctypesScreen.native.js.map +1 -0
- package/dist/esm/shell/WorkspaceSidebar.mjs +33 -10
- package/dist/esm/shell/WorkspaceSidebar.mjs.map +1 -1
- package/dist/esm/shell/WorkspaceSidebar.native.js +35 -10
- package/dist/esm/shell/WorkspaceSidebar.native.js.map +1 -1
- package/dist/esm/shell/workspaceIcons.mjs +33 -2
- package/dist/esm/shell/workspaceIcons.mjs.map +1 -1
- package/dist/esm/shell/workspaceIcons.native.js +33 -2
- package/dist/esm/shell/workspaceIcons.native.js.map +1 -1
- package/dist/jsx/chrome/awesomebar-data.mjs +79 -33
- package/dist/jsx/chrome/awesomebar-data.mjs.map +1 -1
- package/dist/jsx/chrome/awesomebar-data.native.js +101 -45
- package/dist/jsx/chrome/awesomebar-data.native.js.map +1 -1
- package/dist/jsx/config/BackofficeProvider.mjs.map +1 -1
- package/dist/jsx/config/BackofficeProvider.native.js.map +1 -1
- package/dist/jsx/config/capabilities.mjs +4 -0
- package/dist/jsx/config/capabilities.mjs.map +1 -1
- package/dist/jsx/config/capabilities.native.js +4 -0
- package/dist/jsx/config/capabilities.native.js.map +1 -1
- package/dist/jsx/desk/Desk.mjs +6 -1
- package/dist/jsx/desk/Desk.mjs.map +1 -1
- package/dist/jsx/desk/Desk.native.js +6 -1
- package/dist/jsx/desk/Desk.native.js.map +1 -1
- package/dist/jsx/desk/DeskSurface.mjs +3 -0
- package/dist/jsx/desk/DeskSurface.mjs.map +1 -1
- package/dist/jsx/desk/DeskSurface.native.js +3 -0
- package/dist/jsx/desk/DeskSurface.native.js.map +1 -1
- package/dist/jsx/desk/resolveDeskPath.mjs +6 -1
- package/dist/jsx/desk/resolveDeskPath.mjs.map +1 -1
- package/dist/jsx/desk/resolveDeskPath.native.js +5 -0
- package/dist/jsx/desk/resolveDeskPath.native.js.map +1 -1
- package/dist/jsx/desk/target.mjs +4 -0
- package/dist/jsx/desk/target.mjs.map +1 -1
- package/dist/jsx/desk/target.native.js +4 -0
- package/dist/jsx/desk/target.native.js.map +1 -1
- package/dist/jsx/index.js +4 -3
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +4 -3
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +6 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/navigation/paths.mjs +7 -2
- package/dist/jsx/navigation/paths.mjs.map +1 -1
- package/dist/jsx/navigation/paths.native.js +9 -0
- package/dist/jsx/navigation/paths.native.js.map +1 -1
- package/dist/jsx/shell/AllDoctypesScreen.mjs +304 -0
- package/dist/jsx/shell/AllDoctypesScreen.mjs.map +1 -0
- package/dist/jsx/shell/AllDoctypesScreen.native.js +460 -0
- package/dist/jsx/shell/AllDoctypesScreen.native.js.map +1 -0
- package/dist/jsx/shell/WorkspaceSidebar.mjs +33 -10
- package/dist/jsx/shell/WorkspaceSidebar.mjs.map +1 -1
- package/dist/jsx/shell/WorkspaceSidebar.native.js +36 -11
- package/dist/jsx/shell/WorkspaceSidebar.native.js.map +1 -1
- package/dist/jsx/shell/workspaceIcons.mjs +33 -2
- package/dist/jsx/shell/workspaceIcons.mjs.map +1 -1
- package/dist/jsx/shell/workspaceIcons.native.js +32 -0
- package/dist/jsx/shell/workspaceIcons.native.js.map +1 -1
- package/package.json +12 -12
- package/src/chrome/CommandPalette.spec.tsx +12 -0
- package/src/chrome/awesomebar-data.tsx +115 -38
- package/src/config/BackofficeProvider.tsx +9 -4
- package/src/config/capabilities.spec.ts +19 -1
- package/src/config/capabilities.ts +13 -4
- package/src/desk/Desk.tsx +20 -4
- package/src/desk/DeskSurface.tsx +3 -0
- package/src/desk/resolveDeskPath.spec.ts +4 -0
- package/src/desk/resolveDeskPath.ts +7 -1
- package/src/desk/target.ts +3 -0
- package/src/index.ts +7 -1
- package/src/navigation/paths.ts +11 -0
- package/src/shell/AllDoctypes.stories.tsx +164 -0
- package/src/shell/AllDoctypesScreen.screen.spec.tsx +290 -0
- package/src/shell/AllDoctypesScreen.tsx +389 -0
- package/src/shell/WorkspaceSidebar.spec.tsx +11 -1
- package/src/shell/WorkspaceSidebar.tsx +39 -19
- package/src/shell/workspaceIcons.ts +45 -0
- package/types/chrome/awesomebar-data.d.ts +14 -3
- package/types/chrome/awesomebar-data.d.ts.map +1 -1
- package/types/config/BackofficeProvider.d.ts +9 -4
- package/types/config/BackofficeProvider.d.ts.map +1 -1
- package/types/config/capabilities.d.ts +7 -1
- package/types/config/capabilities.d.ts.map +1 -1
- package/types/desk/Desk.d.ts +8 -3
- package/types/desk/Desk.d.ts.map +1 -1
- package/types/desk/DeskSurface.d.ts.map +1 -1
- package/types/desk/resolveDeskPath.d.ts +3 -1
- package/types/desk/resolveDeskPath.d.ts.map +1 -1
- package/types/desk/target.d.ts +2 -0
- package/types/desk/target.d.ts.map +1 -1
- package/types/index.d.ts +6 -4
- package/types/index.d.ts.map +1 -1
- package/types/navigation/paths.d.ts +6 -0
- package/types/navigation/paths.d.ts.map +1 -1
- package/types/shell/AllDoctypesScreen.d.ts +18 -0
- package/types/shell/AllDoctypesScreen.d.ts.map +1 -0
- package/types/shell/WorkspaceSidebar.d.ts.map +1 -1
- package/types/shell/workspaceIcons.d.ts +2 -0
- package/types/shell/workspaceIcons.d.ts.map +1 -1
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { BackofficeParams } from "../navigation/navigator";
|
|
12
12
|
import {
|
|
13
|
+
ALL_DOCTYPES_SEGMENT,
|
|
13
14
|
BACKOFFICE_BASE,
|
|
14
15
|
isBackofficeView,
|
|
15
16
|
parseDocDefaults,
|
|
@@ -32,6 +33,7 @@ export interface DeskViewParams {
|
|
|
32
33
|
*/
|
|
33
34
|
export type DeskAddress =
|
|
34
35
|
| { kind: "home" }
|
|
36
|
+
| { kind: "all-doctypes" }
|
|
35
37
|
| { kind: "form-builder"; doctype?: string }
|
|
36
38
|
| { kind: "slug"; slug: string; filtersParam?: string; sortParam?: string }
|
|
37
39
|
| {
|
|
@@ -59,7 +61,7 @@ function decode(segment: string): string {
|
|
|
59
61
|
|
|
60
62
|
/**
|
|
61
63
|
* Resolve `path` (no query string; query lives in `params`, One-router
|
|
62
|
-
* semantics) against the
|
|
64
|
+
* semantics) against the eight route shapes `createBackofficePaths` writes.
|
|
63
65
|
* Paths outside `basePath` resolve to `not-found`.
|
|
64
66
|
*/
|
|
65
67
|
export function resolveDeskPath(
|
|
@@ -78,6 +80,10 @@ export function resolveDeskPath(
|
|
|
78
80
|
const segments = rest.split("/").filter(Boolean).map(decode);
|
|
79
81
|
if (segments.length === 0) return { kind: "home" };
|
|
80
82
|
|
|
83
|
+
if (segments.length === 1 && segments[0] === ALL_DOCTYPES_SEGMENT) {
|
|
84
|
+
return { kind: "all-doctypes" };
|
|
85
|
+
}
|
|
86
|
+
|
|
81
87
|
if (segments.length === 1 && segments[0] === "customize-form") {
|
|
82
88
|
return { kind: "form-builder", doctype: first(params.doc_type) };
|
|
83
89
|
}
|
package/src/desk/target.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { resolveDeskPath, type DeskAddress, type DeskViewParams } from "./resolv
|
|
|
20
20
|
|
|
21
21
|
export type DeskTarget =
|
|
22
22
|
| { kind: "home" }
|
|
23
|
+
| { kind: "all-doctypes" }
|
|
23
24
|
| { kind: "form-builder"; doctype?: string }
|
|
24
25
|
| { kind: "workspace"; workspace: string }
|
|
25
26
|
| { kind: "list"; doctype: string; filtersParam?: string; sortParam?: string }
|
|
@@ -73,6 +74,8 @@ function addressToTarget(
|
|
|
73
74
|
switch (address.kind) {
|
|
74
75
|
case "home":
|
|
75
76
|
return { kind: "home" };
|
|
77
|
+
case "all-doctypes":
|
|
78
|
+
return { kind: "all-doctypes" };
|
|
76
79
|
case "form-builder":
|
|
77
80
|
return { kind: "form-builder", doctype: address.doctype };
|
|
78
81
|
case "report":
|
package/src/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ export { isDoctypeAllowed, resolveCapabilities } from "./config/capabilities";
|
|
|
35
35
|
export type {
|
|
36
36
|
BackofficeCapabilities,
|
|
37
37
|
BackofficeDoctypeScope,
|
|
38
|
+
BackofficeDoctypes,
|
|
38
39
|
CapabilityInput,
|
|
39
40
|
ResolvedBackofficeCapabilities,
|
|
40
41
|
ResolvedCapability,
|
|
@@ -75,7 +76,9 @@ export type {
|
|
|
75
76
|
ControlledNavigatorHandlers,
|
|
76
77
|
} from "./navigation/navigator";
|
|
77
78
|
export {
|
|
79
|
+
ALL_DOCTYPES_SEGMENT,
|
|
78
80
|
BACKOFFICE_BASE,
|
|
81
|
+
allDoctypesPath,
|
|
79
82
|
BACKOFFICE_VIEWS,
|
|
80
83
|
createBackofficePaths,
|
|
81
84
|
formPath,
|
|
@@ -109,11 +112,13 @@ export { HomeRedirect } from "./shell/HomeRedirect";
|
|
|
109
112
|
export { SlugScreen } from "./shell/SlugScreen";
|
|
110
113
|
export type { SlugScreenProps } from "./shell/SlugScreen";
|
|
111
114
|
export { NotFoundScreen } from "./shell/NotFoundScreen";
|
|
115
|
+
export { AllDoctypesScreen, groupDoctypesByModule } from "./shell/AllDoctypesScreen";
|
|
116
|
+
export type { DoctypeModuleGroup } from "./shell/AllDoctypesScreen";
|
|
112
117
|
export { WORKSPACE_SIDEBAR_WIDTH, WorkspaceSidebar } from "./shell/WorkspaceSidebar";
|
|
113
118
|
export type { WorkspaceSidebarProps } from "./shell/WorkspaceSidebar";
|
|
114
119
|
export { useDefaultWorkspace, useSessionUser, useWorkspaces } from "./shell/useWorkspaces";
|
|
115
120
|
export type { WorkspaceDoc, WorkspacesResult } from "./shell/useWorkspaces";
|
|
116
|
-
export { workspaceIcon } from "./shell/workspaceIcons";
|
|
121
|
+
export { moduleIcon, workspaceIcon } from "./shell/workspaceIcons";
|
|
117
122
|
|
|
118
123
|
// Chrome
|
|
119
124
|
export { BackofficeAwesomebar } from "./chrome/BackofficeAwesomebar";
|
|
@@ -141,6 +146,7 @@ export {
|
|
|
141
146
|
export type {
|
|
142
147
|
AwesomebarCatalog,
|
|
143
148
|
AwesomebarCatalogState,
|
|
149
|
+
AwesomebarDoctype,
|
|
144
150
|
AwesomebarWorkspace,
|
|
145
151
|
GlobalSearchHit,
|
|
146
152
|
GlobalSearchState,
|
package/src/navigation/paths.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* {base}/[slug]/new → new document (optional `?d=` JSON prefill)
|
|
9
9
|
* {base}/[slug]/[name] → document form page
|
|
10
10
|
* {base}/customize-form → form builder (`?doc_type=` picks the DocType)
|
|
11
|
+
* {base}/all-doctypes → every DocType on offer, grouped by module
|
|
11
12
|
*
|
|
12
13
|
* Slugs follow frappe's router slugs: lowercase, spaces → dashes
|
|
13
14
|
* ("Sales Order" → "sales-order").
|
|
@@ -22,6 +23,9 @@
|
|
|
22
23
|
|
|
23
24
|
export const BACKOFFICE_BASE = "/backoffice";
|
|
24
25
|
|
|
26
|
+
/** Reserved first segment of the All DocTypes page. */
|
|
27
|
+
export const ALL_DOCTYPES_SEGMENT = "all-doctypes";
|
|
28
|
+
|
|
25
29
|
export type BackofficeSubPath = `${typeof BACKOFFICE_BASE}/${string}`;
|
|
26
30
|
export type BackofficePath = typeof BACKOFFICE_BASE | BackofficeSubPath;
|
|
27
31
|
|
|
@@ -96,6 +100,8 @@ export interface BackofficePaths {
|
|
|
96
100
|
formBuilder(doctype?: string): string;
|
|
97
101
|
/** Query/Script Report page (desk /app/query-report/<name>). */
|
|
98
102
|
queryReport(reportName: string): string;
|
|
103
|
+
/** Every DocType on offer, grouped by module. */
|
|
104
|
+
allDoctypes(): string;
|
|
99
105
|
}
|
|
100
106
|
|
|
101
107
|
export function createBackofficePaths(basePath: string = BACKOFFICE_BASE): BackofficePaths {
|
|
@@ -119,6 +125,7 @@ export function createBackofficePaths(basePath: string = BACKOFFICE_BASE): Backo
|
|
|
119
125
|
formBuilder: (doctype) =>
|
|
120
126
|
`${prefix}/customize-form${doctype ? `?doc_type=${encodeURIComponent(doctype)}` : ""}`,
|
|
121
127
|
queryReport: (reportName) => `${prefix}/query-report/${encodeURIComponent(reportName)}`,
|
|
128
|
+
allDoctypes: () => `${prefix}/${ALL_DOCTYPES_SEGMENT}`,
|
|
122
129
|
};
|
|
123
130
|
}
|
|
124
131
|
|
|
@@ -159,6 +166,10 @@ export function queryReportPath(reportName: string): BackofficeSubPath {
|
|
|
159
166
|
return defaultPaths.queryReport(reportName) as BackofficeSubPath;
|
|
160
167
|
}
|
|
161
168
|
|
|
169
|
+
export function allDoctypesPath(): BackofficeSubPath {
|
|
170
|
+
return defaultPaths.allDoctypes() as BackofficeSubPath;
|
|
171
|
+
}
|
|
172
|
+
|
|
162
173
|
export function formBuilderPath(doctype?: string): BackofficeSubPath {
|
|
163
174
|
return defaultPaths.formBuilder(doctype) as BackofficeSubPath;
|
|
164
175
|
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// FZ-8110: the All DocTypes sidebar entry and page. "Main" is the full desk
|
|
2
|
+
// on fixtures (a stock Frappe module set plus a Pokemon app) after a few
|
|
3
|
+
// visits, so Recent leads; "Picked in code" passes a doctypes list; "Signed
|
|
4
|
+
// out" answers the session probe as Guest.
|
|
5
|
+
import { YStack } from "@multiplatform.one/components";
|
|
6
|
+
import { InMemoryFixtureProvider, type FrappeDocData } from "@multiplatform.one/frappe";
|
|
7
|
+
import { storage } from "@multiplatform.one/store";
|
|
8
|
+
import type { ReactNode } from "react";
|
|
9
|
+
import { BackofficeProvider } from "../config/BackofficeProvider";
|
|
10
|
+
import { Desk } from "../desk/Desk";
|
|
11
|
+
import { createMemoryNavigator } from "../navigation/navigator";
|
|
12
|
+
import { AllDoctypesScreen } from "./AllDoctypesScreen";
|
|
13
|
+
|
|
14
|
+
const meta = {
|
|
15
|
+
title: "Screens/Backoffice/All DocTypes",
|
|
16
|
+
component: AllDoctypesScreen,
|
|
17
|
+
tags: ["!test"],
|
|
18
|
+
parameters: {
|
|
19
|
+
status: { type: "stable" },
|
|
20
|
+
layout: "fullscreen",
|
|
21
|
+
docs: {
|
|
22
|
+
description: {
|
|
23
|
+
component:
|
|
24
|
+
"Every DocType the session can read, grouped by module and searchable, opened from the sidebar's All DocTypes entry. A `doctypes` list on the Desk or BackofficeProvider narrows it, and the command palette, to those DocTypes. Signed out, it asks for a sign-in.",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export default meta;
|
|
30
|
+
|
|
31
|
+
const MOCK_HOST = "https://backoffice-all-doctypes.mock.test";
|
|
32
|
+
const GUEST_HOST = "https://backoffice-all-doctypes-guest.mock.test";
|
|
33
|
+
|
|
34
|
+
const modules: Record<string, string[]> = {
|
|
35
|
+
Automation: ["Assignment Rule", "Auto Repeat", "Milestone", "Reminder"],
|
|
36
|
+
Contacts: ["Address", "Contact", "Gender", "Salutation"],
|
|
37
|
+
Core: ["Activity Log", "DocType", "Error Log", "File", "Module Def", "Report", "Role", "User"],
|
|
38
|
+
Custom: ["Client Script", "Custom Field", "Property Setter"],
|
|
39
|
+
Desk: ["Dashboard", "Event", "Kanban Board", "Note", "Number Card", "Tag", "ToDo"],
|
|
40
|
+
Email: ["Email Account", "Email Queue", "Email Template", "Newsletter", "Notification"],
|
|
41
|
+
Integrations: ["Connected App", "OAuth Client", "Social Login Key", "Webhook"],
|
|
42
|
+
Pokemon: ["Pokemon", "Pokemon Type", "Trainer"],
|
|
43
|
+
Printing: ["Letter Head", "Print Format"],
|
|
44
|
+
Website: ["Blog Post", "Web Form", "Web Page", "Website Theme"],
|
|
45
|
+
Workflow: ["Workflow", "Workflow Action", "Workflow State"],
|
|
46
|
+
};
|
|
47
|
+
const singles: [string, string][] = [
|
|
48
|
+
["System Settings", "Core"],
|
|
49
|
+
["Print Settings", "Printing"],
|
|
50
|
+
["Website Settings", "Website"],
|
|
51
|
+
];
|
|
52
|
+
const childTables: [string, string][] = [
|
|
53
|
+
["Has Role", "Core"],
|
|
54
|
+
["Pokemon Move", "Pokemon"],
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const doctypeRows = [
|
|
58
|
+
...Object.entries(modules).flatMap(([module, names]) =>
|
|
59
|
+
names.map((name) => ({ name, module, istable: 0, issingle: 0 })),
|
|
60
|
+
),
|
|
61
|
+
...singles.map(([name, module]) => ({ name, module, istable: 0, issingle: 1 })),
|
|
62
|
+
...childTables.map(([name, module]) => ({ name, module, istable: 1, issingle: 0 })),
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const workspace = (name: string, icon: string, sequence: number) => ({
|
|
66
|
+
name,
|
|
67
|
+
doctype: "Workspace",
|
|
68
|
+
label: name,
|
|
69
|
+
title: name,
|
|
70
|
+
icon,
|
|
71
|
+
module: "Core",
|
|
72
|
+
parent_page: "",
|
|
73
|
+
public: 1,
|
|
74
|
+
for_user: "",
|
|
75
|
+
sequence_id: sequence,
|
|
76
|
+
is_hidden: 0,
|
|
77
|
+
content: JSON.stringify([]),
|
|
78
|
+
shortcuts: [],
|
|
79
|
+
links: [],
|
|
80
|
+
charts: [],
|
|
81
|
+
number_cards: [],
|
|
82
|
+
quick_lists: [],
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const makeFixtures = () =>
|
|
86
|
+
new InMemoryFixtureProvider({
|
|
87
|
+
DocType: doctypeRows.map((row) => ({ ...row, doctype: "DocType" }) as FrappeDocData),
|
|
88
|
+
Workspace: [
|
|
89
|
+
workspace("Pokemon", "dashboard", 1),
|
|
90
|
+
workspace("Users", "users", 2),
|
|
91
|
+
workspace("Website", "website", 3),
|
|
92
|
+
workspace("Tools", "tool", 4),
|
|
93
|
+
] as unknown as FrappeDocData[],
|
|
94
|
+
"Notification Log": [],
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
(() => {
|
|
98
|
+
if (typeof window === "undefined") return;
|
|
99
|
+
const w = window as unknown as Record<string, unknown>;
|
|
100
|
+
if (w.__allDoctypesStoriesMockFetch) return;
|
|
101
|
+
w.__allDoctypesStoriesMockFetch = true;
|
|
102
|
+
const realFetch = window.fetch.bind(window);
|
|
103
|
+
window.fetch = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {
|
|
104
|
+
const urlStr =
|
|
105
|
+
typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
|
|
106
|
+
const guest = urlStr.startsWith(GUEST_HOST);
|
|
107
|
+
if (!guest && !urlStr.startsWith(MOCK_HOST)) return realFetch(input as RequestInfo, init);
|
|
108
|
+
const probe = new URL(urlStr).pathname === "/api/method/frappe.auth.get_logged_user";
|
|
109
|
+
const body = probe ? { message: guest ? "Guest" : null } : { data: [], message: [] };
|
|
110
|
+
return new Response(JSON.stringify(body), {
|
|
111
|
+
status: guest && !probe ? 403 : 200,
|
|
112
|
+
headers: { "Content-Type": "application/json" },
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
})();
|
|
116
|
+
|
|
117
|
+
const recentVisits = JSON.stringify([
|
|
118
|
+
{ label: "Pokemon: Pikachu", path: "/backoffice/pokemon/Pikachu" },
|
|
119
|
+
{ label: "Trainer", path: "/backoffice/trainer" },
|
|
120
|
+
{ label: "ToDo", path: "/backoffice/todo" },
|
|
121
|
+
]);
|
|
122
|
+
void Promise.resolve(storage.setItem("frappe-desk-recent", recentVisits));
|
|
123
|
+
|
|
124
|
+
function Frame({ children }: { children: ReactNode }) {
|
|
125
|
+
return (
|
|
126
|
+
<YStack height="100vh" minHeight={0}>
|
|
127
|
+
{children}
|
|
128
|
+
</YStack>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const Main = () => (
|
|
133
|
+
<Frame>
|
|
134
|
+
<Desk
|
|
135
|
+
frappe={{ baseURL: MOCK_HOST, fixtures: makeFixtures() }}
|
|
136
|
+
path="/all-doctypes"
|
|
137
|
+
chrome="full"
|
|
138
|
+
/>
|
|
139
|
+
</Frame>
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
export const PickedInCode = () => (
|
|
143
|
+
<Frame>
|
|
144
|
+
<Desk
|
|
145
|
+
frappe={{ baseURL: MOCK_HOST, fixtures: makeFixtures() }}
|
|
146
|
+
path="/all-doctypes"
|
|
147
|
+
chrome="full"
|
|
148
|
+
doctypes={["Pokemon", "Pokemon Type", "Trainer", "User", "ToDo"]}
|
|
149
|
+
/>
|
|
150
|
+
</Frame>
|
|
151
|
+
);
|
|
152
|
+
PickedInCode.storyName = "Picked in code";
|
|
153
|
+
|
|
154
|
+
export const SignedOut = () => (
|
|
155
|
+
<Frame>
|
|
156
|
+
<BackofficeProvider
|
|
157
|
+
frappe={{ baseURL: GUEST_HOST }}
|
|
158
|
+
navigation={createMemoryNavigator("/backoffice/all-doctypes")}
|
|
159
|
+
>
|
|
160
|
+
<AllDoctypesScreen />
|
|
161
|
+
</BackofficeProvider>
|
|
162
|
+
</Frame>
|
|
163
|
+
);
|
|
164
|
+
SignedOut.storyName = "Signed out";
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// FZ-8110: the All DocTypes page and its sidebar entry. Omitted, the
|
|
2
|
+
// `doctypes` prop offers every DocType the session can read; a list offers
|
|
3
|
+
// only those; signed out the page asks for a sign-in instead of listing
|
|
4
|
+
// nothing.
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { InMemoryFixtureProvider, type FrappeDocData } from "@multiplatform.one/frappe";
|
|
7
|
+
import { storage } from "@multiplatform.one/store";
|
|
8
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
9
|
+
import { cleanup, fireEvent, screen, waitFor, within } from "@testing-library/react";
|
|
10
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
11
|
+
import { BackofficeProvider, type BackofficeProviderProps } from "../config/BackofficeProvider";
|
|
12
|
+
import { Desk } from "../desk/Desk";
|
|
13
|
+
import { createMemoryNavigator } from "../navigation/navigator";
|
|
14
|
+
import { AllDoctypesScreen, groupDoctypesByModule, recentDoctypes } from "./AllDoctypesScreen";
|
|
15
|
+
import { WorkspaceSidebar } from "./WorkspaceSidebar";
|
|
16
|
+
|
|
17
|
+
const doctypeRows = [
|
|
18
|
+
{ name: "User", module: "Core", istable: 0, issingle: 0 },
|
|
19
|
+
{ name: "ToDo", module: "Desk", istable: 0, issingle: 0 },
|
|
20
|
+
{ name: "Pokemon", module: "Pokemon", istable: 0, issingle: 0 },
|
|
21
|
+
{ name: "Trainer", module: "Pokemon", istable: 0, issingle: 0 },
|
|
22
|
+
{ name: "Pokemon Move", module: "Pokemon", istable: 1, issingle: 0 },
|
|
23
|
+
{ name: "Pokedex Settings", module: "Pokemon", istable: 0, issingle: 1 },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
let host = 0;
|
|
27
|
+
|
|
28
|
+
const fixtures = () =>
|
|
29
|
+
new InMemoryFixtureProvider({
|
|
30
|
+
DocType: doctypeRows.map((row) => ({ ...row, doctype: "DocType" }) as FrappeDocData),
|
|
31
|
+
Workspace: [],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function renderScreen(props: Partial<BackofficeProviderProps> = {}) {
|
|
35
|
+
const navigation = createMemoryNavigator("/backoffice/all-doctypes");
|
|
36
|
+
renderWithProviders(
|
|
37
|
+
<BackofficeProvider
|
|
38
|
+
frappe={{ baseURL: `https://all-doctypes-${++host}.spec.test`, fixtures: fixtures() }}
|
|
39
|
+
navigation={navigation}
|
|
40
|
+
{...props}
|
|
41
|
+
>
|
|
42
|
+
<AllDoctypesScreen />
|
|
43
|
+
</BackofficeProvider>,
|
|
44
|
+
);
|
|
45
|
+
return navigation;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function moduleNames(): string[] {
|
|
49
|
+
return screen
|
|
50
|
+
.getAllByTestId("all-doctypes-module")
|
|
51
|
+
.map((group) => within(group).getByRole("heading").textContent ?? "");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function rowsOf(module: string): string[] {
|
|
55
|
+
const group = screen
|
|
56
|
+
.getAllByTestId("all-doctypes-module")
|
|
57
|
+
.find((node) => within(node).getByRole("heading").textContent === module);
|
|
58
|
+
if (!group) throw new Error(`no ${module} group`);
|
|
59
|
+
return within(group)
|
|
60
|
+
.getAllByTestId("all-doctypes-row")
|
|
61
|
+
.map((row) => row.textContent ?? "");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function json(body: unknown, status = 200) {
|
|
65
|
+
return new Response(JSON.stringify(body), {
|
|
66
|
+
status,
|
|
67
|
+
headers: { "content-type": "application/json" },
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
afterEach(() => {
|
|
72
|
+
cleanup();
|
|
73
|
+
vi.unstubAllGlobals();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
describe("groupDoctypesByModule", () => {
|
|
77
|
+
it("sorts modules and names, drops child tables, and puts no-module last", () => {
|
|
78
|
+
const groups = groupDoctypesByModule([
|
|
79
|
+
{ name: "Zeta" },
|
|
80
|
+
{ name: "Trainer", module: "Pokemon" },
|
|
81
|
+
{ name: "Pokemon", module: "Pokemon" },
|
|
82
|
+
{ name: "Pokemon Move", module: "Pokemon", istable: true },
|
|
83
|
+
{ name: "User", module: "Core" },
|
|
84
|
+
]);
|
|
85
|
+
expect(groups).toEqual([
|
|
86
|
+
{ module: "Core", doctypes: [{ name: "User", module: "Core" }] },
|
|
87
|
+
{
|
|
88
|
+
module: "Pokemon",
|
|
89
|
+
doctypes: [
|
|
90
|
+
{ name: "Pokemon", module: "Pokemon" },
|
|
91
|
+
{ name: "Trainer", module: "Pokemon" },
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{ module: "", doctypes: [{ name: "Zeta" }] },
|
|
95
|
+
]);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it("a query keeps names or modules that contain it", () => {
|
|
99
|
+
const doctypes = [
|
|
100
|
+
{ name: "User", module: "Core" },
|
|
101
|
+
{ name: "Trainer", module: "Pokemon" },
|
|
102
|
+
];
|
|
103
|
+
expect(groupDoctypesByModule(doctypes, "train").map((g) => g.module)).toEqual(["Pokemon"]);
|
|
104
|
+
expect(groupDoctypesByModule(doctypes, "core").map((g) => g.module)).toEqual(["Core"]);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe("recentDoctypes", () => {
|
|
109
|
+
const offered = [
|
|
110
|
+
{ name: "User", module: "Core" },
|
|
111
|
+
{ name: "Trainer", module: "Pokemon" },
|
|
112
|
+
{ name: "Pokemon", module: "Pokemon" },
|
|
113
|
+
{ name: "Pokemon Move", module: "Pokemon", istable: true },
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
it("takes the DocTypes behind list and document visits, newest first, once each", () => {
|
|
117
|
+
const visits = [
|
|
118
|
+
{ label: "Trainer: Ash", path: "/backoffice/trainer/Ash" },
|
|
119
|
+
{ label: "User", path: "/backoffice/user" },
|
|
120
|
+
{ label: "Trainer", path: "/backoffice/trainer" },
|
|
121
|
+
{ label: "Pokemon Move", path: "/backoffice/pokemon-move" },
|
|
122
|
+
{ label: "Gone", path: "/backoffice/gone" },
|
|
123
|
+
];
|
|
124
|
+
expect(recentDoctypes(visits, offered).map((d) => d.name)).toEqual(["Trainer", "User"]);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it("stops at the limit", () => {
|
|
128
|
+
const visits = offered.map((d) => ({ label: d.name, path: `/backoffice/${d.name}` }));
|
|
129
|
+
expect(recentDoctypes(visits, offered, 1).map((d) => d.name)).toEqual(["User"]);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
describe("All DocTypes page", () => {
|
|
134
|
+
it("with no doctypes prop lists every DocType in the catalog, grouped by module", async () => {
|
|
135
|
+
renderScreen();
|
|
136
|
+
await waitFor(() => expect(moduleNames()).toEqual(["Core", "Desk", "Pokemon"]));
|
|
137
|
+
expect(rowsOf("Pokemon")).toEqual(["Pokedex Settings", "Pokemon", "Trainer"]);
|
|
138
|
+
expect(rowsOf("Core")).toEqual(["User"]);
|
|
139
|
+
expect(screen.queryByText("Pokemon Move")).toBeNull();
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it("leads with the DocTypes visited last", async () => {
|
|
143
|
+
await storage.setItem(
|
|
144
|
+
"frappe-desk-recent",
|
|
145
|
+
JSON.stringify([
|
|
146
|
+
{ label: "Trainer: Ash", path: "/backoffice/trainer/Ash" },
|
|
147
|
+
{ label: "User", path: "/backoffice/user" },
|
|
148
|
+
]),
|
|
149
|
+
);
|
|
150
|
+
try {
|
|
151
|
+
renderScreen();
|
|
152
|
+
const recent = await screen.findByTestId("all-doctypes-recent");
|
|
153
|
+
expect(
|
|
154
|
+
within(recent)
|
|
155
|
+
.getAllByTestId("all-doctypes-row")
|
|
156
|
+
.map((row) => row.textContent),
|
|
157
|
+
).toEqual(["Trainer", "User"]);
|
|
158
|
+
const firstModule = screen.getAllByTestId("all-doctypes-module")[0];
|
|
159
|
+
expect(
|
|
160
|
+
recent.compareDocumentPosition(firstModule) & Node.DOCUMENT_POSITION_FOLLOWING,
|
|
161
|
+
).toBeTruthy();
|
|
162
|
+
} finally {
|
|
163
|
+
await storage.removeItem("frappe-desk-recent");
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it("with a doctypes list lists only those", async () => {
|
|
168
|
+
renderScreen({ doctypes: ["Pokemon", "User"] });
|
|
169
|
+
await waitFor(() => expect(moduleNames()).toEqual(["Core", "Pokemon"]));
|
|
170
|
+
expect(rowsOf("Pokemon")).toEqual(["Pokemon"]);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it("search narrows the list and says when nothing matches", async () => {
|
|
174
|
+
renderScreen();
|
|
175
|
+
await waitFor(() => expect(moduleNames()).toHaveLength(3));
|
|
176
|
+
const search = screen.getByLabelText("Search DocTypes");
|
|
177
|
+
fireEvent.change(search, { target: { value: "train" } });
|
|
178
|
+
await waitFor(() => expect(moduleNames()).toEqual(["Pokemon"]));
|
|
179
|
+
expect(rowsOf("Pokemon")).toEqual(["Trainer"]);
|
|
180
|
+
fireEvent.change(search, { target: { value: "zzz" } });
|
|
181
|
+
expect(await screen.findByTestId("all-doctypes-no-match")).toBeTruthy();
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it("opens a DocType's list, and a Single's form", async () => {
|
|
185
|
+
const navigation = renderScreen();
|
|
186
|
+
fireEvent.click(await screen.findByText("Trainer"));
|
|
187
|
+
expect(navigation.getLocation().path).toBe("/backoffice/trainer");
|
|
188
|
+
fireEvent.click(screen.getByText("Pokedex Settings"));
|
|
189
|
+
expect(navigation.getLocation().path).toBe("/backoffice/pokedex-settings/Pokedex%20Settings");
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it("hides DocTypes the session can't read when the DocType list is refused", async () => {
|
|
193
|
+
const requested: string[] = [];
|
|
194
|
+
vi.stubGlobal("fetch", async (input: string | URL | Request) => {
|
|
195
|
+
const url = new URL(String(input instanceof Request ? input.url : input));
|
|
196
|
+
requested.push(url.pathname);
|
|
197
|
+
if (url.pathname.endsWith("frappe.auth.get_logged_user")) {
|
|
198
|
+
return json({ message: "ash@example.com" });
|
|
199
|
+
}
|
|
200
|
+
if (url.pathname.endsWith("frappe.client.get_list")) {
|
|
201
|
+
return json({ exc_type: "PermissionError" }, 403);
|
|
202
|
+
}
|
|
203
|
+
if (url.pathname.endsWith("frappe.desk.notifications.get_notification_info")) {
|
|
204
|
+
return json({ message: { module_doctypes: { Pokemon: ["Trainer", "Pokemon"] } } });
|
|
205
|
+
}
|
|
206
|
+
return json({ data: [] });
|
|
207
|
+
});
|
|
208
|
+
renderWithProviders(
|
|
209
|
+
<BackofficeProvider
|
|
210
|
+
frappe={{ baseURL: `https://all-doctypes-${++host}.spec.test` }}
|
|
211
|
+
navigation={createMemoryNavigator("/backoffice/all-doctypes")}
|
|
212
|
+
>
|
|
213
|
+
<AllDoctypesScreen />
|
|
214
|
+
</BackofficeProvider>,
|
|
215
|
+
);
|
|
216
|
+
await waitFor(() => expect(moduleNames()).toEqual(["Pokemon"]));
|
|
217
|
+
expect(rowsOf("Pokemon")).toEqual(["Pokemon", "Trainer"]);
|
|
218
|
+
expect(screen.queryByText("User")).toBeNull();
|
|
219
|
+
expect(requested.some((path) => path.endsWith("frappe.client.get_list"))).toBe(true);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it("signed out asks for a sign-in instead of an empty list", async () => {
|
|
223
|
+
vi.stubGlobal("fetch", async (input: string | URL | Request) => {
|
|
224
|
+
const url = new URL(String(input instanceof Request ? input.url : input));
|
|
225
|
+
if (url.pathname.endsWith("frappe.auth.get_logged_user")) {
|
|
226
|
+
return json({ message: "Guest" });
|
|
227
|
+
}
|
|
228
|
+
return json({ exc_type: "PermissionError" }, 403);
|
|
229
|
+
});
|
|
230
|
+
const login = vi.fn();
|
|
231
|
+
renderWithProviders(
|
|
232
|
+
<BackofficeProvider
|
|
233
|
+
frappe={{ baseURL: `https://all-doctypes-${++host}.spec.test` }}
|
|
234
|
+
navigation={createMemoryNavigator("/backoffice/all-doctypes")}
|
|
235
|
+
auth={{ login }}
|
|
236
|
+
>
|
|
237
|
+
<AllDoctypesScreen />
|
|
238
|
+
</BackofficeProvider>,
|
|
239
|
+
);
|
|
240
|
+
const prompt = await screen.findByTestId("all-doctypes-signed-out");
|
|
241
|
+
expect(screen.queryAllByTestId("all-doctypes-module")).toHaveLength(0);
|
|
242
|
+
expect(screen.queryByLabelText("Search DocTypes")).toBeNull();
|
|
243
|
+
fireEvent.click(within(prompt).getByRole("button", { name: "Sign in" }));
|
|
244
|
+
expect(login).toHaveBeenCalledTimes(1);
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
it("is the desk surface at /all-doctypes", async () => {
|
|
248
|
+
renderWithProviders(
|
|
249
|
+
<Desk
|
|
250
|
+
frappe={{ baseURL: `https://all-doctypes-${++host}.spec.test`, fixtures: fixtures() }}
|
|
251
|
+
navigation={createMemoryNavigator("/backoffice/all-doctypes")}
|
|
252
|
+
chrome="content"
|
|
253
|
+
/>,
|
|
254
|
+
);
|
|
255
|
+
expect(await screen.findByTestId("all-doctypes-screen")).toBeTruthy();
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
describe("All DocTypes sidebar entry", () => {
|
|
260
|
+
it("leads the sidebar and opens the page", async () => {
|
|
261
|
+
const onNavigate = vi.fn();
|
|
262
|
+
renderWithProviders(
|
|
263
|
+
<BackofficeProvider
|
|
264
|
+
frappe={{ baseURL: `https://all-doctypes-${++host}.spec.test`, fixtures: fixtures() }}
|
|
265
|
+
navigation={createMemoryNavigator("/backoffice")}
|
|
266
|
+
>
|
|
267
|
+
<WorkspaceSidebar activePath="/backoffice/all-doctypes" onNavigate={onNavigate} />
|
|
268
|
+
</BackofficeProvider>,
|
|
269
|
+
);
|
|
270
|
+
const row = await screen.findByTestId("backoffice-all-doctypes-row");
|
|
271
|
+
expect(row.textContent).toBe("All DocTypes");
|
|
272
|
+
expect(row.getAttribute("aria-current")).toBe("page");
|
|
273
|
+
fireEvent.click(row);
|
|
274
|
+
expect(onNavigate).toHaveBeenCalledWith("/backoffice/all-doctypes");
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
it("is gone when the host turns list views off", async () => {
|
|
278
|
+
renderWithProviders(
|
|
279
|
+
<BackofficeProvider
|
|
280
|
+
frappe={{ baseURL: `https://all-doctypes-${++host}.spec.test`, fixtures: fixtures() }}
|
|
281
|
+
navigation={createMemoryNavigator("/backoffice")}
|
|
282
|
+
capabilities={{ views: false }}
|
|
283
|
+
>
|
|
284
|
+
<WorkspaceSidebar />
|
|
285
|
+
</BackofficeProvider>,
|
|
286
|
+
);
|
|
287
|
+
await waitFor(() => expect(screen.queryByLabelText("Loading workspaces")).toBeNull());
|
|
288
|
+
expect(screen.queryByTestId("backoffice-all-doctypes-row")).toBeNull();
|
|
289
|
+
});
|
|
290
|
+
});
|