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:
parent
a6bba144e7
commit
5ed0af20c8
@ -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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user