mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Panel placeholders (#7405)
* PanelType.content is now required * Make panel content non-optional - Makes it easier to see which panels still need to be implemented * Implement a panel
This commit is contained in:
parent
6b11c940bb
commit
8f3a8b0f7e
@ -24,7 +24,6 @@ import { identifierString } from '../../functions/conversion';
|
||||
import { navigateToLink } from '../../functions/navigation';
|
||||
import { useLocalState } from '../../states/LocalState';
|
||||
import { Boundary } from '../Boundary';
|
||||
import { PlaceholderPanel } from '../items/Placeholder';
|
||||
import { StylishText } from '../items/StylishText';
|
||||
|
||||
/**
|
||||
@ -34,7 +33,7 @@ export type PanelType = {
|
||||
name: string;
|
||||
label: string;
|
||||
icon?: ReactNode;
|
||||
content?: ReactNode;
|
||||
content: ReactNode;
|
||||
hidden?: boolean;
|
||||
disabled?: boolean;
|
||||
showHeadline?: boolean;
|
||||
@ -190,7 +189,7 @@ function BasePanelGroup({
|
||||
</>
|
||||
)}
|
||||
<Boundary label={`PanelContent-${panel.name}`}>
|
||||
{panel.content ?? <PlaceholderPanel />}
|
||||
{panel.content}
|
||||
</Boundary>
|
||||
</Stack>
|
||||
</Tabs.Panel>
|
||||
|
@ -19,6 +19,7 @@ import {
|
||||
} from '@tabler/icons-react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { PlaceholderPanel } from '../../../components/items/Placeholder';
|
||||
import { PanelGroup, PanelType } from '../../../components/nav/PanelGroup';
|
||||
import { SettingsHeader } from '../../../components/nav/SettingsHeader';
|
||||
import { GlobalSettingList } from '../../../components/settings/SettingList';
|
||||
@ -98,7 +99,8 @@ export default function SystemSettings() {
|
||||
{
|
||||
name: 'notifications',
|
||||
label: t`Notifications`,
|
||||
icon: <IconBellCog />
|
||||
icon: <IconBellCog />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'pricing',
|
||||
@ -161,7 +163,8 @@ export default function SystemSettings() {
|
||||
{
|
||||
name: 'categories',
|
||||
label: t`Part Categories`,
|
||||
icon: <IconSitemap />
|
||||
icon: <IconSitemap />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'parts',
|
||||
@ -223,7 +226,8 @@ export default function SystemSettings() {
|
||||
{
|
||||
name: 'stocktake',
|
||||
label: t`Stocktake`,
|
||||
icon: <IconClipboardCheck />
|
||||
icon: <IconClipboardCheck />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'buildorders',
|
||||
|
@ -11,6 +11,7 @@ import {
|
||||
} from '@tabler/icons-react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { PlaceholderPanel } from '../../../components/items/Placeholder';
|
||||
import { PanelGroup, PanelType } from '../../../components/nav/PanelGroup';
|
||||
import { SettingsHeader } from '../../../components/nav/SettingsHeader';
|
||||
import { UserSettingList } from '../../../components/settings/SettingList';
|
||||
@ -39,7 +40,8 @@ export default function UserSettings() {
|
||||
{
|
||||
name: 'dashboard',
|
||||
label: t`Dashboard`,
|
||||
icon: <IconDeviceDesktopAnalytics />
|
||||
icon: <IconDeviceDesktopAnalytics />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'display',
|
||||
@ -92,7 +94,8 @@ export default function UserSettings() {
|
||||
{
|
||||
name: 'notifications',
|
||||
label: t`Notifications`,
|
||||
icon: <IconBellCog />
|
||||
icon: <IconBellCog />,
|
||||
content: <UserSettingList keys={['NOTIFICATION_ERROR_REPORT']} />
|
||||
},
|
||||
{
|
||||
name: 'reporting',
|
||||
|
@ -53,6 +53,7 @@ import {
|
||||
UnlinkBarcodeAction,
|
||||
ViewBarcodeAction
|
||||
} from '../../components/items/ActionDropdown';
|
||||
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
||||
import NavigationTree from '../../components/nav/NavigationTree';
|
||||
import { PageDetail } from '../../components/nav/PageDetail';
|
||||
import { PanelGroup, PanelType } from '../../components/nav/PanelGroup';
|
||||
@ -513,7 +514,8 @@ export default function PartDetail() {
|
||||
name: 'allocations',
|
||||
label: t`Allocations`,
|
||||
icon: <IconBookmarks />,
|
||||
hidden: !part.component && !part.salable
|
||||
hidden: !part.component && !part.salable,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'bom',
|
||||
@ -572,7 +574,8 @@ export default function PartDetail() {
|
||||
name: 'purchase_orders',
|
||||
label: t`Purchase Orders`,
|
||||
icon: <IconShoppingCart />,
|
||||
hidden: !part.purchaseable
|
||||
hidden: !part.purchaseable,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'sales_orders',
|
||||
@ -584,12 +587,14 @@ export default function PartDetail() {
|
||||
{
|
||||
name: 'scheduling',
|
||||
label: t`Scheduling`,
|
||||
icon: <IconCalendarStats />
|
||||
icon: <IconCalendarStats />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'stocktake',
|
||||
label: t`Stocktake`,
|
||||
icon: <IconClipboardList />
|
||||
icon: <IconClipboardList />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'test_templates',
|
||||
|
@ -22,6 +22,7 @@ import {
|
||||
DuplicateItemAction,
|
||||
EditItemAction
|
||||
} from '../../components/items/ActionDropdown';
|
||||
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
||||
import { PageDetail } from '../../components/nav/PageDetail';
|
||||
import { PanelGroup, PanelType } from '../../components/nav/PanelGroup';
|
||||
import { StatusRenderer } from '../../components/render/StatusRenderer';
|
||||
@ -220,7 +221,8 @@ export default function ReturnOrderDetail() {
|
||||
{
|
||||
name: 'line-items',
|
||||
label: t`Line Items`,
|
||||
icon: <IconList />
|
||||
icon: <IconList />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'attachments',
|
||||
|
@ -25,6 +25,7 @@ import {
|
||||
DuplicateItemAction,
|
||||
EditItemAction
|
||||
} from '../../components/items/ActionDropdown';
|
||||
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
||||
import { PageDetail } from '../../components/nav/PageDetail';
|
||||
import { PanelGroup, PanelType } from '../../components/nav/PanelGroup';
|
||||
import { StatusRenderer } from '../../components/render/StatusRenderer';
|
||||
@ -248,17 +249,20 @@ export default function SalesOrderDetail() {
|
||||
{
|
||||
name: 'line-items',
|
||||
label: t`Line Items`,
|
||||
icon: <IconList />
|
||||
icon: <IconList />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'pending-shipments',
|
||||
label: t`Pending Shipments`,
|
||||
icon: <IconTruckLoading />
|
||||
icon: <IconTruckLoading />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'completed-shipments',
|
||||
label: t`Completed Shipments`,
|
||||
icon: <IconTruckDelivery />
|
||||
icon: <IconTruckDelivery />,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'build-orders',
|
||||
|
@ -32,6 +32,7 @@ import {
|
||||
UnlinkBarcodeAction,
|
||||
ViewBarcodeAction
|
||||
} from '../../components/items/ActionDropdown';
|
||||
import { PlaceholderPanel } from '../../components/items/Placeholder';
|
||||
import NavigationTree from '../../components/nav/NavigationTree';
|
||||
import { PageDetail } from '../../components/nav/PageDetail';
|
||||
import { PanelGroup, PanelType } from '../../components/nav/PanelGroup';
|
||||
@ -283,7 +284,9 @@ export default function StockDetail() {
|
||||
label: t`Allocations`,
|
||||
icon: <IconBookmark />,
|
||||
hidden:
|
||||
!stockitem?.part_detail?.salable && !stockitem?.part_detail?.component
|
||||
!stockitem?.part_detail?.salable &&
|
||||
!stockitem?.part_detail?.component,
|
||||
content: <PlaceholderPanel />
|
||||
},
|
||||
{
|
||||
name: 'testdata',
|
||||
|
Loading…
Reference in New Issue
Block a user