2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 04:55:44 +00:00

Bug fixes

This commit is contained in:
Oliver
2024-03-01 04:27:35 +00:00
parent fa7c97bedf
commit 180421cf3a
2 changed files with 10 additions and 7 deletions

View File

@ -123,7 +123,7 @@ export default function CategoryDetail({}: {}) {
() => [ () => [
{ {
name: 'details', name: 'details',
label: t`Details`, label: t`Category Details`,
icon: <IconInfoCircle />, icon: <IconInfoCircle />,
content: detailsPanel content: detailsPanel
// hidden: !category?.pk, // hidden: !category?.pk,

View File

@ -276,7 +276,11 @@ function NameBadge({ pk, type }: { pk: string | number; type: BadgeType }) {
* If user is defined, a badge is rendered in addition to main value * If user is defined, a badge is rendered in addition to main value
*/ */
function TableStringValue(props: FieldProps) { function TableStringValue(props: FieldProps) {
let value = props?.field_value ?? {}; let value = props?.field_value;
if (value === undefined) {
return '---';
}
if (props.field_data?.value_formatter) { if (props.field_data?.value_formatter) {
value = props.field_data.value_formatter(); value = props.field_data.value_formatter();
@ -455,6 +459,7 @@ export function DetailsTableField({
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
gap: '20px', gap: '20px',
width: '50',
justifyContent: 'flex-start' justifyContent: 'flex-start'
}} }}
> >
@ -466,7 +471,9 @@ export function DetailsTableField({
<td style={{ minWidth: '40%' }}> <td style={{ minWidth: '40%' }}>
<FieldType field_data={field} field_value={item[field.name]} /> <FieldType field_data={field} field_value={item[field.name]} />
</td> </td>
<td>{field.copy && <CopyField value={'hello world'} />}</td> <td style={{ width: '50' }}>
{field.copy && <CopyField value={'hello world'} />}
</td>
</tr> </tr>
); );
} }
@ -481,10 +488,6 @@ export function DetailsTable({
return ( return (
<Paper p="xs" withBorder radius="xs"> <Paper p="xs" withBorder radius="xs">
<Table striped> <Table striped>
<col width="5O" />
<col />
<col />
<col width="50" />
<tbody> <tbody>
{fields {fields
.filter((field: DetailsField) => !field.hidden) .filter((field: DetailsField) => !field.hidden)