Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "stock" table to "category" page #8579

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions src/frontend/src/pages/part/CategoryDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
IconCategory,
IconInfoCircle,
IconListDetails,
IconPackages,
IconSitemap
} from '@tabler/icons-react';
import { useMemo, useState } from 'react';
Expand Down Expand Up @@ -40,6 +41,7 @@ import { useUserState } from '../../states/UserState';
import ParametricPartTable from '../../tables/part/ParametricPartTable';
import { PartCategoryTable } from '../../tables/part/PartCategoryTable';
import { PartListTable } from '../../tables/part/PartTable';
import { StockItemTable } from '../../tables/stock/StockItemTable';

/**
* Detail view for a single PartCategory instance.
Expand Down Expand Up @@ -252,6 +254,12 @@ export default function CategoryDetail() {
icon: <IconInfoCircle />,
content: detailsPanel
},
{
name: 'subcategories',
label: t`Subcategories`,
icon: <IconSitemap />,
content: <PartCategoryTable parentId={id} />
},
{
name: 'parts',
label: t`Parts`,
Expand All @@ -267,10 +275,19 @@ export default function CategoryDetail() {
)
},
{
name: 'subcategories',
label: t`Part Categories`,
icon: <IconSitemap />,
content: <PartCategoryTable parentId={id} />
name: 'stockitem',
label: t`Stock Items`,
icon: <IconPackages />,
hidden: !id,
content: (
<StockItemTable
params={{
category: id
}}
allowAdd={false}
tableName='category-stockitems'
/>
)
},
{
name: 'parameters',
Expand Down
Loading