2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-01 04:56:45 +00:00

use LABEL_DEFAULT_PRINTER user setting to pre-select plugin in label printing forms (#8330)

This commit is contained in:
simonkuehling 2024-10-23 06:18:02 +02:00 committed by GitHub
parent a6bba144e7
commit 5ed0af20c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,7 @@ import { extractAvailableFields } from '../../functions/forms';
import { useCreateApiFormModal } from '../../hooks/UseForm';
import { apiUrl } from '../../states/ApiState';
import { useLocalState } from '../../states/LocalState';
import { useUserSettingsState } from '../../states/SettingsState';
import { ApiFormFieldSet } from '../forms/fields/ApiFormField';
import { ActionDropdown } from '../items/ActionDropdown';
@ -29,6 +30,8 @@ export function PrintingActions({
}) {
const { host } = useLocalState.getState();
const userSettings = useUserSettingsState();
const enabled = useMemo(() => items.length > 0, [items]);
const [pluginKey, setPluginKey] = useState<string>('');
@ -74,6 +77,7 @@ export function PrintingActions({
fields['plugin'] = {
...fields['plugin'],
value: userSettings.getSetting('LABEL_DEFAULT_PRINTER'),
filters: {
active: true,
mixin: 'labels'