@multiplatform.one/backoffice 7.75.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/UserMenu.cjs +43 -28
- package/dist/cjs/chrome/UserMenu.native.js +44 -28
- 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/notifications-panel.cjs +22 -61
- package/dist/cjs/chrome/notifications-panel.native.js +22 -62
- package/dist/cjs/chrome/notifications-panel.native.js.map +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/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/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.cjs +46 -44
- package/dist/cjs/form/DocFormScreen.native.js +49 -47
- package/dist/cjs/form/DocFormScreen.native.js.map +1 -1
- package/dist/cjs/form/FormConnections.cjs +54 -125
- package/dist/cjs/form/FormConnections.native.js +59 -127
- package/dist/cjs/form/FormConnections.native.js.map +1 -1
- package/dist/cjs/form/FormDialogs.cjs +9 -52
- package/dist/cjs/form/FormDialogs.native.js +7 -49
- package/dist/cjs/form/FormDialogs.native.js.map +1 -1
- package/dist/cjs/form/FormTimeline.cjs +17 -17
- package/dist/cjs/form/FormTimeline.native.js +17 -17
- package/dist/cjs/form/FormTimeline.native.js.map +1 -1
- package/dist/cjs/form/FormToolbar.cjs +76 -82
- package/dist/cjs/form/FormToolbar.native.js +76 -82
- package/dist/cjs/form/FormToolbar.native.js.map +1 -1
- package/dist/cjs/formBuilder/FormBuilderCanvas.cjs +16 -24
- package/dist/cjs/formBuilder/FormBuilderCanvas.native.js +16 -24
- package/dist/cjs/formBuilder/FormBuilderCanvas.native.js.map +1 -1
- package/dist/cjs/i18n/en.cjs +2 -3
- package/dist/cjs/i18n/en.native.js +2 -3
- package/dist/cjs/i18n/en.native.js.map +1 -1
- package/dist/cjs/index.cjs +6 -0
- package/dist/cjs/index.native.js +6 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/list/DoctypeListScreen.cjs +11 -17
- package/dist/cjs/list/DoctypeListScreen.native.js +15 -21
- package/dist/cjs/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/cjs/list/ListBulkActionsBar.cjs +10 -8
- package/dist/cjs/list/ListBulkActionsBar.native.js +10 -8
- package/dist/cjs/list/ListBulkActionsBar.native.js.map +1 -1
- package/dist/cjs/list/filter-editor.cjs +4 -6
- package/dist/cjs/list/filter-editor.native.js +4 -6
- package/dist/cjs/list/filter-editor.native.js.map +1 -1
- package/dist/cjs/list/filter-saved.cjs +4 -4
- package/dist/cjs/list/filter-saved.native.js +4 -4
- package/dist/cjs/list/filter-saved.native.js.map +1 -1
- package/dist/cjs/list/sidebar-section.cjs +11 -67
- package/dist/cjs/list/sidebar-section.native.js +11 -69
- package/dist/cjs/list/sidebar-section.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/quickEntry/QuickEntryDialog.cjs +27 -26
- package/dist/cjs/quickEntry/QuickEntryDialog.native.js +27 -26
- package/dist/cjs/quickEntry/QuickEntryDialog.native.js.map +1 -1
- package/dist/cjs/report/QueryReportScreen.cjs +4 -6
- package/dist/cjs/report/QueryReportScreen.native.js +4 -6
- package/dist/cjs/report/QueryReportScreen.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.cjs +22 -62
- package/dist/cjs/shell/BackofficeShell.native.js +22 -63
- package/dist/cjs/shell/BackofficeShell.native.js.map +1 -1
- package/dist/cjs/shell/WorkspaceSidebar.cjs +48 -149
- package/dist/cjs/shell/WorkspaceSidebar.native.js +51 -157
- package/dist/cjs/shell/WorkspaceSidebar.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/ViewHeader.cjs +5 -10
- package/dist/cjs/views/ViewHeader.native.js +7 -12
- package/dist/cjs/views/ViewHeader.native.js.map +1 -1
- package/dist/cjs/views/ViewStates.cjs +5 -7
- package/dist/cjs/views/ViewStates.native.js +5 -7
- package/dist/cjs/views/ViewStates.native.js.map +1 -1
- package/dist/cjs/views/kanban-board-controls.cjs +4 -5
- package/dist/cjs/views/kanban-board-controls.native.js +4 -5
- package/dist/cjs/views/kanban-board-controls.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceLinkCard.cjs +22 -123
- package/dist/cjs/workspace/WorkspaceLinkCard.native.js +23 -128
- package/dist/cjs/workspace/WorkspaceLinkCard.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceLinkDirectory.cjs +0 -6
- package/dist/cjs/workspace/WorkspaceLinkDirectory.native.js +0 -12
- package/dist/cjs/workspace/WorkspaceLinkDirectory.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceNumberCard.cjs +23 -41
- package/dist/cjs/workspace/WorkspaceNumberCard.native.js +23 -41
- package/dist/cjs/workspace/WorkspaceNumberCard.native.js.map +1 -1
- package/dist/cjs/workspace/WorkspaceQuickList.cjs +25 -21
- package/dist/cjs/workspace/WorkspaceQuickList.native.js +28 -25
- package/dist/cjs/workspace/WorkspaceQuickList.native.js.map +1 -1
- package/dist/esm/chrome/UserMenu.mjs +33 -18
- package/dist/esm/chrome/UserMenu.mjs.map +1 -1
- package/dist/esm/chrome/UserMenu.native.js +34 -18
- package/dist/esm/chrome/UserMenu.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/chrome/notifications-panel.mjs +25 -64
- package/dist/esm/chrome/notifications-panel.mjs.map +1 -1
- package/dist/esm/chrome/notifications-panel.native.js +25 -65
- package/dist/esm/chrome/notifications-panel.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/form/DocFormScreen.mjs +19 -17
- package/dist/esm/form/DocFormScreen.mjs.map +1 -1
- package/dist/esm/form/DocFormScreen.native.js +22 -20
- package/dist/esm/form/DocFormScreen.native.js.map +1 -1
- package/dist/esm/form/FormConnections.mjs +56 -127
- package/dist/esm/form/FormConnections.mjs.map +1 -1
- package/dist/esm/form/FormConnections.native.js +61 -129
- package/dist/esm/form/FormConnections.native.js.map +1 -1
- package/dist/esm/form/FormDialogs.mjs +11 -54
- package/dist/esm/form/FormDialogs.mjs.map +1 -1
- package/dist/esm/form/FormDialogs.native.js +9 -51
- package/dist/esm/form/FormDialogs.native.js.map +1 -1
- package/dist/esm/form/FormTimeline.mjs +17 -17
- package/dist/esm/form/FormTimeline.mjs.map +1 -1
- package/dist/esm/form/FormTimeline.native.js +17 -17
- package/dist/esm/form/FormTimeline.native.js.map +1 -1
- package/dist/esm/form/FormToolbar.mjs +77 -83
- package/dist/esm/form/FormToolbar.mjs.map +1 -1
- package/dist/esm/form/FormToolbar.native.js +77 -83
- package/dist/esm/form/FormToolbar.native.js.map +1 -1
- package/dist/esm/formBuilder/FormBuilderCanvas.mjs +19 -27
- package/dist/esm/formBuilder/FormBuilderCanvas.mjs.map +1 -1
- package/dist/esm/formBuilder/FormBuilderCanvas.native.js +19 -27
- package/dist/esm/formBuilder/FormBuilderCanvas.native.js.map +1 -1
- package/dist/esm/i18n/en.mjs +2 -3
- package/dist/esm/i18n/en.mjs.map +1 -1
- package/dist/esm/i18n/en.native.js +2 -3
- package/dist/esm/i18n/en.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/list/DoctypeListScreen.mjs +12 -18
- package/dist/esm/list/DoctypeListScreen.mjs.map +1 -1
- package/dist/esm/list/DoctypeListScreen.native.js +16 -22
- package/dist/esm/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/esm/list/ListBulkActionsBar.mjs +11 -9
- package/dist/esm/list/ListBulkActionsBar.mjs.map +1 -1
- package/dist/esm/list/ListBulkActionsBar.native.js +11 -9
- package/dist/esm/list/ListBulkActionsBar.native.js.map +1 -1
- package/dist/esm/list/filter-editor.mjs +5 -7
- package/dist/esm/list/filter-editor.mjs.map +1 -1
- package/dist/esm/list/filter-editor.native.js +5 -7
- package/dist/esm/list/filter-editor.native.js.map +1 -1
- package/dist/esm/list/filter-saved.mjs +6 -6
- package/dist/esm/list/filter-saved.mjs.map +1 -1
- package/dist/esm/list/filter-saved.native.js +6 -6
- package/dist/esm/list/filter-saved.native.js.map +1 -1
- package/dist/esm/list/sidebar-section.mjs +15 -71
- package/dist/esm/list/sidebar-section.mjs.map +1 -1
- package/dist/esm/list/sidebar-section.native.js +13 -71
- package/dist/esm/list/sidebar-section.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/quickEntry/QuickEntryDialog.mjs +10 -9
- package/dist/esm/quickEntry/QuickEntryDialog.mjs.map +1 -1
- package/dist/esm/quickEntry/QuickEntryDialog.native.js +10 -9
- package/dist/esm/quickEntry/QuickEntryDialog.native.js.map +1 -1
- package/dist/esm/report/QueryReportScreen.mjs +5 -7
- package/dist/esm/report/QueryReportScreen.mjs.map +1 -1
- package/dist/esm/report/QueryReportScreen.native.js +5 -7
- package/dist/esm/report/QueryReportScreen.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/BackofficeShell.mjs +25 -65
- package/dist/esm/shell/BackofficeShell.mjs.map +1 -1
- package/dist/esm/shell/BackofficeShell.native.js +25 -66
- package/dist/esm/shell/BackofficeShell.native.js.map +1 -1
- package/dist/esm/shell/WorkspaceSidebar.mjs +50 -151
- package/dist/esm/shell/WorkspaceSidebar.mjs.map +1 -1
- package/dist/esm/shell/WorkspaceSidebar.native.js +53 -159
- 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/esm/views/ViewHeader.mjs +7 -12
- package/dist/esm/views/ViewHeader.mjs.map +1 -1
- package/dist/esm/views/ViewHeader.native.js +9 -14
- package/dist/esm/views/ViewHeader.native.js.map +1 -1
- package/dist/esm/views/ViewStates.mjs +6 -8
- package/dist/esm/views/ViewStates.mjs.map +1 -1
- package/dist/esm/views/ViewStates.native.js +6 -8
- package/dist/esm/views/ViewStates.native.js.map +1 -1
- package/dist/esm/views/kanban-board-controls.mjs +6 -7
- package/dist/esm/views/kanban-board-controls.mjs.map +1 -1
- package/dist/esm/views/kanban-board-controls.native.js +6 -7
- package/dist/esm/views/kanban-board-controls.native.js.map +1 -1
- package/dist/esm/workspace/WorkspaceLinkCard.mjs +24 -125
- package/dist/esm/workspace/WorkspaceLinkCard.mjs.map +1 -1
- package/dist/esm/workspace/WorkspaceLinkCard.native.js +25 -130
- package/dist/esm/workspace/WorkspaceLinkCard.native.js.map +1 -1
- package/dist/esm/workspace/WorkspaceLinkDirectory.mjs +0 -6
- package/dist/esm/workspace/WorkspaceLinkDirectory.mjs.map +1 -1
- package/dist/esm/workspace/WorkspaceLinkDirectory.native.js +0 -12
- package/dist/esm/workspace/WorkspaceLinkDirectory.native.js.map +1 -1
- package/dist/esm/workspace/WorkspaceNumberCard.mjs +24 -42
- package/dist/esm/workspace/WorkspaceNumberCard.mjs.map +1 -1
- package/dist/esm/workspace/WorkspaceNumberCard.native.js +24 -42
- package/dist/esm/workspace/WorkspaceNumberCard.native.js.map +1 -1
- package/dist/esm/workspace/WorkspaceQuickList.mjs +24 -20
- package/dist/esm/workspace/WorkspaceQuickList.mjs.map +1 -1
- package/dist/esm/workspace/WorkspaceQuickList.native.js +27 -24
- package/dist/esm/workspace/WorkspaceQuickList.native.js.map +1 -1
- package/dist/jsx/chrome/UserMenu.mjs +33 -18
- package/dist/jsx/chrome/UserMenu.mjs.map +1 -1
- package/dist/jsx/chrome/UserMenu.native.js +44 -28
- package/dist/jsx/chrome/UserMenu.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/chrome/notifications-panel.mjs +25 -64
- package/dist/jsx/chrome/notifications-panel.mjs.map +1 -1
- package/dist/jsx/chrome/notifications-panel.native.js +22 -62
- package/dist/jsx/chrome/notifications-panel.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/form/DocFormScreen.mjs +19 -17
- package/dist/jsx/form/DocFormScreen.mjs.map +1 -1
- package/dist/jsx/form/DocFormScreen.native.js +49 -47
- package/dist/jsx/form/DocFormScreen.native.js.map +1 -1
- package/dist/jsx/form/FormConnections.mjs +56 -127
- package/dist/jsx/form/FormConnections.mjs.map +1 -1
- package/dist/jsx/form/FormConnections.native.js +59 -127
- package/dist/jsx/form/FormConnections.native.js.map +1 -1
- package/dist/jsx/form/FormDialogs.mjs +11 -54
- package/dist/jsx/form/FormDialogs.mjs.map +1 -1
- package/dist/jsx/form/FormDialogs.native.js +7 -49
- package/dist/jsx/form/FormDialogs.native.js.map +1 -1
- package/dist/jsx/form/FormTimeline.mjs +17 -17
- package/dist/jsx/form/FormTimeline.mjs.map +1 -1
- package/dist/jsx/form/FormTimeline.native.js +17 -17
- package/dist/jsx/form/FormTimeline.native.js.map +1 -1
- package/dist/jsx/form/FormToolbar.mjs +77 -83
- package/dist/jsx/form/FormToolbar.mjs.map +1 -1
- package/dist/jsx/form/FormToolbar.native.js +76 -82
- package/dist/jsx/form/FormToolbar.native.js.map +1 -1
- package/dist/jsx/formBuilder/FormBuilderCanvas.mjs +19 -27
- package/dist/jsx/formBuilder/FormBuilderCanvas.mjs.map +1 -1
- package/dist/jsx/formBuilder/FormBuilderCanvas.native.js +16 -24
- package/dist/jsx/formBuilder/FormBuilderCanvas.native.js.map +1 -1
- package/dist/jsx/i18n/en.mjs +2 -3
- package/dist/jsx/i18n/en.mjs.map +1 -1
- package/dist/jsx/i18n/en.native.js +2 -3
- package/dist/jsx/i18n/en.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/list/DoctypeListScreen.mjs +12 -18
- package/dist/jsx/list/DoctypeListScreen.mjs.map +1 -1
- package/dist/jsx/list/DoctypeListScreen.native.js +15 -21
- package/dist/jsx/list/DoctypeListScreen.native.js.map +1 -1
- package/dist/jsx/list/ListBulkActionsBar.mjs +11 -9
- package/dist/jsx/list/ListBulkActionsBar.mjs.map +1 -1
- package/dist/jsx/list/ListBulkActionsBar.native.js +10 -8
- package/dist/jsx/list/ListBulkActionsBar.native.js.map +1 -1
- package/dist/jsx/list/filter-editor.mjs +5 -7
- package/dist/jsx/list/filter-editor.mjs.map +1 -1
- package/dist/jsx/list/filter-editor.native.js +4 -6
- package/dist/jsx/list/filter-editor.native.js.map +1 -1
- package/dist/jsx/list/filter-saved.mjs +6 -6
- package/dist/jsx/list/filter-saved.mjs.map +1 -1
- package/dist/jsx/list/filter-saved.native.js +4 -4
- package/dist/jsx/list/filter-saved.native.js.map +1 -1
- package/dist/jsx/list/sidebar-section.mjs +15 -71
- package/dist/jsx/list/sidebar-section.mjs.map +1 -1
- package/dist/jsx/list/sidebar-section.native.js +11 -69
- package/dist/jsx/list/sidebar-section.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/quickEntry/QuickEntryDialog.mjs +10 -9
- package/dist/jsx/quickEntry/QuickEntryDialog.mjs.map +1 -1
- package/dist/jsx/quickEntry/QuickEntryDialog.native.js +27 -26
- package/dist/jsx/quickEntry/QuickEntryDialog.native.js.map +1 -1
- package/dist/jsx/report/QueryReportScreen.mjs +5 -7
- package/dist/jsx/report/QueryReportScreen.mjs.map +1 -1
- package/dist/jsx/report/QueryReportScreen.native.js +4 -6
- package/dist/jsx/report/QueryReportScreen.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/BackofficeShell.mjs +25 -65
- package/dist/jsx/shell/BackofficeShell.mjs.map +1 -1
- package/dist/jsx/shell/BackofficeShell.native.js +22 -63
- package/dist/jsx/shell/BackofficeShell.native.js.map +1 -1
- package/dist/jsx/shell/WorkspaceSidebar.mjs +50 -151
- package/dist/jsx/shell/WorkspaceSidebar.mjs.map +1 -1
- package/dist/jsx/shell/WorkspaceSidebar.native.js +51 -157
- 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/dist/jsx/views/ViewHeader.mjs +7 -12
- package/dist/jsx/views/ViewHeader.mjs.map +1 -1
- package/dist/jsx/views/ViewHeader.native.js +7 -12
- package/dist/jsx/views/ViewHeader.native.js.map +1 -1
- package/dist/jsx/views/ViewStates.mjs +6 -8
- package/dist/jsx/views/ViewStates.mjs.map +1 -1
- package/dist/jsx/views/ViewStates.native.js +5 -7
- package/dist/jsx/views/ViewStates.native.js.map +1 -1
- package/dist/jsx/views/kanban-board-controls.mjs +6 -7
- package/dist/jsx/views/kanban-board-controls.mjs.map +1 -1
- package/dist/jsx/views/kanban-board-controls.native.js +4 -5
- package/dist/jsx/views/kanban-board-controls.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceLinkCard.mjs +24 -125
- package/dist/jsx/workspace/WorkspaceLinkCard.mjs.map +1 -1
- package/dist/jsx/workspace/WorkspaceLinkCard.native.js +23 -128
- package/dist/jsx/workspace/WorkspaceLinkCard.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceLinkDirectory.mjs +0 -6
- package/dist/jsx/workspace/WorkspaceLinkDirectory.mjs.map +1 -1
- package/dist/jsx/workspace/WorkspaceLinkDirectory.native.js +0 -12
- package/dist/jsx/workspace/WorkspaceLinkDirectory.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceNumberCard.mjs +24 -42
- package/dist/jsx/workspace/WorkspaceNumberCard.mjs.map +1 -1
- package/dist/jsx/workspace/WorkspaceNumberCard.native.js +23 -41
- package/dist/jsx/workspace/WorkspaceNumberCard.native.js.map +1 -1
- package/dist/jsx/workspace/WorkspaceQuickList.mjs +24 -20
- package/dist/jsx/workspace/WorkspaceQuickList.mjs.map +1 -1
- package/dist/jsx/workspace/WorkspaceQuickList.native.js +28 -25
- package/dist/jsx/workspace/WorkspaceQuickList.native.js.map +1 -1
- package/package.json +12 -12
- package/src/backofficeScreens.designLaw.spec.ts +2 -2
- package/src/chrome/CommandPalette.spec.tsx +12 -0
- package/src/chrome/NotificationsButton.screen.spec.tsx +2 -0
- package/src/chrome/UserMenu.screen.spec.tsx +8 -0
- package/src/chrome/UserMenu.tsx +27 -17
- package/src/chrome/awesomebar-data.tsx +115 -38
- package/src/chrome/notifications-panel.tsx +23 -64
- 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/form/DocFormScreen.tsx +19 -10
- package/src/form/FormConnections.tsx +86 -153
- package/src/form/FormDialogs.tsx +21 -50
- package/src/form/FormTimeline.tsx +10 -11
- package/src/form/FormToolbar.screen.spec.tsx +15 -0
- package/src/form/FormToolbar.tsx +74 -86
- package/src/form/JumpToFieldDialog.stories.tsx +37 -0
- package/src/formBuilder/FormBuilderCanvas.tsx +27 -23
- package/src/i18n/en.ts +2 -3
- package/src/index.ts +7 -1
- package/src/list/DoctypeListScreen.compactHead.screen.spec.tsx +1 -1
- package/src/list/DoctypeListScreen.tsx +12 -16
- package/src/list/ListBulkActionsBar.tsx +12 -9
- package/src/list/filter-editor.tsx +6 -4
- package/src/list/filter-saved.tsx +6 -7
- package/src/list/sidebar-section.spec.tsx +15 -1
- package/src/list/sidebar-section.tsx +12 -70
- package/src/navigation/paths.ts +11 -0
- package/src/quickEntry/QuickEntryDialog.tsx +13 -7
- package/src/report/QueryReportScreen.spec.tsx +0 -1
- package/src/report/QueryReportScreen.tsx +5 -8
- 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/BackofficeShell.spec.tsx +11 -5
- package/src/shell/BackofficeShell.tsx +33 -64
- package/src/shell/WorkspaceSidebar.spec.tsx +40 -24
- package/src/shell/WorkspaceSidebar.tsx +75 -171
- package/src/shell/workspaceIcons.ts +45 -0
- package/src/views/CalendarView.screen.spec.tsx +1 -1
- package/src/views/ImageView.screen.spec.tsx +1 -1
- package/src/views/KanbanView.screen.spec.tsx +1 -1
- package/src/views/ViewHeader.tsx +7 -13
- package/src/views/ViewStates.tsx +6 -9
- package/src/views/kanban-board-controls.tsx +12 -4
- package/src/workspace/WorkspaceLinkCard.tsx +37 -113
- package/src/workspace/WorkspaceLinkDirectory.tsx +1 -16
- package/src/workspace/WorkspaceNumberCard.tsx +11 -21
- package/src/workspace/WorkspaceQuickList.tsx +27 -23
- package/types/chrome/UserMenu.d.ts.map +1 -1
- package/types/chrome/awesomebar-data.d.ts +14 -3
- package/types/chrome/awesomebar-data.d.ts.map +1 -1
- package/types/chrome/notifications-panel.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/form/DocFormScreen.d.ts.map +1 -1
- package/types/form/FormConnections.d.ts.map +1 -1
- package/types/form/FormDialogs.d.ts.map +1 -1
- package/types/form/FormTimeline.d.ts.map +1 -1
- package/types/form/FormToolbar.d.ts.map +1 -1
- package/types/formBuilder/FormBuilderCanvas.d.ts.map +1 -1
- package/types/i18n/en.d.ts +2 -3
- package/types/i18n/en.d.ts.map +1 -1
- package/types/index.d.ts +6 -4
- package/types/index.d.ts.map +1 -1
- package/types/list/DoctypeListScreen.d.ts.map +1 -1
- package/types/list/ListBulkActionsBar.d.ts.map +1 -1
- package/types/list/filter-editor.d.ts.map +1 -1
- package/types/list/filter-saved.d.ts.map +1 -1
- package/types/list/sidebar-section.d.ts +1 -1
- package/types/list/sidebar-section.d.ts.map +1 -1
- package/types/navigation/paths.d.ts +6 -0
- package/types/navigation/paths.d.ts.map +1 -1
- package/types/quickEntry/QuickEntryDialog.d.ts.map +1 -1
- package/types/report/QueryReportScreen.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/BackofficeShell.d.ts.map +1 -1
- package/types/shell/WorkspaceSidebar.d.ts +8 -1
- 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
- package/types/views/ViewHeader.d.ts.map +1 -1
- package/types/views/ViewStates.d.ts.map +1 -1
- package/types/views/kanban-board-controls.d.ts.map +1 -1
- package/types/workspace/WorkspaceLinkCard.d.ts.map +1 -1
- package/types/workspace/WorkspaceLinkDirectory.d.ts.map +1 -1
- package/types/workspace/WorkspaceNumberCard.d.ts.map +1 -1
- package/types/workspace/WorkspaceQuickList.d.ts.map +1 -1
|
@@ -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
|
+
});
|