mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
[PUI] Test table tweaks (#7231)
* Adjust table columns * Tweak for FilterSelectDrawer
This commit is contained in:
parent
f8ef12f7bc
commit
516466bc50
@ -82,17 +82,19 @@ function FilterAddGroup({
|
||||
tableState: TableState;
|
||||
availableFilters: TableFilter[];
|
||||
}) {
|
||||
const filterOptions = useMemo(() => {
|
||||
const filterOptions: TableFilterChoice[] = useMemo(() => {
|
||||
let activeFilterNames =
|
||||
tableState.activeFilters?.map((flt) => flt.name) ?? [];
|
||||
|
||||
return availableFilters
|
||||
.filter((flt) => !activeFilterNames.includes(flt.name))
|
||||
.map((flt) => ({
|
||||
value: flt.name,
|
||||
label: flt.label,
|
||||
description: flt.description
|
||||
}));
|
||||
return (
|
||||
availableFilters
|
||||
?.filter((flt) => !activeFilterNames.includes(flt.name))
|
||||
?.map((flt) => ({
|
||||
value: flt.name,
|
||||
label: flt.label,
|
||||
description: flt.description
|
||||
})) ?? []
|
||||
);
|
||||
}, [tableState.activeFilters, availableFilters]);
|
||||
|
||||
const [selectedFilter, setSelectedFilter] = useState<string | null>(null);
|
||||
|
@ -28,7 +28,7 @@ import { useTable } from '../../hooks/UseTable';
|
||||
import { apiUrl } from '../../states/ApiState';
|
||||
import { useUserState } from '../../states/UserState';
|
||||
import { TableColumn } from '../Column';
|
||||
import { DescriptionColumn, NoteColumn } from '../ColumnRenderers';
|
||||
import { DateColumn, DescriptionColumn, NoteColumn } from '../ColumnRenderers';
|
||||
import { TableFilter } from '../Filter';
|
||||
import { InvenTreeTable } from '../InvenTreeTable';
|
||||
import { RowActions, RowDeleteAction, RowEditAction } from '../RowActions';
|
||||
@ -188,20 +188,13 @@ export default function StockItemTestResultTable({
|
||||
record.attachment && <AttachmentLink attachment={record.attachment} />
|
||||
},
|
||||
NoteColumn(),
|
||||
DateColumn({}),
|
||||
{
|
||||
accessor: 'date',
|
||||
sortable: true,
|
||||
title: t`Date`,
|
||||
render: (record: any) => {
|
||||
return (
|
||||
<Group justify="space-between">
|
||||
{renderDate(record.date)}
|
||||
{record.user_detail && (
|
||||
<RenderUser instance={record.user_detail} />
|
||||
)}
|
||||
</Group>
|
||||
);
|
||||
}
|
||||
accessor: 'user',
|
||||
title: t`User`,
|
||||
sortable: false,
|
||||
render: (record: any) =>
|
||||
record.user_detail && <RenderUser instance={record.user_detail} />
|
||||
},
|
||||
{
|
||||
accessor: 'test_station',
|
||||
|
Loading…
Reference in New Issue
Block a user