diff --git a/src/frontend/src/components/nav/NavigationDrawer.tsx b/src/frontend/src/components/nav/NavigationDrawer.tsx
index 7bb8c90fa1..c68eacf100 100644
--- a/src/frontend/src/components/nav/NavigationDrawer.tsx
+++ b/src/frontend/src/components/nav/NavigationDrawer.tsx
@@ -18,6 +18,7 @@ import { MenuLinkItem, MenuLinks } from '../items/MenuLinks';
// TODO @matmair #1: implement plugin loading and menu item generation see #5269
const plugins: MenuLinkItem[] = [];
+const onlyItems = Object.values(menuItems);
export function NavigationDrawer({
opened,
@@ -60,7 +61,7 @@ function DrawerContent() {
{t`Pages`}
-
+
{plugins.length > 0 ? (
<>
diff --git a/src/frontend/src/defaults/actions.tsx b/src/frontend/src/defaults/actions.tsx
new file mode 100644
index 0000000000..6c773b013c
--- /dev/null
+++ b/src/frontend/src/defaults/actions.tsx
@@ -0,0 +1,40 @@
+import { t } from '@lingui/macro';
+import type { SpotlightAction } from '@mantine/spotlight';
+import { IconFileText, IconHome, IconInfoCircle } from '@tabler/icons-react';
+import { NavigateFunction } from 'react-router-dom';
+
+import { menuItems } from './menuItems';
+
+export function getActions(navigate: NavigateFunction) {
+ /**
+ * Default actions for the spotlight
+ */
+ const actions: SpotlightAction[] = [
+ {
+ title: t`Home`,
+ description: `Go to the home page`,
+ onTrigger: (action) => navigate(menuItems.home.link),
+ icon:
+ },
+ {
+ title: t`Dashboard`,
+ description: t`Go to the InvenTree dashboard`,
+ onTrigger: () => navigate(menuItems.dashboard.link),
+ icon:
+ },
+ {
+ title: t`Documentation`,
+ description: t`Visit documentation to learn more about InvenTree`,
+ onTrigger: () => console.log('Documentation'),
+ icon:
+ },
+ {
+ title: t`About InvenTree`,
+ description: t`About the InvenTree org`,
+ onTrigger: () => navigate(menuItems.about.link),
+ icon:
+ }
+ ];
+
+ return actions;
+}
diff --git a/src/frontend/src/defaults/menuItems.tsx b/src/frontend/src/defaults/menuItems.tsx
index abc57e13a9..e713553217 100644
--- a/src/frontend/src/defaults/menuItems.tsx
+++ b/src/frontend/src/defaults/menuItems.tsx
@@ -1,75 +1,75 @@
import { Trans } from '@lingui/macro';
-import { MenuLinkItem } from '../components/items/MenuLinks';
+import { menuItemsCollection } from '../components/items/MenuLinks';
import { IS_DEV_OR_DEMO } from '../main';
-export const menuItems: MenuLinkItem[] = [
- {
+export const menuItems: menuItemsCollection = {
+ home: {
id: 'home',
text: Home,
link: '/',
highlight: true
},
- {
+ profile: {
id: 'profile',
text: Account settings,
link: '/settings/user',
doctext: User attributes and design settings.
},
- {
+ scan: {
id: 'scan',
text: Scanning,
link: '/scan',
doctext: View for interactive scanning and multiple actions.,
highlight: true
},
- {
+ dashboard: {
id: 'dashboard',
text: Dashboard,
link: '/dashboard'
},
- {
+ parts: {
id: 'parts',
text: Parts,
link: '/part/'
},
- {
+ stock: {
id: 'stock',
text: Stock,
link: '/stock'
},
- {
+ build: {
id: 'build',
text: Build,
link: '/build/'
},
- {
+ purchasing: {
id: 'purchasing',
text: Purchasing,
link: '/purchasing/'
},
- {
+ sales: {
id: 'sales',
text: Sales,
link: '/sales/'
},
- {
+ 'settings-system': {
id: 'settings-system',
text: System Settings,
link: '/settings/system'
},
- {
+ 'settings-admin': {
id: 'settings-admin',
text: Admin Center,
link: '/settings/admin'
}
-];
+};
if (IS_DEV_OR_DEMO) {
- menuItems.push({
+ menuItems['playground'] = {
id: 'playground',
text: Playground,
link: '/playground',
highlight: true
- });
+ };
}