From 1508152a0ae6e19331cdf85c08ab49e15d9fd82d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 25 Jun 2026 03:17:18 +0000 Subject: [PATCH] Update UI table --- src/frontend/src/forms/CommonForms.tsx | 3 ++- .../src/tables/settings/ProjectCodeTable.tsx | 22 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/forms/CommonForms.tsx b/src/frontend/src/forms/CommonForms.tsx index fc3ad49135..37108b7282 100644 --- a/src/frontend/src/forms/CommonForms.tsx +++ b/src/frontend/src/forms/CommonForms.tsx @@ -20,7 +20,8 @@ export function projectCodeFields(): ApiFormFieldSet { description: {}, responsible: { icon: - } + }, + active: {} }; } diff --git a/src/frontend/src/tables/settings/ProjectCodeTable.tsx b/src/frontend/src/tables/settings/ProjectCodeTable.tsx index d6cdddf9e8..e20e3210ed 100644 --- a/src/frontend/src/tables/settings/ProjectCodeTable.tsx +++ b/src/frontend/src/tables/settings/ProjectCodeTable.tsx @@ -11,6 +11,7 @@ import { ApiEndpoints } from '@lib/enums/ApiEndpoints'; import { UserRoles } from '@lib/enums/Roles'; import { apiUrl } from '@lib/functions/Api'; import useTable from '@lib/hooks/UseTable'; +import type { TableFilter } from '@lib/index'; import type { TableColumn } from '@lib/types/Tables'; import { projectCodeFields } from '../../forms/CommonForms'; import { @@ -19,7 +20,11 @@ import { useEditApiFormModal } from '../../hooks/UseForm'; import { useUserState } from '../../states/UserState'; -import { DescriptionColumn, ResponsibleColumn } from '../ColumnRenderers'; +import { + BooleanColumn, + DescriptionColumn, + ResponsibleColumn +} from '../ColumnRenderers'; import { InvenTreeTable } from '../InvenTreeTable'; /** @@ -37,6 +42,9 @@ export default function ProjectCodeTable() { sortable: true }, DescriptionColumn({}), + BooleanColumn({ + accessor: 'active' + }), ResponsibleColumn({}) ]; }, []); @@ -89,6 +97,17 @@ export default function ProjectCodeTable() { [user] ); + const tableFilters: TableFilter[] = useMemo(() => { + return [ + { + name: 'active', + label: t`Active`, + description: t`Show active items`, + type: 'boolean' + } + ]; + }, []); + const tableActions = useMemo(() => { return [