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;
|
tableState: TableState;
|
||||||
availableFilters: TableFilter[];
|
availableFilters: TableFilter[];
|
||||||
}) {
|
}) {
|
||||||
const filterOptions = useMemo(() => {
|
const filterOptions: TableFilterChoice[] = useMemo(() => {
|
||||||
let activeFilterNames =
|
let activeFilterNames =
|
||||||
tableState.activeFilters?.map((flt) => flt.name) ?? [];
|
tableState.activeFilters?.map((flt) => flt.name) ?? [];
|
||||||
|
|
||||||
return availableFilters
|
return (
|
||||||
.filter((flt) => !activeFilterNames.includes(flt.name))
|
availableFilters
|
||||||
.map((flt) => ({
|
?.filter((flt) => !activeFilterNames.includes(flt.name))
|
||||||
value: flt.name,
|
?.map((flt) => ({
|
||||||
label: flt.label,
|
value: flt.name,
|
||||||
description: flt.description
|
label: flt.label,
|
||||||
}));
|
description: flt.description
|
||||||
|
})) ?? []
|
||||||
|
);
|
||||||
}, [tableState.activeFilters, availableFilters]);
|
}, [tableState.activeFilters, availableFilters]);
|
||||||
|
|
||||||
const [selectedFilter, setSelectedFilter] = useState<string | null>(null);
|
const [selectedFilter, setSelectedFilter] = useState<string | null>(null);
|
||||||
|
@ -28,7 +28,7 @@ import { useTable } from '../../hooks/UseTable';
|
|||||||
import { apiUrl } from '../../states/ApiState';
|
import { apiUrl } from '../../states/ApiState';
|
||||||
import { useUserState } from '../../states/UserState';
|
import { useUserState } from '../../states/UserState';
|
||||||
import { TableColumn } from '../Column';
|
import { TableColumn } from '../Column';
|
||||||
import { DescriptionColumn, NoteColumn } from '../ColumnRenderers';
|
import { DateColumn, DescriptionColumn, NoteColumn } from '../ColumnRenderers';
|
||||||
import { TableFilter } from '../Filter';
|
import { TableFilter } from '../Filter';
|
||||||
import { InvenTreeTable } from '../InvenTreeTable';
|
import { InvenTreeTable } from '../InvenTreeTable';
|
||||||
import { RowActions, RowDeleteAction, RowEditAction } from '../RowActions';
|
import { RowActions, RowDeleteAction, RowEditAction } from '../RowActions';
|
||||||
@ -188,20 +188,13 @@ export default function StockItemTestResultTable({
|
|||||||
record.attachment && <AttachmentLink attachment={record.attachment} />
|
record.attachment && <AttachmentLink attachment={record.attachment} />
|
||||||
},
|
},
|
||||||
NoteColumn(),
|
NoteColumn(),
|
||||||
|
DateColumn({}),
|
||||||
{
|
{
|
||||||
accessor: 'date',
|
accessor: 'user',
|
||||||
sortable: true,
|
title: t`User`,
|
||||||
title: t`Date`,
|
sortable: false,
|
||||||
render: (record: any) => {
|
render: (record: any) =>
|
||||||
return (
|
record.user_detail && <RenderUser instance={record.user_detail} />
|
||||||
<Group justify="space-between">
|
|
||||||
{renderDate(record.date)}
|
|
||||||
{record.user_detail && (
|
|
||||||
<RenderUser instance={record.user_detail} />
|
|
||||||
)}
|
|
||||||
</Group>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'test_station',
|
accessor: 'test_station',
|
||||||
|
Loading…
Reference in New Issue
Block a user