mirror of
https://github.com/inventree/InvenTree.git
synced 2026-07-05 06:32:55 +00:00
(cherry picked from commit b9c063fe31)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
committed by
GitHub
parent
00d99f65fa
commit
52b2b3a62f
@@ -55,7 +55,7 @@ export function getDetailUrl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.error(`No detail URL found for model ${model} <${pk}>`);
|
console.warn(`No detail URL found for model ${model} <${pk}>`);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ export function BooleanField({
|
|||||||
|
|
||||||
const { value } = field;
|
const { value } = field;
|
||||||
|
|
||||||
// Set default value if value is undefined
|
// Set default value if value is undefined or otherwise empty
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (value === undefined) {
|
if (value === undefined || value === null || value === '') {
|
||||||
onChange(definition.default ?? false);
|
onChange(definition.default ?? false);
|
||||||
}
|
}
|
||||||
}, [value, definition]);
|
}, [value, definition]);
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ export function useParameterFields({
|
|||||||
// This is a "checkbox" field
|
// This is a "checkbox" field
|
||||||
setChoices([]);
|
setChoices([]);
|
||||||
setFieldType('boolean');
|
setFieldType('boolean');
|
||||||
|
setData('false');
|
||||||
} else if (record?.choices) {
|
} else if (record?.choices) {
|
||||||
const _choices: string[] = record.choices.split(',');
|
const _choices: string[] = record.choices.split(',');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user