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 DashboardLayout component to @toolpad/core #3554

Merged
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
bebb82e
Improve bundling, try to fix MUI/Next integration bugs
apedroferreira Mar 28, 2024
03786bd
Fix import in template
apedroferreira Mar 28, 2024
fd68ff0
fix it more
apedroferreira Mar 28, 2024
4d04649
Re-add icon imports
apedroferreira Mar 28, 2024
8630f2a
Always clean or it gets messy
apedroferreira Mar 28, 2024
235116a
Basic layout - a start
apedroferreira Mar 29, 2024
1311f6f
Remove unused icon
apedroferreira Apr 1, 2024
8f6c9db
Basic header, sidebar in progress
apedroferreira Apr 2, 2024
e6d436b
Header with branding + navigation with nesting
apedroferreira Apr 3, 2024
4807db7
Grammar
apedroferreira Apr 3, 2024
926102f
Much better test
apedroferreira Apr 3, 2024
f0c6180
Update created app files
apedroferreira Apr 4, 2024
4175348
Scaffolding fixes
apedroferreira Apr 4, 2024
8f19dde
Add DashboardLayout tests
apedroferreira Apr 4, 2024
f44f5a0
Remove this thing I guess
apedroferreira Apr 4, 2024
d250929
Nevermind
apedroferreira Apr 4, 2024
06da40c
Fix dependencies if they're broken
apedroferreira Apr 4, 2024
f0a17e4
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira Apr 4, 2024
3dab0a8
Review fixes, make everything more generic, use playground folder
apedroferreira Apr 16, 2024
eb8a6f1
Build with babel, create development tools
apedroferreira Apr 18, 2024
b8fdf8d
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira Apr 18, 2024
229dffc
Update create-toolpad-app for core
apedroferreira Apr 18, 2024
1c777d3
Review suggestions and add DashboardLayout demo to docs
apedroferreira Apr 23, 2024
9efd2f5
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira Apr 23, 2024
c31fe20
Fix this example
apedroferreira Apr 23, 2024
7fd54d4
Dedupe
apedroferreira Apr 23, 2024
c6819a5
Use new navigation system
apedroferreira Apr 26, 2024
c4da025
Better component name
apedroferreira Apr 26, 2024
e105c15
DashboardLayout docs, missing API reference
apedroferreira Apr 30, 2024
0327c4f
Update
apedroferreira May 2, 2024
4b59fc0
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira May 2, 2024
cbc3045
Reuse theme in docs
apedroferreira May 2, 2024
6508899
Fix core publish
apedroferreira May 2, 2024
34e9255
Rerun install
apedroferreira May 2, 2024
fa9b64f
Fix tests and other errors
apedroferreira May 3, 2024
c21a36e
Set exports too
apedroferreira May 3, 2024
83e99e2
whoops
apedroferreira May 3, 2024
effcabf
Merge branch 'master' into add-layout-component
apedroferreira May 3, 2024
0de2030
Try Netlify deploy with imports from root
apedroferreira May 3, 2024
dd39264
Stupid VSCode setting
apedroferreira May 3, 2024
65acf1d
Linters
apedroferreira May 3, 2024
67f724b
Attempt to fix netlify build
apedroferreira May 6, 2024
4b033f7
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira May 6, 2024
6da38cb
Try to fix OOM in Circle CI
apedroferreira May 6, 2024
1c4f46b
Another attempt to fix OOM in CI
apedroferreira May 6, 2024
a154f6f
Add Toolpad Core contributing instructions
apedroferreira May 6, 2024
c939d98
Try Jan's changes and some other but keep playground
apedroferreira May 7, 2024
b56c288
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira May 7, 2024
69f2db0
Another attempt
apedroferreira May 7, 2024
661c6ad
More cleanup before trying to remove playground
apedroferreira May 7, 2024
291c78f
Update lockfile
apedroferreira May 7, 2024
c355188
Retry filter option to try to keep playground alive
apedroferreira May 7, 2024
701187e
Try with correct option
apedroferreira May 7, 2024
fef1864
Dedupe again
apedroferreira May 7, 2024
deb85ea
ugh
apedroferreira May 7, 2024
b3346b9
Maybe this
apedroferreira May 7, 2024
f7a9cbb
Revert last failed attempts
apedroferreira May 8, 2024
31a4af8
Try older pnpm patch version
apedroferreira May 8, 2024
1c996a7
Try latest pnpm minor version
apedroferreira May 8, 2024
631afc1
Try pnpm 9
apedroferreira May 8, 2024
5682085
Properly try previous minor version
apedroferreira May 8, 2024
ce8102e
Try latesg pnpm commit ( I think)
apedroferreira May 8, 2024
22cfa4f
gh
apedroferreira May 8, 2024
8fa6300
Fix mismatched packages
apedroferreira May 8, 2024
8ac56cb
Playing around with pnpm had somehow broken the lockfile permanently
apedroferreira May 8, 2024
09a4741
Final cleanup
apedroferreira May 8, 2024
4e7d81c
Many review improvements, provide some themes too
apedroferreira May 13, 2024
dbc0e1b
Merge remote-tracking branch 'upstream/master' into add-layout-component
apedroferreira May 14, 2024
59e4121
Remove more leftovers
apedroferreira May 14, 2024
9e26e6e
Review fixes, prep to split into another PR
apedroferreira May 14, 2024
6277b31
Add TODO comments
apedroferreira May 14, 2024
36651ce
Remove development workflow to simplify PR
apedroferreira May 14, 2024
c270c76
more cleanup
apedroferreira May 14, 2024
51f58e0
And this
apedroferreira May 14, 2024
6449ab9
Todo comments in examples are no bueno
apedroferreira May 14, 2024
9465e74
Automatically generate demos
apedroferreira May 15, 2024
180ed30
Merge remote-tracking branch 'upstream/master' into add-dashboard-lay…
apedroferreira May 15, 2024
fb188ca
Prettier + try to fix weird eslint error
apedroferreira May 15, 2024
4f8b5a6
Fix file name casing
apedroferreira May 15, 2024
2db6dff
Merge remote-tracking branch 'upstream/master' into add-dashboard-lay…
apedroferreira May 17, 2024
d8b9838
Merge remote-tracking branch 'upstream/master' into add-dashboard-lay…
apedroferreira May 17, 2024
21d5f64
Rerun docs formatter
apedroferreira May 17, 2024
b15f7c1
Review fixes
apedroferreira May 21, 2024
1e8708c
Merge remote-tracking branch 'upstream/master' into add-dashboard-lay…
apedroferreira May 21, 2024
56d268f
Fix file casing weirdness
apedroferreira May 21, 2024
c789e14
Alrighty
apedroferreira May 21, 2024
126ecd7
Update lockfile
apedroferreira May 21, 2024
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
3 changes: 3 additions & 0 deletions docs/data/toolpad/core/api/components/dashboard-layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dashboard Layout API
Copy link
Member

