mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 19:20:55 +00:00
[UI] Description col tweaks (#9859)
* Refactoring * More refactoring * Remove debug msg
This commit is contained in:
@ -96,6 +96,7 @@ export function DescriptionColumn(props: TableColumnProps): TableColumn {
|
|||||||
title: t`Description`,
|
title: t`Description`,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
switchable: true,
|
switchable: true,
|
||||||
|
width: 300,
|
||||||
...props
|
...props
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,11 @@ import type { TableFilter } from '@lib/types/Filters';
|
|||||||
import { formatDecimal } from '../../defaults/formatters';
|
import { formatDecimal } from '../../defaults/formatters';
|
||||||
import { useTable } from '../../hooks/UseTable';
|
import { useTable } from '../../hooks/UseTable';
|
||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import { PartColumn, ReferenceColumn } from '../ColumnRenderers';
|
import {
|
||||||
|
DescriptionColumn,
|
||||||
|
PartColumn,
|
||||||
|
ReferenceColumn
|
||||||
|
} from '../ColumnRenderers';
|
||||||
import { InvenTreeTable } from '../InvenTreeTable';
|
import { InvenTreeTable } from '../InvenTreeTable';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -43,11 +47,9 @@ export function UsedInTable({
|
|||||||
title: t`Revision`,
|
title: t`Revision`,
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({
|
||||||
accessor: 'part_detail.description',
|
accessor: 'part_detail.description'
|
||||||
sortable: false,
|
}),
|
||||||
title: t`Description`
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'sub_part',
|
accessor: 'sub_part',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
|
@ -32,7 +32,12 @@ import useStatusCodes from '../../hooks/UseStatusCodes';
|
|||||||
import { useTable } from '../../hooks/UseTable';
|
import { useTable } from '../../hooks/UseTable';
|
||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import { BooleanColumn, LocationColumn, PartColumn } from '../ColumnRenderers';
|
import {
|
||||||
|
BooleanColumn,
|
||||||
|
DescriptionColumn,
|
||||||
|
LocationColumn,
|
||||||
|
PartColumn
|
||||||
|
} from '../ColumnRenderers';
|
||||||
import { InvenTreeTable } from '../InvenTreeTable';
|
import { InvenTreeTable } from '../InvenTreeTable';
|
||||||
import {
|
import {
|
||||||
type RowAction,
|
type RowAction,
|
||||||
@ -323,11 +328,9 @@ export default function BuildLineTable({
|
|||||||
sortable: false,
|
sortable: false,
|
||||||
title: t`IPN`
|
title: t`IPN`
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({
|
||||||
accessor: 'part_detail.description',
|
accessor: 'part_detail.description'
|
||||||
sortable: false,
|
}),
|
||||||
title: t`Description`
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'bom_item_detail.reference',
|
accessor: 'bom_item_detail.reference',
|
||||||
ordering: 'reference',
|
ordering: 'reference',
|
||||||
|
@ -15,7 +15,7 @@ import {
|
|||||||
import { useTable } from '../../hooks/UseTable';
|
import { useTable } from '../../hooks/UseTable';
|
||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import { LinkColumn, NoteColumn } from '../ColumnRenderers';
|
import { DescriptionColumn, LinkColumn, NoteColumn } from '../ColumnRenderers';
|
||||||
import { InvenTreeTable } from '../InvenTreeTable';
|
import { InvenTreeTable } from '../InvenTreeTable';
|
||||||
import {
|
import {
|
||||||
type RowAction,
|
type RowAction,
|
||||||
@ -46,9 +46,7 @@ export default function ExtraLineItemTable({
|
|||||||
accessor: 'reference',
|
accessor: 'reference',
|
||||||
switchable: false
|
switchable: false
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({}),
|
||||||
accessor: 'description'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'quantity',
|
accessor: 'quantity',
|
||||||
switchable: false
|
switchable: false
|
||||||
|
@ -25,7 +25,7 @@ import { StylishText } from '../../components/items/StylishText';
|
|||||||
import { DetailDrawer } from '../../components/nav/DetailDrawer';
|
import { DetailDrawer } from '../../components/nav/DetailDrawer';
|
||||||
import { useTable } from '../../hooks/UseTable';
|
import { useTable } from '../../hooks/UseTable';
|
||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import { BooleanColumn } from '../ColumnRenderers';
|
import { BooleanColumn, DescriptionColumn } from '../ColumnRenderers';
|
||||||
import { InvenTreeTable, type InvenTreeTableProps } from '../InvenTreeTable';
|
import { InvenTreeTable, type InvenTreeTableProps } from '../InvenTreeTable';
|
||||||
import { MachineListTable, useMachineTypeDriver } from './MachineListTable';
|
import { MachineListTable, useMachineTypeDriver } from './MachineListTable';
|
||||||
|
|
||||||
@ -70,10 +70,7 @@ function MachineTypeDrawer({
|
|||||||
accessor: 'name',
|
accessor: 'name',
|
||||||
title: t`Name`
|
title: t`Name`
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({}),
|
||||||
accessor: 'description',
|
|
||||||
title: t`Description`
|
|
||||||
},
|
|
||||||
BooleanColumn({
|
BooleanColumn({
|
||||||
accessor: 'is_builtin',
|
accessor: 'is_builtin',
|
||||||
title: t`Builtin driver`
|
title: t`Builtin driver`
|
||||||
@ -340,10 +337,7 @@ export function MachineTypeListTable({
|
|||||||
accessor: 'name',
|
accessor: 'name',
|
||||||
title: t`Name`
|
title: t`Name`
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({}),
|
||||||
accessor: 'description',
|
|
||||||
title: t`Description`
|
|
||||||
},
|
|
||||||
BooleanColumn({
|
BooleanColumn({
|
||||||
accessor: 'is_builtin',
|
accessor: 'is_builtin',
|
||||||
title: t`Builtin type`
|
title: t`Builtin type`
|
||||||
|
@ -14,7 +14,7 @@ import {
|
|||||||
import { useTable } from '../../hooks/UseTable';
|
import { useTable } from '../../hooks/UseTable';
|
||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import { BooleanColumn } from '../ColumnRenderers';
|
import { BooleanColumn, DescriptionColumn } from '../ColumnRenderers';
|
||||||
import { InvenTreeTable } from '../InvenTreeTable';
|
import { InvenTreeTable } from '../InvenTreeTable';
|
||||||
import { type RowAction, RowDeleteAction, RowEditAction } from '../RowActions';
|
import { type RowAction, RowDeleteAction, RowEditAction } from '../RowActions';
|
||||||
|
|
||||||
@ -32,10 +32,9 @@ export default function SelectionListTable() {
|
|||||||
accessor: 'name',
|
accessor: 'name',
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({
|
||||||
accessor: 'description',
|
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
}),
|
||||||
BooleanColumn({
|
BooleanColumn({
|
||||||
accessor: 'active'
|
accessor: 'active'
|
||||||
}),
|
}),
|
||||||
|
@ -31,6 +31,7 @@ import { useUserState } from '../../states/UserState';
|
|||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import {
|
import {
|
||||||
CurrencyColumn,
|
CurrencyColumn,
|
||||||
|
DescriptionColumn,
|
||||||
LinkColumn,
|
LinkColumn,
|
||||||
NoteColumn,
|
NoteColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
@ -143,10 +144,9 @@ export function PurchaseOrderLineItemTable({
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
ordering: 'IPN'
|
ordering: 'IPN'
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({
|
||||||
accessor: 'part_detail.description',
|
accessor: 'part_detail.description'
|
||||||
sortable: false
|
}),
|
||||||
},
|
|
||||||
ReferenceColumn({}),
|
ReferenceColumn({}),
|
||||||
{
|
{
|
||||||
accessor: 'build_order',
|
accessor: 'build_order',
|
||||||
|
@ -25,6 +25,7 @@ import { useUserState } from '../../states/UserState';
|
|||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import {
|
import {
|
||||||
DateColumn,
|
DateColumn,
|
||||||
|
DescriptionColumn,
|
||||||
LinkColumn,
|
LinkColumn,
|
||||||
NoteColumn,
|
NoteColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
@ -111,10 +112,9 @@ export default function ReturnOrderLineItemTable({
|
|||||||
accessor: 'part_detail.IPN',
|
accessor: 'part_detail.IPN',
|
||||||
sortable: false
|
sortable: false
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({
|
||||||
accessor: 'part_detail.description',
|
accessor: 'part_detail.description'
|
||||||
sortable: false
|
}),
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'item_detail.serial',
|
accessor: 'item_detail.serial',
|
||||||
title: t`Quantity`,
|
title: t`Quantity`,
|
||||||
|
@ -19,6 +19,7 @@ import { useTable } from '../../hooks/UseTable';
|
|||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import {
|
import {
|
||||||
|
DescriptionColumn,
|
||||||
LocationColumn,
|
LocationColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
ReferenceColumn,
|
ReferenceColumn,
|
||||||
@ -105,11 +106,10 @@ export default function SalesOrderAllocationTable({
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
hidden: showOrderInfo != true
|
hidden: showOrderInfo != true
|
||||||
}),
|
}),
|
||||||
{
|
DescriptionColumn({
|
||||||
accessor: 'order_detail.description',
|
accessor: 'order_detail.description',
|
||||||
title: t`Description`,
|
|
||||||
hidden: showOrderInfo != true
|
hidden: showOrderInfo != true
|
||||||
},
|
}),
|
||||||
StatusColumn({
|
StatusColumn({
|
||||||
accessor: 'order_detail.status',
|
accessor: 'order_detail.status',
|
||||||
model: ModelType.salesorder,
|
model: ModelType.salesorder,
|
||||||
@ -124,12 +124,10 @@ export default function SalesOrderAllocationTable({
|
|||||||
switchable: false,
|
switchable: false,
|
||||||
render: (record: any) => PartColumn({ part: record.part_detail })
|
render: (record: any) => PartColumn({ part: record.part_detail })
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({
|
||||||
accessor: 'part_detail.description',
|
accessor: 'part_detail.description',
|
||||||
title: t`Description`,
|
hidden: showPartInfo != true
|
||||||
hidden: showPartInfo != true,
|
}),
|
||||||
sortable: false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'part_detail.IPN',
|
accessor: 'part_detail.IPN',
|
||||||
title: t`IPN`,
|
title: t`IPN`,
|
||||||
|
@ -36,7 +36,12 @@ import {
|
|||||||
import { useTable } from '../../hooks/UseTable';
|
import { useTable } from '../../hooks/UseTable';
|
||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import { DateColumn, LinkColumn, PartColumn } from '../ColumnRenderers';
|
import {
|
||||||
|
DateColumn,
|
||||||
|
DescriptionColumn,
|
||||||
|
LinkColumn,
|
||||||
|
PartColumn
|
||||||
|
} from '../ColumnRenderers';
|
||||||
import { InvenTreeTable } from '../InvenTreeTable';
|
import { InvenTreeTable } from '../InvenTreeTable';
|
||||||
import {
|
import {
|
||||||
type RowAction,
|
type RowAction,
|
||||||
@ -89,12 +94,9 @@ export default function SalesOrderLineItemTable({
|
|||||||
title: t`IPN`,
|
title: t`IPN`,
|
||||||
switchable: true
|
switchable: true
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({
|
||||||
accessor: 'part_detail.description',
|
accessor: 'part_detail.description'
|
||||||
title: t`Description`,
|
}),
|
||||||
sortable: false,
|
|
||||||
switchable: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'reference',
|
accessor: 'reference',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
|
@ -43,7 +43,7 @@ import { usePluginUIFeature } from '../../hooks/UsePluginUIFeature';
|
|||||||
import { useTable } from '../../hooks/UseTable';
|
import { useTable } from '../../hooks/UseTable';
|
||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
import { BooleanColumn } from '../ColumnRenderers';
|
import { BooleanColumn, DescriptionColumn } from '../ColumnRenderers';
|
||||||
import { InvenTreeTable } from '../InvenTreeTable';
|
import { InvenTreeTable } from '../InvenTreeTable';
|
||||||
import { type RowAction, RowDeleteAction, RowEditAction } from '../RowActions';
|
import { type RowAction, RowDeleteAction, RowEditAction } from '../RowActions';
|
||||||
|
|
||||||
@ -204,11 +204,11 @@ export function TemplateTable({
|
|||||||
sortable: true,
|
sortable: true,
|
||||||
switchable: false
|
switchable: false
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({
|
||||||
accessor: 'description',
|
accessor: 'description',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
switchable: true
|
switchable: true
|
||||||
},
|
}),
|
||||||
{
|
{
|
||||||
accessor: 'template',
|
accessor: 'template',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
import { useTable } from '../../hooks/UseTable';
|
import { useTable } from '../../hooks/UseTable';
|
||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import type { TableColumn } from '../Column';
|
import type { TableColumn } from '../Column';
|
||||||
|
import { DescriptionColumn } from '../ColumnRenderers';
|
||||||
import { InvenTreeTable } from '../InvenTreeTable';
|
import { InvenTreeTable } from '../InvenTreeTable';
|
||||||
import { type RowAction, RowDeleteAction, RowEditAction } from '../RowActions';
|
import { type RowAction, RowDeleteAction, RowEditAction } from '../RowActions';
|
||||||
|
|
||||||
@ -69,10 +70,7 @@ export default function LocationTypesTable() {
|
|||||||
title: t`Name`,
|
title: t`Name`,
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
DescriptionColumn({}),
|
||||||
accessor: 'description',
|
|
||||||
title: t`Description`
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'location_count',
|
accessor: 'location_count',
|
||||||
sortable: true
|
sortable: true
|
||||||
|
@ -185,9 +185,7 @@ export default function StockItemTestResultTable({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
DescriptionColumn({
|
DescriptionColumn({}),
|
||||||
accessor: 'description'
|
|
||||||
}),
|
|
||||||
{
|
{
|
||||||
accessor: 'value',
|
accessor: 'value',
|
||||||
title: t`Value`
|
title: t`Value`
|
||||||
|
Reference in New Issue
Block a user