2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

Slight tweak to <DetailsTable> (#8890)

* Slight tweak to <DetailsTable>

* Responsive layout for user settings

* Make menu links responsive

* Update <FactCollection />

* Update part pricing panels
This commit is contained in:
Oliver 2025-01-14 13:42:03 +11:00 committed by GitHub
parent 46f6450ee1
commit 412bba50ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 37 additions and 19 deletions

View File

@ -378,17 +378,22 @@ export function DetailsTableField({
return ( return (
<Table.Tr style={{ verticalAlign: 'top' }}> <Table.Tr style={{ verticalAlign: 'top' }}>
<Table.Td style={{ minWidth: 75, lineBreak: 'auto', flex: 2 }}>
<Group gap='xs' wrap='nowrap'>
<InvenTreeIcon
icon={field.icon ?? (field.name as InvenTreeIconType)}
/>
<Text style={{ paddingLeft: 10 }}>{field.label}</Text>
</Group>
</Table.Td>
<Table.Td <Table.Td
style={{ style={{
maxWidth: '50' lineBreak: 'anywhere',
minWidth: 100,
flex: 10,
display: 'inline-block'
}} }}
> >
<InvenTreeIcon icon={field.icon ?? (field.name as InvenTreeIconType)} />
</Table.Td>
<Table.Td style={{ minWidth: 75, lineBreak: 'auto', flex: 2 }}>
<Text>{field.label}</Text>
</Table.Td>
<Table.Td style={{ lineBreak: 'anywhere', minWidth: 100, flex: 10 }}>
<FieldType field_data={field} field_value={fieldValue} /> <FieldType field_data={field} field_value={fieldValue} />
</Table.Td> </Table.Td>
<Table.Td style={{ width: '50' }}> <Table.Td style={{ width: '50' }}>

View File

@ -53,7 +53,12 @@ export function MenuLinks({
<Divider /> <Divider />
<StylishText size='md'>{title}</StylishText> <StylishText size='md'>{title}</StylishText>
<Divider /> <Divider />
<SimpleGrid cols={2} spacing={0} p={3}> <SimpleGrid
cols={{ base: 1, '400px': 2 }}
type='container'
spacing={0}
p={3}
>
{visibleLinks.map((item) => ( {visibleLinks.map((item) => (
<Tooltip <Tooltip
key={`menu-link-tooltip-${item.id}`} key={`menu-link-tooltip-${item.id}`}

View File

@ -10,7 +10,15 @@ export function FactCollection({
minItems?: number; minItems?: number;
}>) { }>) {
return ( return (
<SimpleGrid cols={minItems} spacing='xs'> <SimpleGrid
cols={{
base: 1,
sm: Math.min(2, minItems),
md: Math.min(3, minItems),
lg: minItems
}}
spacing='xs'
>
{items.map((item, index) => ( {items.map((item, index) => (
<FactItem <FactItem
key={`${index}-${item.value}`} key={`${index}-${item.value}`}

View File

@ -9,7 +9,7 @@ export function AccountContent() {
return ( return (
<div> <div>
<SimpleGrid cols={2} spacing='md'> <SimpleGrid cols={{ base: 1, md: 2 }} spacing='md'>
<Container w='100%'> <Container w='100%'>
<AccountDetailPanel /> <AccountDetailPanel />
</Container> </Container>

View File

@ -243,7 +243,7 @@ export default function PartSchedulingDetail({
<Text>{t`There is no scheduling information available for the selected part`}</Text> <Text>{t`There is no scheduling information available for the selected part`}</Text>
</Alert> </Alert>
)} )}
<SimpleGrid cols={2}> <SimpleGrid cols={{ base: 1, md: 2 }}>
<InvenTreeTable <InvenTreeTable
url={apiUrl(ApiEndpoints.part_scheduling, part.pk)} url={apiUrl(ApiEndpoints.part_scheduling, part.pk)}
tableState={table} tableState={table}

View File

@ -209,7 +209,7 @@ export default function PartStocktakeDetail({
{generateReport.modal} {generateReport.modal}
{editStocktakeEntry.modal} {editStocktakeEntry.modal}
{deleteStocktakeEntry.modal} {deleteStocktakeEntry.modal}
<SimpleGrid cols={2}> <SimpleGrid cols={{ base: 1, md: 2 }}>
<InvenTreeTable <InvenTreeTable
url={apiUrl(ApiEndpoints.part_stocktake_list)} url={apiUrl(ApiEndpoints.part_stocktake_list)}
tableState={table} tableState={table}

View File

@ -219,7 +219,7 @@ export default function BomPricingPanel({
return ( return (
<Stack gap='xs'> <Stack gap='xs'>
<SimpleGrid cols={2}> <SimpleGrid cols={{ base: 1, md: 2 }}>
<InvenTreeTable <InvenTreeTable
tableState={table} tableState={table}
url={apiUrl(ApiEndpoints.bom_list)} url={apiUrl(ApiEndpoints.bom_list)}

View File

@ -151,7 +151,7 @@ export default function PriceBreakPanel({
{newPriceBreak.modal} {newPriceBreak.modal}
{editPriceBreak.modal} {editPriceBreak.modal}
{deletePriceBreak.modal} {deletePriceBreak.modal}
<SimpleGrid cols={2}> <SimpleGrid cols={{ base: 1, md: 2 }}>
<InvenTreeTable <InvenTreeTable
tableState={table} tableState={table}
url={tableUrl} url={tableUrl}

View File

@ -240,7 +240,7 @@ export default function PricingOverviewPanel({
<> <>
{editPricing.modal} {editPricing.modal}
<Stack gap='xs'> <Stack gap='xs'>
<SimpleGrid cols={2}> <SimpleGrid cols={{ base: 1, md: 2 }}>
<Stack gap='xs'> <Stack gap='xs'>
<Paper p='xs'> <Paper p='xs'>
<Group justify='space-between' wrap='nowrap'> <Group justify='space-between' wrap='nowrap'>

View File

@ -103,7 +103,7 @@ export default function PurchaseHistoryPanel({
}, [table.records]); }, [table.records]);
return ( return (
<SimpleGrid cols={2}> <SimpleGrid cols={{ base: 1, md: 2 }}>
<InvenTreeTable <InvenTreeTable
tableState={table} tableState={table}
url={apiUrl(ApiEndpoints.purchase_order_line_list)} url={apiUrl(ApiEndpoints.purchase_order_line_list)}

View File

@ -63,7 +63,7 @@ export default function SaleHistoryPanel({
}, [table.records]); }, [table.records]);
return ( return (
<SimpleGrid cols={2}> <SimpleGrid cols={{ base: 1, md: 2 }}>
<InvenTreeTable <InvenTreeTable
tableState={table} tableState={table}
url={apiUrl(ApiEndpoints.sales_order_line_list)} url={apiUrl(ApiEndpoints.sales_order_line_list)}

View File

@ -45,7 +45,7 @@ export default function SupplierPricingPanel({
}, [table.records]); }, [table.records]);
return ( return (
<SimpleGrid cols={2}> <SimpleGrid cols={{ base: 1, md: 2 }}>
<InvenTreeTable <InvenTreeTable
url={apiUrl(ApiEndpoints.supplier_part_pricing_list)} url={apiUrl(ApiEndpoints.supplier_part_pricing_list)}
columns={columns} columns={columns}

View File

@ -73,7 +73,7 @@ export default function VariantPricingPanel({
return ( return (
<Stack gap='xs'> <Stack gap='xs'>
<SimpleGrid cols={2}> <SimpleGrid cols={{ base: 1, md: 2 }}>
<InvenTreeTable <InvenTreeTable
tableState={table} tableState={table}
url={apiUrl(ApiEndpoints.part_list)} url={apiUrl(ApiEndpoints.part_list)}