@Janpot Janpot May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the API, let's port the docs generator from X?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that in this separate PR, right? #3536

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the X one, I was checking the Base one, will take a look.

Copy link
Member

@Janpot Janpot May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, base may be better


<p class="description">DashboardLayout API reference</p>
3 changes: 0 additions & 3 deletions docs/data/toolpad/core/api/components/dashboard.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/data/toolpad/core/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Components

- [Dashboard](/toolpad/core/api/dashboard/)
- [Dashboard Layout](/toolpad/core/api/dashboard-layout/)
- [Data Grid](/toolpad/core/api/data-grid/)
- [Line Chart](/toolpad/core/api/line-chart/)
- [Select Filter](/toolpad/core/api/select-filter/)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import * as React from 'react';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this hand-written? I think we should port the docs:typescript:formatted script from core

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't noticed that, I guess I can include it in this PR if it's simple.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added it here, seems to work fine 9465e74

import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import DashboardIcon from '@mui/icons-material/Dashboard';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
import BarChartIcon from '@mui/icons-material/BarChart';
import DescriptionIcon from '@mui/icons-material/Description';
import LayersIcon from '@mui/icons-material/Layers';
import { AppProvider } from '@toolpad/core/AppProvider';
import { DashboardLayout } from '@toolpad/core/DashboardLayout';

const NAVIGATION = [
{
kind: 'header',
title: 'Main items',
},
{
title: 'Dashboard',
icon: <DashboardIcon />,
},
{
title: 'Orders',
icon: <ShoppingCartIcon />,
},
{
kind: 'divider',
},
{
kind: 'header',
title: 'Analytics',
},
{
title: 'Reports',
icon: <BarChartIcon />,
children: [
{
title: 'Sales',
icon: <DescriptionIcon />,
},
{
title: 'Traffic',
icon: <DescriptionIcon />,
},
],
},
{
title: 'Integrations',
icon: <LayersIcon />,
},
];

