mirror of
https://github.com/inventree/InvenTree.git
synced 2026-04-12 14:28:55 +00:00
[UI] Copy cells expansion (#11410)
* Prevent copy button if copy value is null * Add "link" columns to order tables * Support copy for default column types * Tweak padding to avoid flickering issues * Refactor IPNColumn * Adjust visual styling * Copy for SKU and MPN columns * Add more copy columns * More tweaks * Tweak playwright testing * Further cleanup * More copy cols
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { t } from '@lingui/core/macro';
|
import { t } from '@lingui/core/macro';
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
|
type ActionIconVariant,
|
||||||
Button,
|
Button,
|
||||||
type DefaultMantineColor,
|
type DefaultMantineColor,
|
||||||
type FloatingPosition,
|
type FloatingPosition,
|
||||||
@@ -22,7 +23,8 @@ export function CopyButton({
|
|||||||
tooltipPosition,
|
tooltipPosition,
|
||||||
content,
|
content,
|
||||||
size,
|
size,
|
||||||
color = 'gray'
|
color = 'gray',
|
||||||
|
variant = 'transparent'
|
||||||
}: Readonly<{
|
}: Readonly<{
|
||||||
value: any;
|
value: any;
|
||||||
label?: string;
|
label?: string;
|
||||||
@@ -32,6 +34,7 @@ export function CopyButton({
|
|||||||
content?: JSX.Element;
|
content?: JSX.Element;
|
||||||
size?: MantineSize;
|
size?: MantineSize;
|
||||||
color?: DefaultMantineColor;
|
color?: DefaultMantineColor;
|
||||||
|
variant?: ActionIconVariant;
|
||||||
}>) {
|
}>) {
|
||||||
const ButtonComponent = label ? Button : ActionIcon;
|
const ButtonComponent = label ? Button : ActionIcon;
|
||||||
|
|
||||||
@@ -51,7 +54,7 @@ export function CopyButton({
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
copy();
|
copy();
|
||||||
}}
|
}}
|
||||||
variant='transparent'
|
variant={copied ? 'transparent' : (variant ?? 'transparent')}
|
||||||
size={size ?? 'sm'}
|
size={size ?? 'sm'}
|
||||||
>
|
>
|
||||||
{copied ? (
|
{copied ? (
|
||||||
|
|||||||
@@ -107,6 +107,18 @@ export function PartColumn(props: PartColumnProps): TableColumn {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function IPNColumn(props: TableColumnProps): TableColumn {
|
||||||
|
return {
|
||||||
|
accessor: 'part_detail.IPN',
|
||||||
|
sortable: true,
|
||||||
|
ordering: 'IPN',
|
||||||
|
switchable: true,
|
||||||
|
title: t`IPN`,
|
||||||
|
copyable: true,
|
||||||
|
...props
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export type StockColumnProps = TableColumnProps & {
|
export type StockColumnProps = TableColumnProps & {
|
||||||
nullMessage?: string | ReactNode;
|
nullMessage?: string | ReactNode;
|
||||||
};
|
};
|
||||||
@@ -448,6 +460,7 @@ export function DescriptionColumn(props: TableColumnProps): TableColumn {
|
|||||||
sortable: false,
|
sortable: false,
|
||||||
switchable: true,
|
switchable: true,
|
||||||
minWidth: '200px',
|
minWidth: '200px',
|
||||||
|
copyable: true,
|
||||||
...props
|
...props
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -457,6 +470,8 @@ export function LinkColumn(props: TableColumnProps): TableColumn {
|
|||||||
accessor: 'link',
|
accessor: 'link',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
defaultVisible: false,
|
defaultVisible: false,
|
||||||
|
copyable: true,
|
||||||
|
copyAccessor: props.accessor ?? 'link',
|
||||||
render: (record: any) => {
|
render: (record: any) => {
|
||||||
const url = resolveItem(record, props.accessor ?? 'link');
|
const url = resolveItem(record, props.accessor ?? 'link');
|
||||||
|
|
||||||
@@ -490,6 +505,7 @@ export function ReferenceColumn(props: TableColumnProps): TableColumn {
|
|||||||
title: t`Reference`,
|
title: t`Reference`,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
switchable: true,
|
switchable: true,
|
||||||
|
copyable: true,
|
||||||
...props
|
...props
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -664,6 +680,7 @@ export function DateColumn(props: TableColumnProps): TableColumn {
|
|||||||
formatDate(resolveItem(record, props.accessor ?? 'date'), {
|
formatDate(resolveItem(record, props.accessor ?? 'date'), {
|
||||||
showTime: props.extra?.showTime
|
showTime: props.extra?.showTime
|
||||||
}),
|
}),
|
||||||
|
copyable: true,
|
||||||
...props
|
...props
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,19 +20,30 @@ export function CopyableCell({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Group
|
<Group
|
||||||
gap='xs'
|
gap={0}
|
||||||
|
p={0}
|
||||||
wrap='nowrap'
|
wrap='nowrap'
|
||||||
onMouseEnter={() => setIsHovered(true)}
|
onMouseEnter={() => setIsHovered(true)}
|
||||||
onMouseLeave={() => setIsHovered(false)}
|
onMouseLeave={() => setIsHovered(false)}
|
||||||
justify='space-between'
|
justify='space-between'
|
||||||
|
align='center'
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
{isHovered && value != null && (
|
{isHovered && value != null && (
|
||||||
<span
|
<span
|
||||||
|
style={{ position: 'relative' }}
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
onKeyDown={(e) => e.stopPropagation()}
|
onKeyDown={(e) => e.stopPropagation()}
|
||||||
>
|
>
|
||||||
<CopyButton value={value} />
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
right: 0,
|
||||||
|
transform: 'translateY(-50%)'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CopyButton value={value} variant={'default'} />
|
||||||
|
</div>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -285,7 +285,9 @@ export function InvenTreeTable<T extends Record<string, any>>({
|
|||||||
}
|
}
|
||||||
const copyValue = rawCopyValue == null ? '' : String(rawCopyValue);
|
const copyValue = rawCopyValue == null ? '' : String(rawCopyValue);
|
||||||
|
|
||||||
return <CopyableCell value={copyValue}>{content}</CopyableCell>;
|
if (!!copyValue) {
|
||||||
|
return <CopyableCell value={copyValue}>{content}</CopyableCell>;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import {
|
|||||||
BooleanColumn,
|
BooleanColumn,
|
||||||
CategoryColumn,
|
CategoryColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
NoteColumn,
|
NoteColumn,
|
||||||
ReferenceColumn
|
ReferenceColumn
|
||||||
} from '../ColumnRenderers';
|
} from '../ColumnRenderers';
|
||||||
@@ -129,12 +130,9 @@ export function BomTable({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
IPNColumn({
|
||||||
accessor: 'sub_part_detail.IPN',
|
accessor: 'sub_part_detail.IPN'
|
||||||
title: t`IPN`,
|
}),
|
||||||
sortable: true,
|
|
||||||
ordering: 'IPN'
|
|
||||||
},
|
|
||||||
CategoryColumn({
|
CategoryColumn({
|
||||||
accessor: 'category_detail',
|
accessor: 'category_detail',
|
||||||
defaultVisible: false,
|
defaultVisible: false,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { useTable } from '../../hooks/UseTable';
|
|||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import {
|
import {
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
ReferenceColumn
|
ReferenceColumn
|
||||||
} from '../ColumnRenderers';
|
} from '../ColumnRenderers';
|
||||||
@@ -40,11 +41,9 @@ export function UsedInTable({
|
|||||||
title: t`Assembly`,
|
title: t`Assembly`,
|
||||||
part: 'part_detail'
|
part: 'part_detail'
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({
|
||||||
accessor: 'part_detail.IPN',
|
sortable: false
|
||||||
sortable: false,
|
}),
|
||||||
title: t`IPN`
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'part_detail.revision',
|
accessor: 'part_detail.revision',
|
||||||
title: t`Revision`,
|
title: t`Revision`,
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import { useTable } from '../../hooks/UseTable';
|
|||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import {
|
import {
|
||||||
DecimalColumn,
|
DecimalColumn,
|
||||||
|
IPNColumn,
|
||||||
LocationColumn,
|
LocationColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
ReferenceColumn,
|
ReferenceColumn,
|
||||||
@@ -99,14 +100,9 @@ export default function BuildAllocatedStockTable({
|
|||||||
hidden: !showPartInfo,
|
hidden: !showPartInfo,
|
||||||
switchable: false
|
switchable: false
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({
|
||||||
accessor: 'part_detail.IPN',
|
hidden: !showPartInfo
|
||||||
ordering: 'IPN',
|
}),
|
||||||
hidden: !showPartInfo,
|
|
||||||
title: t`IPN`,
|
|
||||||
sortable: true,
|
|
||||||
switchable: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
hidden: !showPartInfo,
|
hidden: !showPartInfo,
|
||||||
accessor: 'bom_reference',
|
accessor: 'bom_reference',
|
||||||
@@ -119,7 +115,9 @@ export default function BuildAllocatedStockTable({
|
|||||||
title: t`Batch Code`,
|
title: t`Batch Code`,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
switchable: true,
|
switchable: true,
|
||||||
render: (record: any) => record?.stock_item_detail?.batch
|
render: (record: any) => record?.stock_item_detail?.batch,
|
||||||
|
copyable: true,
|
||||||
|
copyAccessor: 'stock_item_detail.batch'
|
||||||
},
|
},
|
||||||
DecimalColumn({
|
DecimalColumn({
|
||||||
accessor: 'stock_item_detail.quantity',
|
accessor: 'stock_item_detail.quantity',
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import {
|
|||||||
CategoryColumn,
|
CategoryColumn,
|
||||||
DecimalColumn,
|
DecimalColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
LocationColumn,
|
LocationColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
RenderPartColumn
|
RenderPartColumn
|
||||||
@@ -91,7 +92,9 @@ export function BuildLineSubTable({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'stock_item_detail.batch',
|
accessor: 'stock_item_detail.batch',
|
||||||
title: t`Batch`
|
title: t`Batch`,
|
||||||
|
copyable: true,
|
||||||
|
copyAccessor: 'stock_item_detail.batch'
|
||||||
},
|
},
|
||||||
LocationColumn({
|
LocationColumn({
|
||||||
accessor: 'location_detail'
|
accessor: 'location_detail'
|
||||||
@@ -332,12 +335,7 @@ export default function BuildLineTable({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({}),
|
||||||
accessor: 'part_detail.IPN',
|
|
||||||
sortable: true,
|
|
||||||
ordering: 'IPN',
|
|
||||||
title: t`IPN`
|
|
||||||
},
|
|
||||||
CategoryColumn({
|
CategoryColumn({
|
||||||
accessor: 'category_detail',
|
accessor: 'category_detail',
|
||||||
defaultVisible: false,
|
defaultVisible: false,
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import {
|
|||||||
CreationDateColumn,
|
CreationDateColumn,
|
||||||
DateColumn,
|
DateColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
|
LinkColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
ProjectCodeColumn,
|
ProjectCodeColumn,
|
||||||
ReferenceColumn,
|
ReferenceColumn,
|
||||||
@@ -79,13 +81,7 @@ export function BuildOrderTable({
|
|||||||
PartColumn({
|
PartColumn({
|
||||||
switchable: false
|
switchable: false
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({}),
|
||||||
accessor: 'part_detail.IPN',
|
|
||||||
sortable: true,
|
|
||||||
ordering: 'IPN',
|
|
||||||
switchable: true,
|
|
||||||
title: t`IPN`
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'part_detail.revision',
|
accessor: 'part_detail.revision',
|
||||||
title: t`Revision`,
|
title: t`Revision`,
|
||||||
@@ -150,7 +146,8 @@ export function BuildOrderTable({
|
|||||||
ordering: 'issued_by',
|
ordering: 'issued_by',
|
||||||
title: t`Issued By`
|
title: t`Issued By`
|
||||||
}),
|
}),
|
||||||
ResponsibleColumn({})
|
ResponsibleColumn({}),
|
||||||
|
LinkColumn({})
|
||||||
];
|
];
|
||||||
}, [parentBuildId, globalSettings]);
|
}, [parentBuildId, globalSettings]);
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import { useTable } from '../../hooks/UseTable';
|
|||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import {
|
import {
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
ProjectCodeColumn,
|
ProjectCodeColumn,
|
||||||
StatusColumn
|
StatusColumn
|
||||||
@@ -56,10 +57,7 @@ export default function PartSalesAllocationsTable({
|
|||||||
PartColumn({
|
PartColumn({
|
||||||
part: 'part_detail'
|
part: 'part_detail'
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({}),
|
||||||
accessor: 'part_detail.IPN',
|
|
||||||
title: t`IPN`
|
|
||||||
},
|
|
||||||
ProjectCodeColumn({
|
ProjectCodeColumn({
|
||||||
accessor: 'order_detail.project_code_detail'
|
accessor: 'order_detail.project_code_detail'
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import {
|
|||||||
CategoryColumn,
|
CategoryColumn,
|
||||||
DefaultLocationColumn,
|
DefaultLocationColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
LinkColumn,
|
LinkColumn,
|
||||||
PartColumn
|
PartColumn
|
||||||
} from '../ColumnRenderers';
|
} from '../ColumnRenderers';
|
||||||
@@ -56,17 +57,17 @@ function partTableColumns(): TableColumn[] {
|
|||||||
part: '',
|
part: '',
|
||||||
accessor: 'name'
|
accessor: 'name'
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({
|
||||||
accessor: 'IPN',
|
accessor: 'IPN'
|
||||||
sortable: true
|
}),
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'revision',
|
accessor: 'revision',
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'units',
|
accessor: 'units',
|
||||||
sortable: true
|
sortable: true,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
DescriptionColumn({}),
|
DescriptionColumn({}),
|
||||||
CategoryColumn({
|
CategoryColumn({
|
||||||
|
|||||||
@@ -288,7 +288,8 @@ export default function PartTestResultTable({
|
|||||||
accessor: 'batch',
|
accessor: 'batch',
|
||||||
title: t`Batch Code`,
|
title: t`Batch Code`,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
switchable: true
|
switchable: true,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
LocationColumn({
|
LocationColumn({
|
||||||
accessor: 'location_detail'
|
accessor: 'location_detail'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { TableFilter } from '@lib/types/Filters';
|
|||||||
import type { TableColumn } from '@lib/types/Tables';
|
import type { TableColumn } from '@lib/types/Tables';
|
||||||
import { t } from '@lingui/core/macro';
|
import { t } from '@lingui/core/macro';
|
||||||
import { type ReactNode, useMemo } from 'react';
|
import { type ReactNode, useMemo } from 'react';
|
||||||
import { CompanyColumn, PartColumn } from '../ColumnRenderers';
|
import { CompanyColumn, IPNColumn, PartColumn } from '../ColumnRenderers';
|
||||||
import ParametricDataTable from '../general/ParametricDataTable';
|
import ParametricDataTable from '../general/ParametricDataTable';
|
||||||
|
|
||||||
export default function ManufacturerPartParametricTable({
|
export default function ManufacturerPartParametricTable({
|
||||||
@@ -16,12 +16,9 @@ export default function ManufacturerPartParametricTable({
|
|||||||
PartColumn({
|
PartColumn({
|
||||||
switchable: false
|
switchable: false
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({
|
||||||
accessor: 'part_detail.IPN',
|
sortable: false
|
||||||
title: t`IPN`,
|
}),
|
||||||
sortable: false,
|
|
||||||
switchable: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'manufacturer',
|
accessor: 'manufacturer',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
@@ -32,7 +29,8 @@ export default function ManufacturerPartParametricTable({
|
|||||||
{
|
{
|
||||||
accessor: 'MPN',
|
accessor: 'MPN',
|
||||||
title: t`MPN`,
|
title: t`MPN`,
|
||||||
sortable: true
|
sortable: true,
|
||||||
|
copyable: true
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { useUserState } from '../../states/UserState';
|
|||||||
import {
|
import {
|
||||||
CompanyColumn,
|
CompanyColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
LinkColumn,
|
LinkColumn,
|
||||||
PartColumn
|
PartColumn
|
||||||
} from '../ColumnRenderers';
|
} from '../ColumnRenderers';
|
||||||
@@ -86,13 +87,7 @@ export function ManufacturerPartTable({
|
|||||||
PartColumn({
|
PartColumn({
|
||||||
switchable: !!partId
|
switchable: !!partId
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({}),
|
||||||
accessor: 'part_detail.IPN',
|
|
||||||
title: t`IPN`,
|
|
||||||
sortable: true,
|
|
||||||
ordering: 'IPN',
|
|
||||||
switchable: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'manufacturer',
|
accessor: 'manufacturer',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
@@ -103,7 +98,8 @@ export function ManufacturerPartTable({
|
|||||||
{
|
{
|
||||||
accessor: 'MPN',
|
accessor: 'MPN',
|
||||||
title: t`MPN`,
|
title: t`MPN`,
|
||||||
sortable: true
|
sortable: true,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
DescriptionColumn({}),
|
DescriptionColumn({}),
|
||||||
LinkColumn({})
|
LinkColumn({})
|
||||||
|
|||||||
@@ -251,7 +251,8 @@ export function PurchaseOrderLineItemTable({
|
|||||||
ordering: 'MPN',
|
ordering: 'MPN',
|
||||||
title: t`Manufacturer Code`,
|
title: t`Manufacturer Code`,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
defaultVisible: false
|
defaultVisible: false,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
CurrencyColumn({
|
CurrencyColumn({
|
||||||
accessor: 'purchase_price',
|
accessor: 'purchase_price',
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
CreationDateColumn,
|
CreationDateColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
LineItemsProgressColumn,
|
LineItemsProgressColumn,
|
||||||
|
LinkColumn,
|
||||||
ProjectCodeColumn,
|
ProjectCodeColumn,
|
||||||
ReferenceColumn,
|
ReferenceColumn,
|
||||||
ResponsibleColumn,
|
ResponsibleColumn,
|
||||||
@@ -120,7 +121,8 @@ export function PurchaseOrderTable({
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'supplier_reference'
|
accessor: 'supplier_reference',
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
LineItemsProgressColumn({}),
|
LineItemsProgressColumn({}),
|
||||||
StatusColumn({ model: ModelType.purchaseorder }),
|
StatusColumn({ model: ModelType.purchaseorder }),
|
||||||
@@ -150,7 +152,8 @@ export function PurchaseOrderTable({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ResponsibleColumn({})
|
ResponsibleColumn({}),
|
||||||
|
LinkColumn({})
|
||||||
];
|
];
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ export default function SupplierPartParametricTable({
|
|||||||
{
|
{
|
||||||
accessor: 'SKU',
|
accessor: 'SKU',
|
||||||
title: t`Supplier Part`,
|
title: t`Supplier Part`,
|
||||||
sortable: true
|
sortable: true,
|
||||||
|
copyable: true
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import {
|
|||||||
CompanyColumn,
|
CompanyColumn,
|
||||||
DecimalColumn,
|
DecimalColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
LinkColumn,
|
LinkColumn,
|
||||||
NoteColumn,
|
NoteColumn,
|
||||||
PartColumn
|
PartColumn
|
||||||
@@ -92,13 +93,7 @@ export function SupplierPartTable({
|
|||||||
switchable: !!partId,
|
switchable: !!partId,
|
||||||
part: 'part_detail'
|
part: 'part_detail'
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({}),
|
||||||
accessor: 'part_detail.IPN',
|
|
||||||
title: t`IPN`,
|
|
||||||
sortable: true,
|
|
||||||
ordering: 'IPN',
|
|
||||||
switchable: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'supplier',
|
accessor: 'supplier',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
@@ -109,7 +104,8 @@ export function SupplierPartTable({
|
|||||||
{
|
{
|
||||||
accessor: 'SKU',
|
accessor: 'SKU',
|
||||||
title: t`Supplier Part`,
|
title: t`Supplier Part`,
|
||||||
sortable: true
|
sortable: true,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
DescriptionColumn({}),
|
DescriptionColumn({}),
|
||||||
{
|
{
|
||||||
@@ -124,7 +120,9 @@ export function SupplierPartTable({
|
|||||||
accessor: 'MPN',
|
accessor: 'MPN',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
title: t`MPN`,
|
title: t`MPN`,
|
||||||
render: (record: any) => record?.manufacturer_part_detail?.MPN
|
render: (record: any) => record?.manufacturer_part_detail?.MPN,
|
||||||
|
copyable: true,
|
||||||
|
copyAccessor: 'manufacturer_part_detail.MPN'
|
||||||
},
|
},
|
||||||
BooleanColumn({
|
BooleanColumn({
|
||||||
accessor: 'primary',
|
accessor: 'primary',
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
CreationDateColumn,
|
CreationDateColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
LineItemsProgressColumn,
|
LineItemsProgressColumn,
|
||||||
|
LinkColumn,
|
||||||
ProjectCodeColumn,
|
ProjectCodeColumn,
|
||||||
ReferenceColumn,
|
ReferenceColumn,
|
||||||
ResponsibleColumn,
|
ResponsibleColumn,
|
||||||
@@ -123,7 +124,8 @@ export function ReturnOrderTable({
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'customer_reference'
|
accessor: 'customer_reference',
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
DescriptionColumn({}),
|
DescriptionColumn({}),
|
||||||
LineItemsProgressColumn({}),
|
LineItemsProgressColumn({}),
|
||||||
@@ -154,7 +156,8 @@ export function ReturnOrderTable({
|
|||||||
currency: record.order_currency || record.customer_detail?.currency
|
currency: record.order_currency || record.customer_detail?.currency
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
LinkColumn({})
|
||||||
];
|
];
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import { useTable } from '../../hooks/UseTable';
|
|||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import {
|
import {
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
LocationColumn,
|
LocationColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
ReferenceColumn,
|
ReferenceColumn,
|
||||||
@@ -130,13 +131,9 @@ export default function SalesOrderAllocationTable({
|
|||||||
accessor: 'part_detail.description',
|
accessor: 'part_detail.description',
|
||||||
hidden: showPartInfo != true
|
hidden: showPartInfo != true
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({
|
||||||
accessor: 'part_detail.IPN',
|
hidden: showPartInfo != true
|
||||||
title: t`IPN`,
|
}),
|
||||||
hidden: showPartInfo != true,
|
|
||||||
sortable: true,
|
|
||||||
ordering: 'IPN'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'serial',
|
accessor: 'serial',
|
||||||
title: t`Serial Number`,
|
title: t`Serial Number`,
|
||||||
@@ -149,7 +146,9 @@ export default function SalesOrderAllocationTable({
|
|||||||
title: t`Batch Code`,
|
title: t`Batch Code`,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
switchable: true,
|
switchable: true,
|
||||||
render: (record: any) => record?.item_detail?.batch
|
render: (record: any) => record?.item_detail?.batch,
|
||||||
|
copyable: true,
|
||||||
|
copyAccessor: 'item_detail.batch'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'available',
|
accessor: 'available',
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import {
|
|||||||
DateColumn,
|
DateColumn,
|
||||||
DecimalColumn,
|
DecimalColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
LinkColumn,
|
LinkColumn,
|
||||||
ProjectCodeColumn,
|
ProjectCodeColumn,
|
||||||
RenderPartColumn
|
RenderPartColumn
|
||||||
@@ -94,13 +95,7 @@ export default function SalesOrderLineItemTable({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
IPNColumn({}),
|
||||||
accessor: 'part_detail.IPN',
|
|
||||||
title: t`IPN`,
|
|
||||||
sortable: true,
|
|
||||||
ordering: 'IPN',
|
|
||||||
switchable: true
|
|
||||||
},
|
|
||||||
DescriptionColumn({
|
DescriptionColumn({
|
||||||
accessor: 'part_detail.description'
|
accessor: 'part_detail.description'
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -142,7 +142,8 @@ export default function SalesOrderShipmentTable({
|
|||||||
accessor: 'order_detail.reference',
|
accessor: 'order_detail.reference',
|
||||||
title: t`Sales Order`,
|
title: t`Sales Order`,
|
||||||
hidden: !showOrderInfo,
|
hidden: !showOrderInfo,
|
||||||
sortable: false
|
sortable: false,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
StatusColumn({
|
StatusColumn({
|
||||||
switchable: true,
|
switchable: true,
|
||||||
@@ -155,7 +156,8 @@ export default function SalesOrderShipmentTable({
|
|||||||
accessor: 'reference',
|
accessor: 'reference',
|
||||||
title: t`Shipment Reference`,
|
title: t`Shipment Reference`,
|
||||||
switchable: false,
|
switchable: false,
|
||||||
sortable: true
|
sortable: true,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'allocated_items',
|
accessor: 'allocated_items',
|
||||||
@@ -193,14 +195,14 @@ export default function SalesOrderShipmentTable({
|
|||||||
title: t`Delivery Date`
|
title: t`Delivery Date`
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
accessor: 'tracking_number'
|
accessor: 'tracking_number',
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'invoice_number'
|
accessor: 'invoice_number',
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
LinkColumn({
|
LinkColumn({})
|
||||||
accessor: 'link'
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
}, [showOrderInfo]);
|
}, [showOrderInfo]);
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import {
|
|||||||
CreationDateColumn,
|
CreationDateColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
LineItemsProgressColumn,
|
LineItemsProgressColumn,
|
||||||
|
LinkColumn,
|
||||||
ProjectCodeColumn,
|
ProjectCodeColumn,
|
||||||
ReferenceColumn,
|
ReferenceColumn,
|
||||||
ResponsibleColumn,
|
ResponsibleColumn,
|
||||||
@@ -146,7 +147,8 @@ export function SalesOrderTable({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'customer_reference',
|
accessor: 'customer_reference',
|
||||||
title: t`Customer Reference`
|
title: t`Customer Reference`,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
DescriptionColumn({}),
|
DescriptionColumn({}),
|
||||||
LineItemsProgressColumn({}),
|
LineItemsProgressColumn({}),
|
||||||
@@ -190,7 +192,8 @@ export function SalesOrderTable({
|
|||||||
currency: record.order_currency || record.customer_detail?.currency
|
currency: record.order_currency || record.customer_detail?.currency
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
LinkColumn({})
|
||||||
];
|
];
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import { useUserState } from '../../states/UserState';
|
|||||||
import {
|
import {
|
||||||
DateColumn,
|
DateColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
LocationColumn,
|
LocationColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
StatusColumn,
|
StatusColumn,
|
||||||
@@ -59,12 +60,7 @@ function stockItemTableColumns({
|
|||||||
accessor: 'part',
|
accessor: 'part',
|
||||||
part: 'part_detail'
|
part: 'part_detail'
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({}),
|
||||||
accessor: 'part_detail.IPN',
|
|
||||||
title: t`IPN`,
|
|
||||||
sortable: true,
|
|
||||||
ordering: 'IPN'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
accessor: 'part_detail.revision',
|
accessor: 'part_detail.revision',
|
||||||
title: t`Revision`,
|
title: t`Revision`,
|
||||||
@@ -83,7 +79,8 @@ function stockItemTableColumns({
|
|||||||
StatusColumn({ model: ModelType.stockitem }),
|
StatusColumn({ model: ModelType.stockitem }),
|
||||||
{
|
{
|
||||||
accessor: 'batch',
|
accessor: 'batch',
|
||||||
sortable: true
|
sortable: true,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
LocationColumn({
|
LocationColumn({
|
||||||
hidden: !showLocation,
|
hidden: !showLocation,
|
||||||
@@ -101,13 +98,15 @@ function stockItemTableColumns({
|
|||||||
accessor: 'SKU',
|
accessor: 'SKU',
|
||||||
title: t`Supplier Part`,
|
title: t`Supplier Part`,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
defaultVisible: false
|
defaultVisible: false,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'MPN',
|
accessor: 'MPN',
|
||||||
title: t`Manufacturer Part`,
|
title: t`Manufacturer Part`,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
defaultVisible: false
|
defaultVisible: false,
|
||||||
|
copyable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'purchase_price',
|
accessor: 'purchase_price',
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import { useTable } from '../../hooks/UseTable';
|
|||||||
import {
|
import {
|
||||||
DateColumn,
|
DateColumn,
|
||||||
DescriptionColumn,
|
DescriptionColumn,
|
||||||
|
IPNColumn,
|
||||||
PartColumn,
|
PartColumn,
|
||||||
StockColumn
|
StockColumn
|
||||||
} from '../ColumnRenderers';
|
} from '../ColumnRenderers';
|
||||||
@@ -238,14 +239,10 @@ export function StockTrackingTable({
|
|||||||
switchable: true,
|
switchable: true,
|
||||||
hidden: !partId
|
hidden: !partId
|
||||||
}),
|
}),
|
||||||
{
|
IPNColumn({
|
||||||
title: t`IPN`,
|
|
||||||
accessor: 'part_detail.IPN',
|
|
||||||
sortable: true,
|
|
||||||
defaultVisible: false,
|
defaultVisible: false,
|
||||||
switchable: true,
|
|
||||||
hidden: !partId
|
hidden: !partId
|
||||||
},
|
}),
|
||||||
StockColumn({
|
StockColumn({
|
||||||
title: t`Stock Item`,
|
title: t`Stock Item`,
|
||||||
accessor: 'item_detail',
|
accessor: 'item_detail',
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ test('Purchasing - Index', async ({ browser }) => {
|
|||||||
|
|
||||||
// Clearing the filters, more orders should be visible
|
// Clearing the filters, more orders should be visible
|
||||||
await clearTableFilters(page);
|
await clearTableFilters(page);
|
||||||
await page.getByText(/1 - 1\d \/ 1\d/).waitFor();
|
await page.getByText(/1 - \d\d \/ \d\d/).waitFor();
|
||||||
|
|
||||||
// Suppliers tab
|
// Suppliers tab
|
||||||
await loadTab(page, 'Suppliers');
|
await loadTab(page, 'Suppliers');
|
||||||
@@ -49,9 +49,11 @@ test('Purchasing - Index', async ({ browser }) => {
|
|||||||
|
|
||||||
// Check for expected values
|
// Check for expected values
|
||||||
await clearTableFilters(page);
|
await clearTableFilters(page);
|
||||||
|
await page
|
||||||
|
.getByRole('textbox', { name: 'table-search-input' })
|
||||||
|
.fill('R_100K_0402');
|
||||||
await page.getByText('R_100K_0402_1%').first().waitFor();
|
await page.getByText('R_100K_0402_1%').first().waitFor();
|
||||||
await page.getByRole('cell', { name: 'RR05P100KDTR-ND' }).first().waitFor();
|
await page.getByRole('cell', { name: 'RR05P100KDTR-ND' }).first().waitFor();
|
||||||
await page.getByRole('cell', { name: 'RT0402BRD07100KL' }).first().waitFor();
|
|
||||||
|
|
||||||
// Manufacturers tab
|
// Manufacturers tab
|
||||||
await loadTab(page, 'Manufacturers');
|
await loadTab(page, 'Manufacturers');
|
||||||
|
|||||||
Reference in New Issue
Block a user