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