export default function DashboardLayoutBasic() {
return (
<AppProvider navigation={NAVIGATION}>
<DashboardLayout>
<Box
sx={{
py: 4,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
>
<Typography>Dashboard content goes here.</Typography>
</Box>
</DashboardLayout>
</AppProvider>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import DashboardIcon from '@mui/icons-material/Dashboard';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
import BarChartIcon from '@mui/icons-material/BarChart';
import DescriptionIcon from '@mui/icons-material/Description';
import LayersIcon from '@mui/icons-material/Layers';
import { AppProvider } from '@toolpad/core/AppProvider';
import { DashboardLayout } from '@toolpad/core/DashboardLayout';
import type { Navigation } from '@toolpad/core';

const NAVIGATION: Navigation = [
{
kind: 'header',
title: 'Main items',
},
{
title: 'Dashboard',
icon: <DashboardIcon />,
},
{
title: 'Orders',
icon: <ShoppingCartIcon />,
},
{
kind: 'divider',
},
{
kind: 'header',
title: 'Analytics',
},
{
title: 'Reports',
icon: <BarChartIcon />,
children: [
{
title: 'Sales',
icon: <DescriptionIcon />,
},
{
title: 'Traffic',
icon: <DescriptionIcon />,
},
],
},
{
title: 'Integrations',
icon: <LayersIcon />,
},
];

export default function DashboardLayoutBasic() {
return (
<AppProvider navigation={NAVIGATION}>
<DashboardLayout>
<Box
sx={{
py: 4,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
>
<Typography>Dashboard content goes here.</Typography>
</Box>
</DashboardLayout>
</AppProvider>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import DashboardIcon from '@mui/icons-material/Dashboard';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
import { AppProvider } from '@toolpad/core/AppProvider';
import { DashboardLayout } from '@toolpad/core/DashboardLayout';

const NAVIGATION = [
{
title: 'Dashboard',
icon: <DashboardIcon />,
},
{
title: 'Orders',
icon: <ShoppingCartIcon />,
},
];

const BRANDING = {
logo: <img src="https://mui.com/static/logo.png" alt="MUI logo" />,
title: 'MUI',
};

export default function DashboardLayoutBranding() {
return (
<AppProvider navigation={NAVIGATION} branding={BRANDING}>
<DashboardLayout>
<Box
sx={{
py: 4,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
>
<Typography>Dashboard content goes here.</Typography>
</Box>
</DashboardLayout>
</AppProvider>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import DashboardIcon from '@mui/icons-material/Dashboard';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
import { AppProvider } from '@toolpad/core/AppProvider';
import { DashboardLayout } from '@toolpad/core/DashboardLayout';
import type { Navigation, Branding } from '@toolpad/core';

const NAVIGATION: Navigation = [
{
title: 'Dashboard',
icon: <DashboardIcon />,
},
{
title: 'Orders',
icon: <ShoppingCartIcon />,
},
];

const BRANDING: Branding = {
logo: <img src="https://mui.com/static/logo.png" alt="MUI logo" />,
title: 'MUI',
};

export default function DashboardLayoutBranding() {
return (
<AppProvider navigation={NAVIGATION} branding={BRANDING}>
<DashboardLayout>
<Box
sx={{
py: 4,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
>
<Typography>Dashboard content goes here.</Typography>
</Box>
</DashboardLayout>
</AppProvider>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import DescriptionIcon from '@mui/icons-material/Description';
import FolderIcon from '@mui/icons-material/Folder';
import { AppProvider } from '@toolpad/core/AppProvider';
import { DashboardLayout } from '@toolpad/core/DashboardLayout';

const NAVIGATION = [
{
title: 'Item 1',
icon: <DescriptionIcon />,
},
{
title: 'Item 2',
icon: <DescriptionIcon />,
},
{
title: 'Folder 1',
icon: <FolderIcon />,
children: [
{
title: 'Item A1',
icon: <DescriptionIcon />,
},
{
title: 'Item A2',
icon: <DescriptionIcon />,
},
{
title: 'Folder A1',
icon: <FolderIcon />,
children: [
{
title: 'Item B1',
icon: <DescriptionIcon />,
},
{
title: 'Item B2',
icon: <DescriptionIcon />,
},
],
},
],
},
{ kind: 'divider' },
{
kind: 'header',
title: 'Header 1',
},
{
title: 'Item A',
icon: <DescriptionIcon />,
},
{
kind: 'header',
title: 'Header 2',
},
{
title: 'Item B',
icon: <DescriptionIcon />,
},
{
title: 'Folder 2',
icon: <FolderIcon />,
children: [
{
kind: 'header',
title: 'Header A1',
},
{
title: 'Item C1',
icon: <DescriptionIcon />,
},
{
title: 'Item C2',
icon: <DescriptionIcon />,
},
{ kind: 'divider' },
{
kind: 'header',
title: 'Header A2',
},
{
title: 'Item C3',
icon: <DescriptionIcon />,
},
],
},
];

export default function DashboardLayoutNavigation() {
return (
<AppProvider navigation={NAVIGATION}>
<DashboardLayout>
<Box
sx={{
py: 4,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
>
<Typography>Dashboard content goes here.</Typography>
</Box>
</DashboardLayout>
</AppProvider>
);
}
Loading
Loading