mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 21:16:46 +00:00
use LABEL_DEFAULT_PRINTER user setting to pre-select plugin in label printing forms (#8330)
This commit is contained in:
parent
a6bba144e7
commit
5ed0af20c8
@ -11,6 +11,7 @@ import { extractAvailableFields } from '../../functions/forms';
|
|||||||
import { useCreateApiFormModal } from '../../hooks/UseForm';
|
import { useCreateApiFormModal } from '../../hooks/UseForm';
|
||||||
import { apiUrl } from '../../states/ApiState';
|
import { apiUrl } from '../../states/ApiState';
|
||||||
import { useLocalState } from '../../states/LocalState';
|
import { useLocalState } from '../../states/LocalState';
|
||||||
|
import { useUserSettingsState } from '../../states/SettingsState';
|
||||||
import { ApiFormFieldSet } from '../forms/fields/ApiFormField';
|
import { ApiFormFieldSet } from '../forms/fields/ApiFormField';
|
||||||
import { ActionDropdown } from '../items/ActionDropdown';
|
import { ActionDropdown } from '../items/ActionDropdown';
|
||||||
|
|
||||||
@ -29,6 +30,8 @@ export function PrintingActions({
|
|||||||
}) {
|
}) {
|
||||||
const { host } = useLocalState.getState();
|
const { host } = useLocalState.getState();
|
||||||
|
|
||||||
|
const userSettings = useUserSettingsState();
|
||||||
|
|
||||||
const enabled = useMemo(() => items.length > 0, [items]);
|
const enabled = useMemo(() => items.length > 0, [items]);
|
||||||
|
|
||||||
const [pluginKey, setPluginKey] = useState<string>('');
|
const [pluginKey, setPluginKey] = useState<string>('');
|
||||||
@ -74,6 +77,7 @@ export function PrintingActions({
|
|||||||
|
|
||||||
fields['plugin'] = {
|
fields['plugin'] = {
|
||||||
...fields['plugin'],
|
...fields['plugin'],
|
||||||
|
value: userSettings.getSetting('LABEL_DEFAULT_PRINTER'),
|
||||||
filters: {
|
filters: {
|
||||||
active: true,
|
active: true,
|
||||||
mixin: 'labels'
|
mixin: 'labels'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user