Skip to content

Commit

Permalink
[PUI] Placeholder panels (#7850)
Browse files Browse the repository at this point in the history
* Remove unused import

* Add "homepage" settings for user

Note: These will be replaced with "dashboard" settings in the future
  • Loading branch information
SchrodingersGat authored Aug 10, 2024
1 parent 42183a3 commit 7a97ecf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/frontend/src/components/settings/SettingList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ export function SettingList({
(s: any) => s.key === key
);

if (settingsState?.settings && !setting) {
console.error(`Setting ${key} not found`);
}

return (
<React.Fragment key={key}>
{setting ? (
Expand Down
29 changes: 27 additions & 2 deletions src/frontend/src/pages/Index/Settings/UserSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ 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';
Expand Down Expand Up @@ -46,7 +45,33 @@ export default function UserSettings() {
name: 'dashboard',
label: t`Dashboard`,
icon: <IconDeviceDesktopAnalytics />,
content: <PlaceholderPanel />
content: (
<UserSettingList
keys={[
// TODO: These will be replaced with "dashboard" settings,
// once the new dashboard is implemented
'HOMEPAGE_HIDE_INACTIVE',
'HOMEPAGE_PART_STARRED',
'HOMEPAGE_CATEGORY_STARRED',
'HOMEPAGE_PART_LATEST',
'HOMEPAGE_BOM_REQUIRES_VALIDATION',
'HOMEPAGE_STOCK_RECENT',
'HOMEPAGE_STOCK_LOW',
'HOMEPAGE_SHOW_STOCK_DEPLETED',
'HOMEPAGE_BUILD_STOCK_NEEDED',
'HOMEPAGE_STOCK_EXPIRED',
'HOMEPAGE_STOCK_STALE',
'HOMEPAGE_BUILD_PENDING',
'HOMEPAGE_BUILD_OVERDUE',
'HOMEPAGE_PO_OUTSTANDING',
'HOMEPAGE_PO_OVERDUE',
'HOMEPAGE_SO_OUTSTANDING',
'HOMEPAGE_SO_OVERDUE',
'HOMEPAGE_SO_SHIPMENTS_PENDING',
'HOMEPAGE_NEWS'
]}
/>
)
},
{
name: 'display',
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/pages/stock/StockDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
UnlinkBarcodeAction,
ViewBarcodeAction
} from '../../components/items/ActionDropdown';
import { PlaceholderPanel } from '../../components/items/Placeholder';
import { StylishText } from '../../components/items/StylishText';
import InstanceDetail from '../../components/nav/InstanceDetail';
import NavigationTree from '../../components/nav/NavigationTree';
Expand Down

0 comments on commit 7a97ecf

Please sign in to comment.