2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-07-05 06:32:55 +00:00

Machine fixes (#12154)

* Handle missing machine location

- e.g. if location PK is invalid or has been deleted

* Add spotlight action for machine management panel

* Add unit test for code change
This commit is contained in:
Oliver
2026-06-11 16:32:14 +10:00
committed by GitHub
parent 39cc399a67
commit 3309032b26
3 changed files with 20 additions and 1 deletions
+11
View File
@@ -2,6 +2,7 @@ import { t } from '@lingui/core/macro';
import type { SpotlightActionData } from '@mantine/spotlight';
import {
IconBarcode,
IconDevicesPc,
IconLink,
IconPlug,
IconPointer,
@@ -234,6 +235,16 @@ export function getActions(navigate: NavigateFunction) {
leftSection: <IconPlug size='1.2rem' />
});
staff &&
user?.hasViewPermission(ModelType.pluginconfig) &&
_actions.push({
id: 'machine-management',
label: t`Machines`,
description: t`Manage machines and machine types`,
onClick: () => navigate('/settings/admin/machine'),
leftSection: <IconDevicesPc size='1.2rem' />
});
staff &&
user?.hasViewPermission(ModelType.reporttemplate) &&
_actions.push({