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

Test checkout #3529

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 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
8b2810a
Update config.yml
Janpot May 7, 2024
cd3cbce
Update package.json
Janpot May 7, 2024
34eb319
fewrf
Janpot May 7, 2024
ab13ca4
Update package.json
Janpot May 7, 2024
1c5c7c6
Update pnpm-lock.yaml
Janpot May 7, 2024
b41a8b4
Update pnpm-lock.yaml
Janpot May 7, 2024
ae81e4b
remove playground
Janpot May 7, 2024
3545b27
Update pnpm-lock.yaml
Janpot May 7, 2024
5e9043d
Update pnpm-lock.yaml
Janpot May 7, 2024
d7dac78
Update DashboardLayout.tsx
Janpot May 7, 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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pnpm-lock.yaml
/docs/export
/docs/schemas
/packages/**/dist
/packages/**/build
/packages/toolpad-studio/.next
/packages/toolpad-studio/public

Expand Down
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,14 @@ module.exports = {
'packages/toolpad-studio-runtime/**/*',
'packages/toolpad-utils/**/*',
],
excludedFiles: ['tsup.config.ts', '*.spec.ts', '*.spec.tsx', 'vitest.config.ts'],
excludedFiles: [
'tsup.config.ts',
'*.spec.ts',
'*.spec.tsx',
'*.test.ts',
'*.test.tsx',
'vitest.config.ts',
],
rules: {
'import/no-extraneous-dependencies': ['error'],
},
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ lerna-debug.log
.env

dist/
build/

packages/toolpad-studio/public/web_modules
packages/toolpad-studio/public/runtime
Expand Down
4 changes: 2 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Enforce pnpm

engine-strict = true
auto-install-peers = true
engine-strict=true
auto-install-peers=true
strict-peer-dependencies=false
34 changes: 31 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Local development

If you would like to hack on Toolpad Studio or want to run the latest version, you can follow these steps:
If you would like to hack on Toolpad or want to run the latest version, you can follow these steps:

_If you're looking into contributing to the docs, follow the [instructions](#building-and-running-the-documentation) down below_

Expand All @@ -11,7 +11,7 @@ _If you're looking into contributing to the docs, follow the [instructions](#bui
- git
- node.js

### Running apps inside the monorepo (recommended)
### Running Toolpad Studio apps inside the monorepo (recommended)

This uses the local version of Toolpad Studio as built in the mono-repository.
This is recommended when your app is in a folder inside of the mono-repository.
Expand Down Expand Up @@ -139,6 +139,34 @@ pnpm install

</details>

### Developing on Toolpad Core

This uses the local version of Toolpad Core as built in the mono-repository, and allows for quickly testing out changes and their results.

Some application examples for different JavaScript frameworks (such as Next.js, Vite...) are present in the `playground` folder that can be used to quickly develop on Toolpad Core on a live application.

1. Install dependencies:

```bash
pnpm install
```

2. Run the built-in watch mode

```bash
pnpm dev
```

3. Run any application in the `playground` folder in development mode, such as `toolpad-core-nextjs`

```bash
cd playground/toolpad-core-nextjs
```

```bash
pnpm dev
```

## Running integration tests

The playwright tests can be run in one of two modes:
Expand Down Expand Up @@ -198,7 +226,7 @@ Use the `--ui` flag to run the tests interactively.

## Using CodeSandbox CI

Each pull request is built on [CodeSandbox CI](https://codesandbox.io/docs/learn/sandboxes/ci). As a result of that we have a published Toolpad Studio package for ever pull request. To use the package from the pull request, take the following steps:
Each pull request is built on [CodeSandbox CI](https://codesandbox.io/docs/learn/sandboxes/ci). As a result of that we have a published Toolpad Studio package for every pull request. To use the package from the pull request, take the following steps:

1. In the GitHub PR checks, locate the ci/codesandbox check and make sure it has successfully finished building. Click on "details" to open the CodeSandbox CI user interface.

Expand Down
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

<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,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 theme from '../theme';

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 theme={theme} 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,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 theme from '../theme';

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 theme={theme} 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,110 @@
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';
import theme from '../theme';

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 theme={theme} 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,30 @@
# Dashboard Layout

<p class="description">The dashboard layout component provides a customizable out-of-the-box layout for a typical dashboard page.</p>

## Demo

A Dashboard Layout has a configurable header and sidebar with navigation.

{{"demo": "DashboardLayoutBasic.js", "height": 500, "iframe": true}}

Some features of this layout depend on the `AppProvider` component that must be present at the base application level.

## Branding

The `branding` prop in the `AppProvider` allows for setting a `logo` or `title` in the page header.

{{"demo": "DashboardLayoutBranding.js", "height": 500, "iframe": true}}

## Navigation

The `navigation` prop in the `AppProvider` allows for setting any type of navigation structure in the sidebar, such as links, headings, nested collapsible lists and dividers, in any order.

{{"demo": "DashboardLayoutNavigation.js", "height": 640, "iframe": true}}

<!-- ## API

See the documentation below for a complete reference to all of the props available to the components mentioned here.

- [`<AppProvider />`](/toolpad/core/reference/components/app-provider/#properties)
- [`<DashboardLayout />`](/toolpad/core/reference/components/dashboard-layout/#properties) -->
3 changes: 0 additions & 3 deletions docs/data/toolpad/core/components/dashboard.md

This file was deleted.

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

<p class="description">This page contains an index to the component pages that come with Toolpad Core.</p>

- [Dashboard](/toolpad/core/components/dashboard/)
- [Dashboard Layout](/toolpad/core/components/dashboard-layout/)
- [Data Grid](/toolpad/core/components/data-grid/)
- [Line Chart](/toolpad/core/components/line-chart/)
- [Select Filter](/toolpad/core/components/select-filter/)
Loading
Loading