@multiplatform.one/backoffice 7.76.0 → 7.77.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.
Files changed (384) hide show
  1. package/dist/cjs/chrome/BackofficeAwesomebar.native.js +1 -1
  2. package/dist/cjs/chrome/BackofficeAwesomebar.native.js.map +1 -1
  3. package/dist/cjs/chrome/CommandPalette.native.js +1 -1
  4. package/dist/cjs/chrome/CommandPalette.native.js.map +1 -1
  5. package/dist/cjs/chrome/HelpMenu.native.js +1 -1
  6. package/dist/cjs/chrome/HelpMenu.native.js.map +1 -1
  7. package/dist/cjs/chrome/NotificationsButton.native.js +1 -1
  8. package/dist/cjs/chrome/NotificationsButton.native.js.map +1 -1
  9. package/dist/cjs/chrome/UserMenu.native.js +1 -1
  10. package/dist/cjs/chrome/UserMenu.native.js.map +1 -1
  11. package/dist/cjs/chrome/awesomebar-data.cjs +79 -33
  12. package/dist/cjs/chrome/awesomebar-data.native.js +101 -45
  13. package/dist/cjs/chrome/awesomebar-data.native.js.map +1 -1
  14. package/dist/cjs/chrome/command-palette-model.native.js +1 -1
  15. package/dist/cjs/chrome/command-palette-model.native.js.map +1 -1
  16. package/dist/cjs/chrome/help-about-dialog.native.js +1 -1
  17. package/dist/cjs/chrome/help-about-dialog.native.js.map +1 -1
  18. package/dist/cjs/chrome/help-shortcuts-dialog.native.js +1 -1
  19. package/dist/cjs/chrome/help-shortcuts-dialog.native.js.map +1 -1
  20. package/dist/cjs/chrome/notifications-data.native.js.map +1 -1
  21. package/dist/cjs/chrome/notifications-panel.native.js +1 -1
  22. package/dist/cjs/chrome/notifications-panel.native.js.map +1 -1
  23. package/dist/cjs/chrome/notifications-utils.native.js.map +1 -1
  24. package/dist/cjs/chrome/shortcuts.native.js.map +1 -1
  25. package/dist/cjs/chrome/user-session.native.js.map +1 -1
  26. package/dist/cjs/config/BackofficeProvider.native.js +1 -1
  27. package/dist/cjs/config/BackofficeProvider.native.js.map +1 -1
  28. package/dist/cjs/config/capabilities.cjs +4 -0
  29. package/dist/cjs/config/capabilities.native.js +4 -0
  30. package/dist/cjs/config/capabilities.native.js.map +1 -1
  31. package/dist/cjs/config/events.native.js.map +1 -1
  32. package/dist/cjs/config/slots.native.js.map +1 -1
  33. package/dist/cjs/desk/Desk.cjs +6 -1
  34. package/dist/cjs/desk/Desk.native.js +6 -1
  35. package/dist/cjs/desk/Desk.native.js.map +1 -1
  36. package/dist/cjs/desk/DeskSurface.cjs +3 -0
  37. package/dist/cjs/desk/DeskSurface.native.js +3 -0
  38. package/dist/cjs/desk/DeskSurface.native.js.map +1 -1
  39. package/dist/cjs/desk/resolveDeskPath.cjs +5 -0
  40. package/dist/cjs/desk/resolveDeskPath.native.js +5 -0
  41. package/dist/cjs/desk/resolveDeskPath.native.js.map +1 -1
  42. package/dist/cjs/desk/scope.native.js.map +1 -1
  43. package/dist/cjs/desk/target.cjs +4 -0
  44. package/dist/cjs/desk/target.native.js +4 -0
  45. package/dist/cjs/desk/target.native.js.map +1 -1
  46. package/dist/cjs/form/DocFormScreen.native.js +1 -1
  47. package/dist/cjs/form/DocFormScreen.native.js.map +1 -1
  48. package/dist/cjs/form/FormConnections.native.js +1 -1
  49. package/dist/cjs/form/FormConnections.native.js.map +1 -1
  50. package/dist/cjs/form/FormDialogs.native.js +1 -1
  51. package/dist/cjs/form/FormDialogs.native.js.map +1 -1
  52. package/dist/cjs/form/FormErrorBoundary.native.js +1 -1
  53. package/dist/cjs/form/FormErrorBoundary.native.js.map +1 -1
  54. package/dist/cjs/form/FormHeaderCluster.native.js +1 -1
  55. package/dist/cjs/form/FormHeaderCluster.native.js.map +1 -1
  56. package/dist/cjs/form/FormSidebarPanel.native.js +1 -1
  57. package/dist/cjs/form/FormSidebarPanel.native.js.map +1 -1
  58. package/dist/cjs/form/FormTimeline.native.js +1 -1
  59. package/dist/cjs/form/FormTimeline.native.js.map +1 -1
  60. package/dist/cjs/form/FormToolbar.native.js +1 -1
  61. package/dist/cjs/form/FormToolbar.native.js.map +1 -1
  62. package/dist/cjs/form/connections-data.native.js.map +1 -1
  63. package/dist/cjs/form/createPrefill.native.js.map +1 -1
  64. package/dist/cjs/form/dependsOn.native.js.map +1 -1
  65. package/dist/cjs/form/dirtyTracking.native.js.map +1 -1
  66. package/dist/cjs/form/docinfo.native.js.map +1 -1
  67. package/dist/cjs/form/fetchFrom.native.js.map +1 -1
  68. package/dist/cjs/form/fieldPermissions.native.js.map +1 -1
  69. package/dist/cjs/form/formActions.native.js.map +1 -1
  70. package/dist/cjs/form/formLayout.native.js.map +1 -1
  71. package/dist/cjs/form/platformHooks.native.js.map +1 -1
  72. package/dist/cjs/form/sidebar-attachments.native.js +1 -1
  73. package/dist/cjs/form/sidebar-attachments.native.js.map +1 -1
  74. package/dist/cjs/form/sidebar-dialogs.native.js +1 -1
  75. package/dist/cjs/form/sidebar-dialogs.native.js.map +1 -1
  76. package/dist/cjs/form/sidebar-people.native.js +1 -1
  77. package/dist/cjs/form/sidebar-people.native.js.map +1 -1
  78. package/dist/cjs/form/sidebar-rpc.native.js.map +1 -1
  79. package/dist/cjs/form/sidebar-utils.native.js.map +1 -1
  80. package/dist/cjs/form/timeline-entries.native.js.map +1 -1
  81. package/dist/cjs/form/timeline-utils.native.js.map +1 -1
  82. package/dist/cjs/form/useFormEngine.native.js.map +1 -1
  83. package/dist/cjs/formBuilder/DoctypePicker.native.js +1 -1
  84. package/dist/cjs/formBuilder/DoctypePicker.native.js.map +1 -1
  85. package/dist/cjs/formBuilder/FieldPalette.native.js +1 -1
  86. package/dist/cjs/formBuilder/FieldPalette.native.js.map +1 -1
  87. package/dist/cjs/formBuilder/FieldPropertiesPanel.native.js +1 -1
  88. package/dist/cjs/formBuilder/FieldPropertiesPanel.native.js.map +1 -1
  89. package/dist/cjs/formBuilder/FormBuilderCanvas.native.js +1 -1
  90. package/dist/cjs/formBuilder/FormBuilderCanvas.native.js.map +1 -1
  91. package/dist/cjs/formBuilder/FormBuilderScreen.native.js +1 -1
  92. package/dist/cjs/formBuilder/FormBuilderScreen.native.js.map +1 -1
  93. package/dist/cjs/formBuilder/api.native.js.map +1 -1
  94. package/dist/cjs/formBuilder/fieldtypes.native.js.map +1 -1
  95. package/dist/cjs/formBuilder/index.native.js.map +1 -1
  96. package/dist/cjs/formBuilder/model.native.js.map +1 -1
  97. package/dist/cjs/formBuilder/useFormBuilderDrag.native.js +1 -1
  98. package/dist/cjs/formBuilder/useFormBuilderDrag.native.js.map +1 -1
  99. package/dist/cjs/i18n/en.native.js.map +1 -1
  100. package/dist/cjs/i18n/index.native.js.map +1 -1
  101. package/dist/cjs/index.cjs +6 -0
  102. package/dist/cjs/index.native.js +8 -2
  103. package/dist/cjs/index.native.js.map +1 -1
  104. package/dist/cjs/list/AddTagsDialog.native.js +1 -1
  105. package/dist/cjs/list/AddTagsDialog.native.js.map +1 -1
  106. package/dist/cjs/list/AssignToDialog.native.js +1 -1
  107. package/dist/cjs/list/AssignToDialog.native.js.map +1 -1
  108. package/dist/cjs/list/DoctypeListScreen.native.js +1 -1
  109. package/dist/cjs/list/DoctypeListScreen.native.js.map +1 -1
  110. package/dist/cjs/list/ListBulkActionsBar.native.js +1 -1
  111. package/dist/cjs/list/ListBulkActionsBar.native.js.map +1 -1
  112. package/dist/cjs/list/ListFilterBar.native.js +1 -1
  113. package/dist/cjs/list/ListFilterBar.native.js.map +1 -1
  114. package/dist/cjs/list/ListSidebar.native.js +1 -1
  115. package/dist/cjs/list/ListSidebar.native.js.map +1 -1
  116. package/dist/cjs/list/bulk-edit-dialog.native.js +1 -1
  117. package/dist/cjs/list/bulk-edit-dialog.native.js.map +1 -1
  118. package/dist/cjs/list/bulk-export.native.js.map +1 -1
  119. package/dist/cjs/list/bulk-submit-cancel.native.js.map +1 -1
  120. package/dist/cjs/list/bulkActions.native.js.map +1 -1
  121. package/dist/cjs/list/filter-chips.native.js +1 -1
  122. package/dist/cjs/list/filter-chips.native.js.map +1 -1
  123. package/dist/cjs/list/filter-editor.native.js +1 -1
  124. package/dist/cjs/list/filter-editor.native.js.map +1 -1
  125. package/dist/cjs/list/filter-fields.native.js.map +1 -1
  126. package/dist/cjs/list/filter-saved.native.js +1 -1
  127. package/dist/cjs/list/filter-saved.native.js.map +1 -1
  128. package/dist/cjs/list/filter-sort.native.js +1 -1
  129. package/dist/cjs/list/filter-sort.native.js.map +1 -1
  130. package/dist/cjs/list/filter-standard.native.js.map +1 -1
  131. package/dist/cjs/list/filterConversion.native.js.map +1 -1
  132. package/dist/cjs/list/list-paging.native.js +1 -1
  133. package/dist/cjs/list/list-paging.native.js.map +1 -1
  134. package/dist/cjs/list/list-tools-sheet.native.js +1 -1
  135. package/dist/cjs/list/list-tools-sheet.native.js.map +1 -1
  136. package/dist/cjs/list/listColumns.native.js.map +1 -1
  137. package/dist/cjs/list/listFields.native.js.map +1 -1
  138. package/dist/cjs/list/listFormat.native.js.map +1 -1
  139. package/dist/cjs/list/listUrlState.native.js.map +1 -1
  140. package/dist/cjs/list/sidebar-section.native.js +1 -1
  141. package/dist/cjs/list/sidebar-section.native.js.map +1 -1
  142. package/dist/cjs/list/sidebar-stats.native.js.map +1 -1
  143. package/dist/cjs/list/statusColors.native.js.map +1 -1
  144. package/dist/cjs/navigation/navigator.native.js.map +1 -1
  145. package/dist/cjs/navigation/paths.cjs +8 -1
  146. package/dist/cjs/navigation/paths.native.js +9 -0
  147. package/dist/cjs/navigation/paths.native.js.map +1 -1
  148. package/dist/cjs/oneAdapter/index.native.js.map +1 -1
  149. package/dist/cjs/quickEntry/QuickEntryDialog.native.js +1 -1
  150. package/dist/cjs/quickEntry/QuickEntryDialog.native.js.map +1 -1
  151. package/dist/cjs/quickEntry/quickEntryPlan.native.js.map +1 -1
  152. package/dist/cjs/report/DoctypeReportView.native.js.map +1 -1
  153. package/dist/cjs/report/QueryReportScreen.native.js +1 -1
  154. package/dist/cjs/report/QueryReportScreen.native.js.map +1 -1
  155. package/dist/cjs/report/queryReportColumns.native.js.map +1 -1
  156. package/dist/cjs/report/queryReportFilterBar.native.js +1 -1
  157. package/dist/cjs/report/queryReportFilterBar.native.js.map +1 -1
  158. package/dist/cjs/report/queryReportUrlState.native.js.map +1 -1
  159. package/dist/cjs/report/report-grid.native.js.map +1 -1
  160. package/dist/cjs/report/report-toolbar.native.js.map +1 -1
  161. package/dist/cjs/report/reportShapes.native.js.map +1 -1
  162. package/dist/cjs/report/reportViewModel.native.js.map +1 -1
  163. package/dist/cjs/report/savedReports.native.js.map +1 -1
  164. package/dist/cjs/report/useQueryReport.native.js.map +1 -1
  165. package/dist/cjs/shared/deskLinks.native.js.map +1 -1
  166. package/dist/cjs/shared/listNavContext.native.js.map +1 -1
  167. package/dist/cjs/shared/measures.native.js.map +1 -1
  168. package/dist/cjs/shared/sessionUser.native.js.map +1 -1
  169. package/dist/cjs/shared/types.native.js.map +1 -1
  170. package/dist/cjs/shared/useDocinfo.native.js.map +1 -1
  171. package/dist/cjs/shared/useDoctypeMeta.native.js.map +1 -1
  172. package/dist/cjs/shared/useFrappeApp.native.js.map +1 -1
  173. package/dist/cjs/shared/useRecentVisit.native.js.map +1 -1
  174. package/dist/cjs/shared/useSessionUserId.native.js.map +1 -1
  175. package/dist/cjs/shared/useSlugTarget.native.js.map +1 -1
  176. package/dist/cjs/shared/useUserRoles.native.js.map +1 -1
  177. package/dist/cjs/shell/AllDoctypesScreen.cjs +331 -0
  178. package/dist/cjs/shell/AllDoctypesScreen.native.js +460 -0
  179. package/dist/cjs/shell/AllDoctypesScreen.native.js.map +1 -0
  180. package/dist/cjs/shell/BackofficeShell.native.js +1 -1
  181. package/dist/cjs/shell/BackofficeShell.native.js.map +1 -1
  182. package/dist/cjs/shell/HomeRedirect.native.js +1 -1
  183. package/dist/cjs/shell/HomeRedirect.native.js.map +1 -1
  184. package/dist/cjs/shell/NotFoundScreen.native.js +1 -1
  185. package/dist/cjs/shell/NotFoundScreen.native.js.map +1 -1
  186. package/dist/cjs/shell/SlugScreen.native.js +1 -1
  187. package/dist/cjs/shell/SlugScreen.native.js.map +1 -1
  188. package/dist/cjs/shell/WorkspaceSidebar.cjs +34 -11
  189. package/dist/cjs/shell/WorkspaceSidebar.native.js +37 -12
  190. package/dist/cjs/shell/WorkspaceSidebar.native.js.map +1 -1
  191. package/dist/cjs/shell/shellSidebarSlot.native.js.map +1 -1
  192. package/dist/cjs/shell/shellTopBarSlot.native.js.map +1 -1
  193. package/dist/cjs/shell/useWorkspaces.native.js.map +1 -1
  194. package/dist/cjs/shell/workspaceIcons.cjs +32 -0
  195. package/dist/cjs/shell/workspaceIcons.native.js +32 -0
  196. package/dist/cjs/shell/workspaceIcons.native.js.map +1 -1
  197. package/dist/cjs/views/CalendarView.native.js +1 -1
  198. package/dist/cjs/views/CalendarView.native.js.map +1 -1
  199. package/dist/cjs/views/DashboardView.native.js +1 -1
  200. package/dist/cjs/views/DashboardView.native.js.map +1 -1
  201. package/dist/cjs/views/DoctypeViewScreen.native.js.map +1 -1
  202. package/dist/cjs/views/ImageView.native.js +1 -1
  203. package/dist/cjs/views/ImageView.native.js.map +1 -1
  204. package/dist/cjs/views/KanbanView.native.js +1 -1
  205. package/dist/cjs/views/KanbanView.native.js.map +1 -1
  206. package/dist/cjs/views/ReportView.native.js.map +1 -1
  207. package/dist/cjs/views/TreeView.native.js +1 -1
  208. package/dist/cjs/views/TreeView.native.js.map +1 -1
  209. package/dist/cjs/views/ViewHeader.native.js +1 -1
  210. package/dist/cjs/views/ViewHeader.native.js.map +1 -1
  211. package/dist/cjs/views/ViewStates.native.js +1 -1
  212. package/dist/cjs/views/ViewStates.native.js.map +1 -1
  213. package/dist/cjs/views/ViewSwitcherMenu.native.js +1 -1
  214. package/dist/cjs/views/ViewSwitcherMenu.native.js.map +1 -1
  215. package/dist/cjs/views/calendar-field-selector.native.js +1 -1
  216. package/dist/cjs/views/calendar-field-selector.native.js.map +1 -1
  217. package/dist/cjs/views/connection.native.js.map +1 -1
  218. package/dist/cjs/views/dashboard-data.native.js.map +1 -1
  219. package/dist/cjs/views/deskViewConfigs.native.js.map +1 -1
  220. package/dist/cjs/views/kanban-board-controls.native.js +1 -1
  221. package/dist/cjs/views/kanban-board-controls.native.js.map +1 -1
  222. package/dist/cjs/views/kanban-field-picker.native.js +1 -1
  223. package/dist/cjs/views/kanban-field-picker.native.js.map +1 -1
  224. package/dist/cjs/views/kanbanBoardOps.native.js.map +1 -1
  225. package/dist/cjs/views/report-controls.native.js +1 -1
  226. package/dist/cjs/views/report-controls.native.js.map +1 -1
  227. package/dist/cjs/views/viewAvailability.native.js.map +1 -1
  228. package/dist/cjs/views/viewMeta.native.js.map +1 -1
  229. package/dist/cjs/workspace/WorkspaceChartBlock.native.js +1 -1
  230. package/dist/cjs/workspace/WorkspaceChartBlock.native.js.map +1 -1
  231. package/dist/cjs/workspace/WorkspaceGrid.native.js.map +1 -1
  232. package/dist/cjs/workspace/WorkspaceLinkCard.native.js +1 -1
  233. package/dist/cjs/workspace/WorkspaceLinkCard.native.js.map +1 -1
  234. package/dist/cjs/workspace/WorkspaceLinkDirectory.native.js +1 -1
  235. package/dist/cjs/workspace/WorkspaceLinkDirectory.native.js.map +1 -1
  236. package/dist/cjs/workspace/WorkspaceNumberCard.native.js +1 -1
  237. package/dist/cjs/workspace/WorkspaceNumberCard.native.js.map +1 -1
  238. package/dist/cjs/workspace/WorkspaceQuickList.native.js +1 -1
  239. package/dist/cjs/workspace/WorkspaceQuickList.native.js.map +1 -1
  240. package/dist/cjs/workspace/WorkspaceRecents.native.js +1 -1
  241. package/dist/cjs/workspace/WorkspaceRecents.native.js.map +1 -1
  242. package/dist/cjs/workspace/WorkspaceScreen.native.js +1 -1
  243. package/dist/cjs/workspace/WorkspaceScreen.native.js.map +1 -1
  244. package/dist/cjs/workspace/WorkspaceShortcut.native.js +1 -1
  245. package/dist/cjs/workspace/WorkspaceShortcut.native.js.map +1 -1
  246. package/dist/cjs/workspace/parseContent.native.js.map +1 -1
  247. package/dist/cjs/workspace/types.native.js.map +1 -1
  248. package/dist/cjs/workspace/useDashboardChart.native.js.map +1 -1
  249. package/dist/cjs/workspace/useWorkspaceDoc.native.js.map +1 -1
  250. package/dist/esm/chrome/awesomebar-data.mjs +79 -33
  251. package/dist/esm/chrome/awesomebar-data.mjs.map +1 -1
  252. package/dist/esm/chrome/awesomebar-data.native.js +101 -45
  253. package/dist/esm/chrome/awesomebar-data.native.js.map +1 -1
  254. package/dist/esm/config/BackofficeProvider.mjs.map +1 -1
  255. package/dist/esm/config/BackofficeProvider.native.js.map +1 -1
  256. package/dist/esm/config/capabilities.mjs +4 -0
  257. package/dist/esm/config/capabilities.mjs.map +1 -1
  258. package/dist/esm/config/capabilities.native.js +4 -0
  259. package/dist/esm/config/capabilities.native.js.map +1 -1
  260. package/dist/esm/desk/Desk.mjs +6 -1
  261. package/dist/esm/desk/Desk.mjs.map +1 -1
  262. package/dist/esm/desk/Desk.native.js +6 -1
  263. package/dist/esm/desk/Desk.native.js.map +1 -1
  264. package/dist/esm/desk/DeskSurface.mjs +3 -0
  265. package/dist/esm/desk/DeskSurface.mjs.map +1 -1
  266. package/dist/esm/desk/DeskSurface.native.js +3 -0
  267. package/dist/esm/desk/DeskSurface.native.js.map +1 -1
  268. package/dist/esm/desk/resolveDeskPath.mjs +6 -1
  269. package/dist/esm/desk/resolveDeskPath.mjs.map +1 -1
  270. package/dist/esm/desk/resolveDeskPath.native.js +6 -1
  271. package/dist/esm/desk/resolveDeskPath.native.js.map +1 -1
  272. package/dist/esm/desk/target.mjs +4 -0
  273. package/dist/esm/desk/target.mjs.map +1 -1
  274. package/dist/esm/desk/target.native.js +4 -0
  275. package/dist/esm/desk/target.native.js.map +1 -1
  276. package/dist/esm/index.mjs +4 -3
  277. package/dist/esm/index.mjs.map +1 -1
  278. package/dist/esm/index.native.js +4 -3
  279. package/dist/esm/index.native.js.map +1 -1
  280. package/dist/esm/navigation/paths.mjs +7 -2
  281. package/dist/esm/navigation/paths.mjs.map +1 -1
  282. package/dist/esm/navigation/paths.native.js +8 -1
  283. package/dist/esm/navigation/paths.native.js.map +1 -1
  284. package/dist/esm/shell/AllDoctypesScreen.mjs +304 -0
  285. package/dist/esm/shell/AllDoctypesScreen.mjs.map +1 -0
  286. package/dist/esm/shell/AllDoctypesScreen.native.js +430 -0
  287. package/dist/esm/shell/AllDoctypesScreen.native.js.map +1 -0
  288. package/dist/esm/shell/WorkspaceSidebar.mjs +33 -10
  289. package/dist/esm/shell/WorkspaceSidebar.mjs.map +1 -1
  290. package/dist/esm/shell/WorkspaceSidebar.native.js +35 -10
  291. package/dist/esm/shell/WorkspaceSidebar.native.js.map +1 -1
  292. package/dist/esm/shell/workspaceIcons.mjs +33 -2
  293. package/dist/esm/shell/workspaceIcons.mjs.map +1 -1
  294. package/dist/esm/shell/workspaceIcons.native.js +33 -2
  295. package/dist/esm/shell/workspaceIcons.native.js.map +1 -1
  296. package/dist/jsx/chrome/awesomebar-data.mjs +79 -33
  297. package/dist/jsx/chrome/awesomebar-data.mjs.map +1 -1
  298. package/dist/jsx/chrome/awesomebar-data.native.js +101 -45
  299. package/dist/jsx/chrome/awesomebar-data.native.js.map +1 -1
  300. package/dist/jsx/config/BackofficeProvider.mjs.map +1 -1
  301. package/dist/jsx/config/BackofficeProvider.native.js.map +1 -1
  302. package/dist/jsx/config/capabilities.mjs +4 -0
  303. package/dist/jsx/config/capabilities.mjs.map +1 -1
  304. package/dist/jsx/config/capabilities.native.js +4 -0
  305. package/dist/jsx/config/capabilities.native.js.map +1 -1
  306. package/dist/jsx/desk/Desk.mjs +6 -1
  307. package/dist/jsx/desk/Desk.mjs.map +1 -1
  308. package/dist/jsx/desk/Desk.native.js +6 -1
  309. package/dist/jsx/desk/Desk.native.js.map +1 -1
  310. package/dist/jsx/desk/DeskSurface.mjs +3 -0
  311. package/dist/jsx/desk/DeskSurface.mjs.map +1 -1
  312. package/dist/jsx/desk/DeskSurface.native.js +3 -0
  313. package/dist/jsx/desk/DeskSurface.native.js.map +1 -1
  314. package/dist/jsx/desk/resolveDeskPath.mjs +6 -1
  315. package/dist/jsx/desk/resolveDeskPath.mjs.map +1 -1
  316. package/dist/jsx/desk/resolveDeskPath.native.js +5 -0
  317. package/dist/jsx/desk/resolveDeskPath.native.js.map +1 -1
  318. package/dist/jsx/desk/target.mjs +4 -0
  319. package/dist/jsx/desk/target.mjs.map +1 -1
  320. package/dist/jsx/desk/target.native.js +4 -0
  321. package/dist/jsx/desk/target.native.js.map +1 -1
  322. package/dist/jsx/index.js +4 -3
  323. package/dist/jsx/index.js.map +1 -1
  324. package/dist/jsx/index.mjs +4 -3
  325. package/dist/jsx/index.mjs.map +1 -1
  326. package/dist/jsx/index.native.js +6 -0
  327. package/dist/jsx/index.native.js.map +1 -1
  328. package/dist/jsx/navigation/paths.mjs +7 -2
  329. package/dist/jsx/navigation/paths.mjs.map +1 -1
  330. package/dist/jsx/navigation/paths.native.js +9 -0
  331. package/dist/jsx/navigation/paths.native.js.map +1 -1
  332. package/dist/jsx/shell/AllDoctypesScreen.mjs +304 -0
  333. package/dist/jsx/shell/AllDoctypesScreen.mjs.map +1 -0
  334. package/dist/jsx/shell/AllDoctypesScreen.native.js +460 -0
  335. package/dist/jsx/shell/AllDoctypesScreen.native.js.map +1 -0
  336. package/dist/jsx/shell/WorkspaceSidebar.mjs +33 -10
  337. package/dist/jsx/shell/WorkspaceSidebar.mjs.map +1 -1
  338. package/dist/jsx/shell/WorkspaceSidebar.native.js +36 -11
  339. package/dist/jsx/shell/WorkspaceSidebar.native.js.map +1 -1
  340. package/dist/jsx/shell/workspaceIcons.mjs +33 -2
  341. package/dist/jsx/shell/workspaceIcons.mjs.map +1 -1
  342. package/dist/jsx/shell/workspaceIcons.native.js +32 -0
  343. package/dist/jsx/shell/workspaceIcons.native.js.map +1 -1
  344. package/package.json +12 -12
  345. package/src/chrome/CommandPalette.spec.tsx +12 -0
  346. package/src/chrome/awesomebar-data.tsx +115 -38
  347. package/src/config/BackofficeProvider.tsx +9 -4
  348. package/src/config/capabilities.spec.ts +19 -1
  349. package/src/config/capabilities.ts +13 -4
  350. package/src/desk/Desk.tsx +20 -4
  351. package/src/desk/DeskSurface.tsx +3 -0
  352. package/src/desk/resolveDeskPath.spec.ts +4 -0
  353. package/src/desk/resolveDeskPath.ts +7 -1
  354. package/src/desk/target.ts +3 -0
  355. package/src/index.ts +7 -1
  356. package/src/navigation/paths.ts +11 -0
  357. package/src/shell/AllDoctypes.stories.tsx +164 -0
  358. package/src/shell/AllDoctypesScreen.screen.spec.tsx +290 -0
  359. package/src/shell/AllDoctypesScreen.tsx +389 -0
  360. package/src/shell/WorkspaceSidebar.spec.tsx +11 -1
  361. package/src/shell/WorkspaceSidebar.tsx +39 -19
  362. package/src/shell/workspaceIcons.ts +45 -0
  363. package/types/chrome/awesomebar-data.d.ts +14 -3
  364. package/types/chrome/awesomebar-data.d.ts.map +1 -1
  365. package/types/config/BackofficeProvider.d.ts +9 -4
  366. package/types/config/BackofficeProvider.d.ts.map +1 -1
  367. package/types/config/capabilities.d.ts +7 -1
  368. package/types/config/capabilities.d.ts.map +1 -1
  369. package/types/desk/Desk.d.ts +8 -3
  370. package/types/desk/Desk.d.ts.map +1 -1
  371. package/types/desk/DeskSurface.d.ts.map +1 -1
  372. package/types/desk/resolveDeskPath.d.ts +3 -1
  373. package/types/desk/resolveDeskPath.d.ts.map +1 -1
  374. package/types/desk/target.d.ts +2 -0
  375. package/types/desk/target.d.ts.map +1 -1
  376. package/types/index.d.ts +6 -4
  377. package/types/index.d.ts.map +1 -1
  378. package/types/navigation/paths.d.ts +6 -0
  379. package/types/navigation/paths.d.ts.map +1 -1
  380. package/types/shell/AllDoctypesScreen.d.ts +18 -0
  381. package/types/shell/AllDoctypesScreen.d.ts.map +1 -0
  382. package/types/shell/WorkspaceSidebar.d.ts.map +1 -1
  383. package/types/shell/workspaceIcons.d.ts +2 -0
  384. package/types/shell/workspaceIcons.d.ts.map +1 -1
@@ -24,6 +24,10 @@ describe.each(BASE_PATHS)("resolveDeskPath round-trips createBackofficePaths at
24
24
  expect(resolve(paths.home(), basePath)).toEqual({ kind: "home" });
25
25
  });
26
26
 
27
+ it("allDoctypes() → all-doctypes, never a slug", () => {
28
+ expect(resolve(paths.allDoctypes(), basePath)).toEqual({ kind: "all-doctypes" });
29
+ });
30
+
27
31
  it("workspace() → slug (ambiguity is data, resolved downstream)", () => {
28
32
  expect(resolve(paths.workspace("Accounting"), basePath)).toEqual({
29
33
  kind: "slug",
@@ -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 seven route shapes `createBackofficePaths` writes.
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
  }
@@ -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,
@@ -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
+ });