diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 9b032184319..e6f90dc3fe6 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -16,10 +16,10 @@ jobs:
security-events: write
steps:
- name: Checkout repository
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3
+ uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
with:
languages: typescript
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -29,4 +29,4 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3
+ uses: github/codeql-action/analyze@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml
index dd7d546d9e8..f7dab7dc7b5 100644
--- a/.github/workflows/scorecards.yml
+++ b/.github/workflows/scorecards.yml
@@ -23,12 +23,12 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- name: Run analysis
- uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0
+ uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
@@ -44,6 +44,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
- uses: github/codeql-action/upload-sarif@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3
+ uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
with:
sarif_file: results.sarif
diff --git a/.github/workflows/update-monorepo.yml b/.github/workflows/update-monorepo.yml
index ef80aa2e982..5be28393b16 100644
--- a/.github/workflows/update-monorepo.yml
+++ b/.github/workflows/update-monorepo.yml
@@ -12,14 +12,14 @@ jobs:
issues: write
steps:
- name: Set up Node.js ⚙️
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
+ uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: '18.x'
- name: Setup yarn
run: npm install -g yarn
- - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Get latest monorepo commit
run: echo "MONOREPO_LATEST_COMMIT=$(git ls-remote https://github.com/mui/material-ui master | awk '{print $1}')" >> $GITHUB_ENV
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 75fd0149b56..28e8c5a6cd9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelog
+## 0.1.34
+
+
+
+_Oct 25, 2023_
+
+A big thanks to the 2 contributors who made this release possible. Here are some highlights ✨:
+
+Improvements to the Support page, some fixes to the tests.
+
+- Update Support URL in Help menu (#2832) @bharatkashyap
+- Fix flaky tests (#2812) @apedroferreira
+- [core] Monorepo upgrade (#2825) @bharatkashyap
+- [docs] A few Support page improvements (#2824) @bharatkashyap
+
+All contributors of this release in alphabetical order: @apedroferreira, @bharatkashyap
+
## 0.1.33
diff --git a/docs/data/pages.ts b/docs/data/pages.ts
index 273cb2b1df9..cca7807243d 100644
--- a/docs/data/pages.ts
+++ b/docs/data/pages.ts
@@ -21,7 +21,7 @@ const pages: MuiPage[] = [
},
{ pathname: '/toolpad/getting-started/roadmap' },
{
- pathname: '/toolpad/support/support',
+ pathname: '/toolpad/getting-started/support',
title: 'Support',
},
],
diff --git a/docs/data/toolpad/concepts/data-providers.md b/docs/data/toolpad/concepts/data-providers.md
index 12b185ec1e4..0620baebfb4 100644
--- a/docs/data/toolpad/concepts/data-providers.md
+++ b/docs/data/toolpad/concepts/data-providers.md
@@ -1,4 +1,4 @@
-# Data Providers
+# Data providers
Bring tabular data to the frontend with server-side pagination and filtering.
diff --git a/docs/data/toolpad/getting-started/support.md b/docs/data/toolpad/getting-started/support.md
index 5d746d8f240..2f7beb59934 100644
--- a/docs/data/toolpad/getting-started/support.md
+++ b/docs/data/toolpad/getting-started/support.md
@@ -40,11 +40,11 @@ Stack Overflow contains a wealth of information about MUI products. Toolpad is a
### Social media
-Toolpad has growing presence on [Twitter](https://twitter.com/MUI_Toolpad).
+Toolpad has a growing presence on [Twitter](https://twitter.com/MUI_Toolpad).
You can use it to share what you're working on and connect with other developers.
Please keep in mind that we don't actively monitor direct messages on the company's social media accounts, so this is _not_ a good way to get in touch with us directly.
### Direct email
-If email is your thing, the team can be directly reached out at _toolpad@mui.com_.
+If email is your thing, the team can be directly reached out at toolpad@mui.com.
diff --git a/docs/package.json b/docs/package.json
index 79e39f579fe..872366eb0fa 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -1,6 +1,6 @@
{
"name": "docs",
- "version": "0.1.33",
+ "version": "0.1.34",
"private": true,
"author": "MUI Toolpad",
"license": "MIT",
@@ -26,15 +26,15 @@
"@emotion/react": "11.11.1",
"@emotion/server": "11.11.0",
"@emotion/styled": "11.11.0",
- "@mui/icons-material": "5.14.14",
- "@mui/material": "5.14.14",
+ "@mui/icons-material": "5.14.16",
+ "@mui/material": "5.14.16",
"@mui/monorepo": "https://github.com/mui/material-ui.git",
- "@mui/styles": "5.14.14",
- "@mui/toolpad": "0.1.33",
- "@mui/utils": "5.14.14",
+ "@mui/styles": "5.14.16",
+ "@mui/toolpad": "0.1.34",
+ "@mui/utils": "5.14.16",
"@trendmicro/react-interpolate": "0.5.5",
- "@types/lodash": "4.14.199",
- "@types/react-dom": "18.2.13",
+ "@types/lodash": "4.14.200",
+ "@types/react-dom": "18.2.14",
"@types/react-router-dom": "5.3.3",
"accept-language": "3.0.18",
"ast-types": "0.14.2",
@@ -52,7 +52,7 @@
"cross-env": "7.0.3",
"date-fns-jalali": "2.29.3-0",
"doctrine": "3.0.0",
- "exceljs": "4.3.0",
+ "exceljs": "4.4.0",
"express": "4.18.2",
"fg-loadcss": "3.1.0",
"fs-extra": "11.1.1",
@@ -61,7 +61,7 @@
"lodash": "4.17.21",
"lz-string": "1.5.0",
"markdown-to-jsx": "7.3.2",
- "marked": "9.1.2",
+ "marked": "9.1.3",
"next": "13.4.19",
"nprogress": "0.2.0",
"postcss": "8.4.31",
@@ -69,12 +69,12 @@
"prop-types": "15.8.1",
"raw-loader": "4.0.2",
"react": "18.2.0",
- "react-docgen": "6.0.4",
+ "react-docgen": "7.0.0",
"react-dom": "18.2.0",
"react-hook-form": "7.47.0",
"react-is": "18.2.0",
- "react-router": "6.16.0",
- "react-router-dom": "6.16.0",
+ "react-router": "6.17.0",
+ "react-router-dom": "6.17.0",
"react-runner": "1.0.3",
"react-simple-code-editor": "0.13.1",
"react-transition-group": "4.4.5",
@@ -89,9 +89,9 @@
"devDependencies": {
"@babel/plugin-transform-react-constant-elements": "7.22.5",
"@babel/preset-typescript": "7.23.2",
- "@types/doctrine": "0.0.7",
- "@types/json-schema": "7.0.13",
- "@types/react-is": "18.2.2",
+ "@types/doctrine": "0.0.8",
+ "@types/json-schema": "7.0.14",
+ "@types/react-is": "18.2.3",
"cpy-cli": "5.0.0",
"cross-fetch": "4.0.0",
"gm": "1.25.0",
diff --git a/docs/pages/toolpad/support/support.js b/docs/pages/toolpad/getting-started/support.js
similarity index 100%
rename from docs/pages/toolpad/support/support.js
rename to docs/pages/toolpad/getting-started/support.js
diff --git a/docs/public/_redirects b/docs/public/_redirects
index 4df88cc81b7..8b925f7889b 100644
--- a/docs/public/_redirects
+++ b/docs/public/_redirects
@@ -34,6 +34,7 @@
/toolpad/tutorials/render-deploy/ /toolpad/how-to-guides/render-deploy/ 301
/toolpad/examples/overview/ /toolpad/examples/ 301
/toolpad/how-to-guides/number-display/ /toolpad/how-to-guides/map-display/ 301
+/toolpad/support/support/ /toolpad/getting-started/support/ 301
# Create separate namespace on https://mui.com
diff --git a/examples/basic-crud-app/package.json b/examples/basic-crud-app/package.json
index c914714c464..9641ab84bae 100644
--- a/examples/basic-crud-app/package.json
+++ b/examples/basic-crud-app/package.json
@@ -8,6 +8,6 @@
"start": "toolpad start"
},
"dependencies": {
- "@mui/toolpad": "0.1.33"
+ "@mui/toolpad": "0.1.34"
}
}
diff --git a/examples/custom-datagrid-column/package.json b/examples/custom-datagrid-column/package.json
index 101b4fd1c58..ad2f728ebdf 100644
--- a/examples/custom-datagrid-column/package.json
+++ b/examples/custom-datagrid-column/package.json
@@ -8,6 +8,6 @@
"start": "toolpad start"
},
"dependencies": {
- "@mui/toolpad": "0.1.33"
+ "@mui/toolpad": "0.1.34"
}
}
diff --git a/examples/custom-server/package.json b/examples/custom-server/package.json
index 1cdba518844..5007c2dfc49 100644
--- a/examples/custom-server/package.json
+++ b/examples/custom-server/package.json
@@ -8,7 +8,7 @@
"start": "node index.mjs"
},
"dependencies": {
- "@mui/toolpad": "0.1.33",
+ "@mui/toolpad": "0.1.34",
"express": "4.18.2"
},
"devDependencies": {}
diff --git a/examples/datagrid-columns/package.json b/examples/datagrid-columns/package.json
index 371b5b543d8..e09dc195fe6 100644
--- a/examples/datagrid-columns/package.json
+++ b/examples/datagrid-columns/package.json
@@ -8,6 +8,6 @@
"start": "toolpad start"
},
"dependencies": {
- "@mui/toolpad": "0.1.33"
+ "@mui/toolpad": "0.1.34"
}
}
diff --git a/examples/dog-app/package.json b/examples/dog-app/package.json
index c171bf7b616..71c1588ede4 100644
--- a/examples/dog-app/package.json
+++ b/examples/dog-app/package.json
@@ -8,6 +8,6 @@
"start": "toolpad start"
},
"dependencies": {
- "@mui/toolpad": "0.1.33"
+ "@mui/toolpad": "0.1.34"
}
}
diff --git a/examples/google-sheet/package.json b/examples/google-sheet/package.json
index 4b8c69508e3..95255f8c203 100644
--- a/examples/google-sheet/package.json
+++ b/examples/google-sheet/package.json
@@ -8,7 +8,7 @@
"start": "toolpad start"
},
"dependencies": {
- "@mui/toolpad": "0.1.33",
- "googleapis": "127.0.0"
+ "@mui/toolpad": "0.1.34",
+ "googleapis": "128.0.0"
}
}
diff --git a/examples/graphql/package.json b/examples/graphql/package.json
index 85e46a6cced..22ee28a1ac6 100644
--- a/examples/graphql/package.json
+++ b/examples/graphql/package.json
@@ -8,7 +8,7 @@
"start": "toolpad start"
},
"dependencies": {
- "@mui/toolpad": "0.1.33",
+ "@mui/toolpad": "0.1.34",
"graphql": "16.8.1",
"graphql-request": "6.1.0",
"graphql-tag": "2.12.6"
diff --git a/examples/npm-stats/package.json b/examples/npm-stats/package.json
index c18c2a5dbf4..c002da5839b 100644
--- a/examples/npm-stats/package.json
+++ b/examples/npm-stats/package.json
@@ -8,7 +8,7 @@
"start": "NODE_OPTIONS='--max-old-space-size=396' toolpad start"
},
"dependencies": {
- "@mui/toolpad": "0.1.33",
- "recharts": "2.9.0"
+ "@mui/toolpad": "0.1.34",
+ "recharts": "2.9.1"
}
}
diff --git a/examples/qr-generator/package.json b/examples/qr-generator/package.json
index 4d34c5096e7..136ffde7fbb 100644
--- a/examples/qr-generator/package.json
+++ b/examples/qr-generator/package.json
@@ -8,10 +8,10 @@
"start": "toolpad start"
},
"dependencies": {
- "@mui/toolpad": "0.1.33",
+ "@mui/toolpad": "0.1.34",
"qrcode": "^1.5.3"
},
"devDependencies": {
- "@types/qrcode": "^1.5.2"
+ "@types/qrcode": "^1.5.4"
}
}
diff --git a/examples/stripe-script/package.json b/examples/stripe-script/package.json
index f40ce92f764..bc66895a62e 100644
--- a/examples/stripe-script/package.json
+++ b/examples/stripe-script/package.json
@@ -8,11 +8,7 @@
"start": "toolpad start"
},
"dependencies": {
- "@mui/toolpad": "^0.1.33",
- "child_process": "^1.0.2",
- "fs": "^0.0.1-security",
- "path": "^0.12.7",
- "stripe": "^13.10.0",
- "url": "^0.11.3"
+ "@mui/toolpad": "^0.1.34",
+ "stripe": "^14.1.0"
}
}
diff --git a/examples/stripe-script/toolpad/pages/page/page.yml b/examples/stripe-script/toolpad/pages/page/page.yml
index d79c2507fc5..be5c6597a9a 100644
--- a/examples/stripe-script/toolpad/pages/page/page.yml
+++ b/examples/stripe-script/toolpad/pages/page/page.yml
@@ -4,173 +4,198 @@ spec:
id: b4UWL4X
title: Default page
content:
- - component: PageRow
- name: pageRow2
- children:
- - component: Text
- name: text
- props:
- value: Stripe Dashboard
- variant: h4
- - component: PageRow
- name: pageRow3
- children:
- - component: Text
- name: text1
- props:
- value: Invoices
- variant: h5
- - component: PageRow
- name: pageRow1
- children:
- - component: DataGrid
- name: dataGrid
- props:
- rows:
- $$jsExpression: |
- JSON.parse(listInvoices.data)
- columns:
- - field: id
- type: string
- - field: object
- type: string
- - field: account_country
- type: string
- - field: amount_due
- type: number
- - field: amount_paid
- type: number
- - field: amount_remaining
- type: number
- - field: amount_shipping
- type: number
- - field: collection_method
- type: string
- - field: created
- type: number
- - field: currency
- type: string
- - field: custom_fields
- type: json
- - field: customer
- type: string
- - field: customer_address
- type: json
- - field: customer_email
- type: string
- - field: customer_name
- type: string
- - field: customer_phone
- type: json
- - field: customer_shipping
- type: json
- - field: customer_tax_exempt
- type: string
- - field: customer_tax_ids
- type: json
- - field: default_payment_method
- type: json
- - field: default_source
- type: json
- - field: default_tax_rates
- type: json
- - field: description
- type: json
- - field: discount
- type: json
- - field: discounts
- type: json
- - field: due_date
- type: number
- - field: effective_at
- type: number
- - field: ending_balance
- type: number
- - field: footer
- type: json
- - field: from_invoice
- type: json
- - field: hosted_invoice_url
- type: link
- - field: invoice_pdf
- type: link
- - field: last_finalization_error
- type: json
- - field: latest_revision
- type: json
- - field: lines
- type: json
- - field: livemode
- type: boolean
- - field: metadata
- type: json
- - field: next_payment_attempt
- type: json
- - field: number
- type: string
- - field: on_behalf_of
- type: json
- - field: paid
- type: boolean
- - field: paid_out_of_band
- type: boolean
- - field: payment_intent
- type: string
- - field: payment_settings
- type: json
- - field: period_end
- type: number
- - field: period_start
- type: number
- - field: post_payment_credit_notes_amount
- type: number
- - field: pre_payment_credit_notes_amount
- type: number
- - field: quote
- type: json
- - field: receipt_number
- type: json
- - field: rendering_options
- type: json
- - field: shipping_cost
- type: json
- - field: shipping_details
- type: json
- - field: starting_balance
- type: number
- - field: statement_descriptor
- type: json
- - field: status
- type: string
- - field: status_transitions
- type: json
- - field: subscription
- type: json
- - field: subtotal
- type: number
- - field: subtotal_excluding_tax
- type: number
- - field: tax
- type: json
- - field: test_clock
- type: json
- - field: total
- type: number
- - field: total_discount_amounts
- type: json
- - field: total_excluding_tax
- type: number
- - field: total_tax_amounts
- type: json
- - field: transfer_data
- type: json
- - field: webhooks_delivered_at
- type: number
+ - component: Text
+ name: text
+ layout:
+ columnSize: 1
+ props:
+ value: Stripe Dashboard
+ variant: h4
+ - component: Text
+ name: text1
+ layout:
+ columnSize: 1
+ props:
+ value: Invoices
+ variant: h5
+ - component: DataGrid
+ name: dataGrid
+ props:
+ rowsSource: dataProvider
+ dataProviderId: stripe.ts:default
+ columns:
+ - field: id
+ type: string
+ - field: object
+ type: string
+ width: 112
+ - field: account_country
+ type: string
+ width: 135
+ - field: account_name
+ type: string
+ width: 169
+ - field: account_tax_ids
+ type: json
+ - field: amount_due
+ type: number
+ - field: amount_paid
+ type: number
+ - field: amount_remaining
+ type: number
+ - field: amount_shipping
+ type: number
+ - field: application
+ type: json
+ - field: application_fee_amount
+ type: json
+ - field: attempt_count
+ type: number
+ - field: attempted
+ type: boolean
+ - field: auto_advance
+ type: boolean
+ - field: automatic_tax
+ type: json
+ - field: billing_reason
+ type: string
+ - field: charge
+ type: json
+ - field: collection_method
+ type: string
+ - field: created
+ type: number
+ - field: currency
+ type: string
+ - field: custom_fields
+ type: json
+ - field: customer
+ type: string
+ - field: customer_address
+ type: json
+ - field: customer_email
+ type: string
+ - field: customer_name
+ type: string
+ - field: customer_phone
+ type: json
+ - field: customer_shipping
+ type: json
+ - field: customer_tax_exempt
+ type: string
+ - field: customer_tax_ids
+ type: json
+ - field: default_payment_method
+ type: json
+ - field: default_source
+ type: json
+ - field: default_tax_rates
+ type: json
+ - field: description
+ type: json
+ - field: discount
+ type: json
+ - field: discounts
+ type: json
+ - field: due_date
+ type: number
+ - field: effective_at
+ type: number
+ - field: ending_balance
+ type: number
+ - field: footer
+ type: json
+ - field: from_invoice
+ type: json
+ - field: hosted_invoice_url
+ type: link
+ - field: invoice_pdf
+ type: link
+ - field: last_finalization_error
+ type: json
+ - field: latest_revision
+ type: json
+ - field: lines
+ type: json
+ - field: livemode
+ type: boolean
+ - field: metadata
+ type: json
+ - field: next_payment_attempt
+ type: json
+ - field: number
+ type: string
+ - field: on_behalf_of
+ type: json
+ - field: paid
+ type: boolean
+ - field: paid_out_of_band
+ type: boolean
+ - field: payment_intent
+ type: json
+ - field: payment_settings
+ type: json
+ - field: period_end
+ type: number
+ - field: period_start
+ type: number
+ - field: post_payment_credit_notes_amount
+ type: number
+ - field: pre_payment_credit_notes_amount
+ type: number
+ - field: quote
+ type: json
+ - field: receipt_number
+ type: json
+ - field: rendering
+ type: json
+ - field: rendering_options
+ type: json
+ - field: shipping_cost
+ type: json
+ - field: shipping_details
+ type: json
+ - field: starting_balance
+ type: number
+ - field: statement_descriptor
+ type: json
+ - field: status
+ type: string
+ - field: status_transitions
+ type: json
+ - field: subscription
+ type: json
+ - field: subscription_details
+ type: json
+ - field: subtotal
+ type: number
+ - field: subtotal_excluding_tax
+ type: number
+ - field: tax
+ type: json
+ - field: test_clock
+ type: json
+ - field: total
+ type: number
+ - field: total_discount_amounts
+ type: json
+ - field: total_excluding_tax
+ type: number
+ - field: total_tax_amounts
+ type: json
+ - field: transfer_data
+ type: json
+ - field: webhooks_delivered_at
+ type: number
- component: PageRow
name: pageRow
+ props:
+ justifyContent: start
children:
- component: Button
name: button
+ layout:
+ columnSize: 0.8380279822097516
props:
content: Download PDFs
onClick:
@@ -183,6 +208,21 @@ spec:
disabled:
$$jsExpression: |
listInvoices?.data?.length === 0
+ - component: Text
+ name: link
+ layout:
+ columnSize: 1.1619720177902484
+ props:
+ mode: link
+ value:
+ $$jsExpression: |
+ downloadPDFs.data ? 'Download .zip file' : ''
+ loading:
+ $$jsExpression: |
+ downloadPDFs.isLoading
+ href:
+ $$jsExpression: |
+ downloadPDFs.data
queries:
- name: downloadPDFs
mode: mutation
@@ -192,10 +232,3 @@ spec:
parameters:
- name: limit
value: 10
- - name: listInvoices
- query:
- function: functions.ts#listInvoices
- kind: local
- parameters:
- - name: limit
- value: 10
diff --git a/examples/stripe-script/toolpad/resources/functions.ts b/examples/stripe-script/toolpad/resources/functions.ts
index 4db3d8d57dc..791377c4080 100644
--- a/examples/stripe-script/toolpad/resources/functions.ts
+++ b/examples/stripe-script/toolpad/resources/functions.ts
@@ -1,52 +1,60 @@
-import fs from 'fs';
-import { exec } from 'child_process';
-import path from 'path';
import Stripe from 'stripe';
+import archiver from 'archiver';
const initStripe = () => {
if (!process.env.STRIPE_TOKEN) {
throw new Error('Missing STRIPE_TOKEN environment variable');
}
return new Stripe(process.env.STRIPE_TOKEN, {
- apiVersion: '2022-11-15',
+ apiVersion: '2023-08-16',
});
};
-// const stripe = new Stripe(process.env.STRIPE_TOKEN, {
-// apiVersion: '2022-11-15',
-// });
-
-export async function listInvoices(limit: number = 100, starting_after?: string) {
- const stripe = initStripe();
- const list = await stripe.invoices.list({
- limit,
- starting_after,
- });
-
- return JSON.stringify(list.data);
-}
-
export async function downloadPDFs(limit: number = 100, starting_after?: string) {
const stripe = initStripe();
+ const archive = archiver('zip', {
+ zlib: { level: 9 }, // Compression level
+ });
+
const list = await stripe.invoices.list({
limit,
starting_after,
});
- list.data?.forEach((invoice) => {
+ const pdfPromises = list.data?.map(async (invoice) => {
try {
- const dest = path.resolve('.', `invoices-${invoice.id}.pdf`);
- // check if destination is resolvable
- if (fs.existsSync(dest)) {
- console.error('Invoice already exists:', dest);
- return;
+ if (invoice.invoice_pdf) {
+ const response = await fetch(invoice.invoice_pdf);
+
+ const pdfData = await response.arrayBuffer();
+ const pdfBuffer = Buffer.from(pdfData);
+ archive.append(pdfBuffer, { name: `invoice-${invoice.id}.pdf` });
+
+ if (!response.ok) {
+ throw new Error(`Failed to download PDF for invoice ${invoice.id}`);
+ }
}
- exec(`curl '${invoice.invoice_pdf}' -L -o '${dest}'`);
- } catch (e) {
- console.error(e.stack);
- console.error('Failed to process invoice id:', invoice.id);
- throw e;
+ } catch (error) {
+ console.error(error);
}
});
+
+ await Promise.all(pdfPromises);
+ // Finalize the archive
+ archive.finalize();
+ return new Promise((resolve, reject) => {
+ const chunks: Buffer[] = [];
+ archive.on('data', (chunk: Buffer) => chunks.push(chunk));
+ archive.on('end', () => {
+ const zipBuffer = Buffer.concat(chunks);
+
+ const dataURL = `data:application/zip;base64,${zipBuffer.toString('base64')}`;
+ resolve(dataURL);
+ });
+
+ archive.on('error', (error: Error) => {
+ reject(error);
+ });
+ });
}
diff --git a/examples/stripe-script/toolpad/resources/stripe.ts b/examples/stripe-script/toolpad/resources/stripe.ts
new file mode 100644
index 00000000000..a0520eb0e5b
--- /dev/null
+++ b/examples/stripe-script/toolpad/resources/stripe.ts
@@ -0,0 +1,32 @@
+/**
+ * Toolpad data provider file.
+ * See: https://mui.com/toolpad/concepts/data-providers/
+ */
+
+import Stripe from 'stripe';
+import { createDataProvider } from '@mui/toolpad/server';
+
+const initStripe = () => {
+ if (!process.env.STRIPE_TOKEN) {
+ throw new Error('Missing STRIPE_TOKEN environment variable');
+ }
+ return new Stripe(process.env.STRIPE_TOKEN, {
+ apiVersion: '2023-08-16',
+ });
+};
+
+export default createDataProvider({
+ paginationMode: 'cursor',
+ async getRecords({ paginationModel: { cursor, pageSize } }) {
+ const stripe = initStripe();
+ const list = await stripe.invoices.list({
+ limit: pageSize,
+ starting_after: cursor ?? undefined,
+ });
+
+ return {
+ records: list.data ?? [],
+ cursor: list.data?.[list.data.length - 1].id ?? null,
+ };
+ },
+});
diff --git a/examples/with-prisma-data-provider/package.json b/examples/with-prisma-data-provider/package.json
index 23ba83ae9f3..b973eb5afe7 100644
--- a/examples/with-prisma-data-provider/package.json
+++ b/examples/with-prisma-data-provider/package.json
@@ -9,14 +9,14 @@
"prisma": "prisma"
},
"dependencies": {
- "@mui/toolpad": "0.1.33",
- "@prisma/client": "5.4.2",
+ "@mui/toolpad": "0.1.34",
+ "@prisma/client": "5.5.2",
"qrcode": "^1.5.3"
},
"devDependencies": {
- "@types/node": "^20.8.6",
- "@types/qrcode": "^1.5.2",
- "prisma": "^5.4.2",
+ "@types/node": "^20.8.9",
+ "@types/qrcode": "^1.5.4",
+ "prisma": "^5.5.2",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
}
diff --git a/examples/with-prisma/package.json b/examples/with-prisma/package.json
index 8fdc7b75461..757ce882383 100644
--- a/examples/with-prisma/package.json
+++ b/examples/with-prisma/package.json
@@ -9,14 +9,14 @@
"prisma": "prisma"
},
"dependencies": {
- "@mui/toolpad": "0.1.33",
- "@prisma/client": "5.4.2",
+ "@mui/toolpad": "0.1.34",
+ "@prisma/client": "5.5.2",
"qrcode": "^1.5.3"
},
"devDependencies": {
- "@types/node": "^20.8.6",
- "@types/qrcode": "^1.5.2",
- "prisma": "^5.4.2",
+ "@types/node": "^20.8.9",
+ "@types/qrcode": "^1.5.4",
+ "prisma": "^5.5.2",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
}
diff --git a/examples/with-wasm/package.json b/examples/with-wasm/package.json
index 0d7e1dcb09c..1230160b773 100644
--- a/examples/with-wasm/package.json
+++ b/examples/with-wasm/package.json
@@ -8,9 +8,9 @@
"start": "toolpad start"
},
"dependencies": {
- "@mui/toolpad": "0.1.33"
+ "@mui/toolpad": "0.1.34"
},
"devDependencies": {
- "assemblyscript": "0.27.13"
+ "assemblyscript": "0.27.14"
}
}
diff --git a/lerna.json b/lerna.json
index d42cf2accdd..bf311d769b8 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
- "version": "0.1.33",
+ "version": "0.1.34",
"npmClient": "yarn"
}
diff --git a/package.json b/package.json
index 40c3b11a1e9..6418e6ffa36 100644
--- a/package.json
+++ b/package.json
@@ -42,25 +42,25 @@
"test:rest:start": "tsx ./scripts/restTestServer.ts"
},
"devDependencies": {
- "@argos-ci/core": "0.12.0",
+ "@argos-ci/core": "1.0.0",
"@mui/monorepo": "https://github.com/mui/material-ui.git",
- "@next/eslint-plugin-next": "13.5.5",
+ "@next/eslint-plugin-next": "14.0.0",
"@playwright/test": "1.39.0",
"@testing-library/react": "14.0.0",
- "@types/archiver": "5.3.3",
- "@types/gtag.js": "0.0.16",
- "@types/node": "20.8.6",
+ "@types/archiver": "5.3.4",
+ "@types/gtag.js": "0.0.17",
+ "@types/node": "20.8.9",
"@types/rimraf": "3.0.2",
- "@typescript-eslint/eslint-plugin": "6.7.5",
- "@typescript-eslint/parser": "6.7.5",
+ "@typescript-eslint/eslint-plugin": "6.9.0",
+ "@typescript-eslint/parser": "6.9.0",
"chalk": "5.3.0",
- "eslint": "8.51.0",
+ "eslint": "8.52.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "17.1.0",
"eslint-config-prettier": "9.0.0",
- "eslint-import-resolver-webpack": "0.13.7",
+ "eslint-import-resolver-webpack": "0.13.8",
"eslint-plugin-filenames": "1.3.2",
- "eslint-plugin-import": "2.28.1",
+ "eslint-plugin-import": "2.29.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-mocha": "10.2.0",
"eslint-plugin-react": "7.33.2",
@@ -71,12 +71,12 @@
"format-util": "1.0.5",
"globby": "13.2.2",
"jsdom": "22.1.0",
- "lerna": "7.3.1",
+ "lerna": "7.4.1",
"markdownlint-cli2": "0.10.0",
"prettier": "2.8.8",
"pretty-quick": "3.1.3",
"react-inspector": "6.0.2",
- "recharts": "2.9.0",
+ "recharts": "2.9.1",
"regenerator-runtime": "0.14.0",
"rimraf": "5.0.5",
"typescript": "5.2.2",
@@ -92,7 +92,7 @@
"lodash": "4.17.21",
"semver": "7.5.4",
"tsup": "7.2.0",
- "tsx": "3.13.0",
+ "tsx": "3.14.0",
"vitest": "0.34.6",
"yargs": "17.7.2",
"zod": "3.22.4",
diff --git a/packages/create-toolpad-app/package.json b/packages/create-toolpad-app/package.json
index e1ccea0eb25..52390487d8f 100644
--- a/packages/create-toolpad-app/package.json
+++ b/packages/create-toolpad-app/package.json
@@ -1,6 +1,6 @@
{
"name": "create-toolpad-app",
- "version": "0.1.33",
+ "version": "0.1.34",
"keywords": [
"react",
"toolpad",
@@ -30,7 +30,7 @@
"node": ">=18"
},
"dependencies": {
- "@mui/toolpad-utils": "0.1.33",
+ "@mui/toolpad-utils": "0.1.34",
"chalk": "5.3.0",
"execa": "8.0.1",
"inquirer": "9.2.11",
@@ -39,10 +39,10 @@
"yargs": "17.7.2"
},
"devDependencies": {
- "@types/inquirer": "9.0.4",
- "@types/invariant": "2.2.35",
- "@types/node": "20.8.6",
- "@types/semver": "7.5.3",
- "@types/yargs": "17.0.28"
+ "@types/inquirer": "9.0.6",
+ "@types/invariant": "2.2.36",
+ "@types/node": "20.8.9",
+ "@types/semver": "7.5.4",
+ "@types/yargs": "17.0.29"
}
}
diff --git a/packages/eslint-plugin-material-ui/package.json b/packages/eslint-plugin-material-ui/package.json
index fb012d93474..63d6c8c09d7 100644
--- a/packages/eslint-plugin-material-ui/package.json
+++ b/packages/eslint-plugin-material-ui/package.json
@@ -1,15 +1,15 @@
{
"name": "eslint-plugin-material-ui",
- "version": "0.1.33",
+ "version": "0.1.34",
"private": true,
"description": "Custom eslint rules for MUI.",
"main": "src/index.js",
"dependencies": {
- "emoji-regex": "10.2.1"
+ "emoji-regex": "10.3.0"
},
"devDependencies": {
- "@types/eslint": "8.44.4",
- "@typescript-eslint/parser": "6.7.5"
+ "@types/eslint": "8.44.6",
+ "@typescript-eslint/parser": "6.9.0"
},
"scripts": {},
"repository": {
diff --git a/packages/toolpad-app/package.json b/packages/toolpad-app/package.json
index 6e1c93d97b3..900ba3514fe 100644
--- a/packages/toolpad-app/package.json
+++ b/packages/toolpad-app/package.json
@@ -1,6 +1,6 @@
{
"name": "@mui/toolpad",
- "version": "0.1.33",
+ "version": "0.1.34",
"license": "MIT",
"bin": {
"toolpad": "./cli.js"
@@ -52,26 +52,26 @@
"@emotion/styled": "11.11.0",
"@googleapis/drive": "8.4.0",
"@googleapis/sheets": "5.0.5",
- "@mui/icons-material": "5.14.14",
- "@mui/lab": "5.0.0-alpha.149",
- "@mui/material": "5.14.14",
- "@mui/system": "5.14.14",
- "@mui/toolpad-components": "0.1.33",
- "@mui/toolpad-core": "0.1.33",
- "@mui/toolpad-utils": "0.1.33",
- "@mui/types": "7.2.6",
- "@mui/utils": "5.14.14",
- "@mui/x-data-grid": "6.16.2",
- "@mui/x-data-grid-pro": "6.16.2",
- "@mui/x-date-pickers": "6.16.2",
- "@mui/x-date-pickers-pro": "6.16.2",
- "@mui/x-tree-view": "6.0.0-beta.0",
- "@tanstack/react-query": "4.36.1",
- "@tanstack/react-query-devtools": "4.36.1",
- "@types/cors": "2.8.14",
- "@types/json-schema": "7.0.13",
- "@types/node": "20.8.6",
- "@types/react-dev-utils": "9.0.12",
+ "@mui/icons-material": "5.14.16",
+ "@mui/lab": "5.0.0-alpha.151",
+ "@mui/material": "5.14.16",
+ "@mui/system": "5.14.16",
+ "@mui/toolpad-components": "0.1.34",
+ "@mui/toolpad-core": "0.1.34",
+ "@mui/toolpad-utils": "0.1.34",
+ "@mui/types": "7.2.8",
+ "@mui/utils": "5.14.16",
+ "@mui/x-data-grid": "6.17.0",
+ "@mui/x-data-grid-pro": "6.17.0",
+ "@mui/x-date-pickers": "6.17.0",
+ "@mui/x-date-pickers-pro": "6.17.0",
+ "@mui/x-tree-view": "6.17.0",
+ "@tanstack/react-query": "5.0.5",
+ "@tanstack/react-query-devtools": "5.0.5",
+ "@types/cors": "2.8.15",
+ "@types/json-schema": "7.0.14",
+ "@types/node": "20.8.9",
+ "@types/react-dev-utils": "9.0.13",
"@vitejs/plugin-react": "4.1.0",
"@webcontainer/env": "1.1.0",
"abort-controller": "3.0.0",
@@ -80,20 +80,19 @@
"chalk": "5.3.0",
"chokidar": "3.5.3",
"clsx": "2.0.0",
- "concurrently": "8.2.1",
+ "concurrently": "8.2.2",
"cors": "2.8.5",
- "crypto-js": "4.1.1",
"csstype": "3.1.2",
"dayjs": "1.11.10",
"dotenv": "16.3.1",
- "esbuild": "0.19.4",
+ "esbuild": "0.19.5",
"execa": "8.0.1",
"express": "4.18.2",
"find-up": "6.3.0",
"fractional-indexing": "3.2.0",
"get-port": "7.0.0",
"glob": "10.3.10",
- "google-auth-library": "9.1.0",
+ "google-auth-library": "9.2.0",
"http-proxy-middleware": "2.0.6",
"invariant": "2.2.4",
"json-to-ts": "1.7.0",
@@ -121,13 +120,13 @@
"react-inspector": "6.0.2",
"react-is": "18.2.0",
"react-resizable-panels": "0.0.55",
- "react-router-dom": "6.16.0",
- "recharts": "2.9.0",
+ "react-router-dom": "6.17.0",
+ "recharts": "2.9.1",
"semver": "7.5.4",
"serialize-javascript": "6.0.1",
- "superjson": "2.0.0",
+ "superjson": "2.2.0",
"typescript": "5.2.2",
- "vite": "4.4.11",
+ "vite": "4.5.0",
"vm-browserify": "1.1.2",
"whatwg-url": "13.0.0",
"ws": "8.14.2",
@@ -135,37 +134,36 @@
"yaml-diff-patch": "2.0.0",
"yargs": "17.7.2",
"zod": "3.22.4",
- "zod-validation-error": "1.5.0"
+ "zod-validation-error": "2.0.0"
},
"devDependencies": {
- "@types/babel__code-frame": "7.0.4",
- "@types/crypto-js": "4.1.2",
- "@types/express": "4.17.19",
- "@types/express-serve-static-core": "4.17.37",
- "@types/formidable": "3.4.3",
+ "@types/babel__code-frame": "7.0.5",
+ "@types/express": "4.17.20",
+ "@types/express-serve-static-core": "4.17.39",
+ "@types/formidable": "3.4.4",
"@types/glob": "8.1.0",
- "@types/har-format": "1.2.13",
- "@types/invariant": "2.2.35",
- "@types/lodash-es": "4.17.9",
- "@types/node-fetch": "2.6.6",
- "@types/pg": "8.10.5",
+ "@types/har-format": "1.2.14",
+ "@types/invariant": "2.2.36",
+ "@types/lodash-es": "4.17.10",
+ "@types/node-fetch": "2.6.7",
+ "@types/pg": "8.10.7",
"@types/prettier": "2.7.3",
- "@types/react": "18.2.28",
- "@types/react-dom": "18.2.13",
- "@types/react-is": "18.2.2",
- "@types/semver": "7.5.3",
- "@types/serialize-javascript": "5.0.2",
- "@types/whatwg-url": "11.0.1",
- "@types/ws": "8.5.7",
- "@types/yargs": "17.0.28",
+ "@types/react": "18.2.33",
+ "@types/react-dom": "18.2.14",
+ "@types/react-is": "18.2.3",
+ "@types/semver": "7.5.4",
+ "@types/serialize-javascript": "5.0.3",
+ "@types/whatwg-url": "11.0.2",
+ "@types/ws": "8.5.8",
+ "@types/yargs": "17.0.29",
"ajv": "8.12.0",
- "eslint": "8.51.0",
+ "eslint": "8.52.0",
"eslint-config-prettier": "9.0.0",
- "eslint-plugin-import": "2.28.1",
+ "eslint-plugin-import": "2.29.0",
"formidable": "3.5.1",
"get-port": "7.0.0",
"monaco-editor": "0.44.0",
- "react-devtools-inline": "4.28.4",
+ "react-devtools-inline": "4.28.5",
"react-transition-group": "4.4.5",
"webpack": "5.89.0"
},
diff --git a/packages/toolpad-app/src/project.tsx b/packages/toolpad-app/src/project.tsx
index ed9350178f2..234829dd26b 100644
--- a/packages/toolpad-app/src/project.tsx
+++ b/packages/toolpad-app/src/project.tsx
@@ -1,5 +1,5 @@
import { Emitter } from '@mui/toolpad-utils/events';
-import { QueryClient, useQuery, useQueryClient } from '@tanstack/react-query';
+import { QueryClient, useQueryClient, useSuspenseQuery } from '@tanstack/react-query';
import * as React from 'react';
import { useNonNullableContext } from '@mui/toolpad-utils/react';
import invariant from 'invariant';
@@ -75,8 +75,9 @@ export interface ProjectProps {
}
export function ProjectProvider({ url, children }: ProjectProps) {
- const { data: manifest } = useQuery(['app-dev-manifest', url], () => fetchAppDevManifest(url), {
- suspense: true,
+ const { data: manifest } = useSuspenseQuery({
+ queryKey: ['app-dev-manifest', url],
+ queryFn: () => fetchAppDevManifest(url),
});
invariant(manifest, "manifest should be defined, we're using suspense");
diff --git a/packages/toolpad-app/src/rpcClient.ts b/packages/toolpad-app/src/rpcClient.ts
index 10362427ff9..d2158c9c48b 100644
--- a/packages/toolpad-app/src/rpcClient.ts
+++ b/packages/toolpad-app/src/rpcClient.ts
@@ -8,6 +8,9 @@ import {
useQuery,
UseQueryOptions,
UseQueryResult,
+ useSuspenseQuery,
+ UseSuspenseQueryOptions,
+ UseSuspenseQueryResult,
} from '@tanstack/react-query';
import type { MethodsOf, RpcRequest, RpcResponse, MethodResolvers, Methods } from './server/rpc';
@@ -51,7 +54,13 @@ export type RpcClient = MethodsOf;
export interface UseQueryFnOptions any>
extends Omit<
- UseQueryOptions>, unknown, Awaited>, any[]>,
+ UseQueryOptions>, Error, Awaited>, any[]>,
+ 'queryKey' | 'queryFn'
+ > {}
+
+export interface UseSuspenseQueryFnOptions any>
+ extends Omit<
+ UseSuspenseQueryOptions>, Error, Awaited>, any[]>,
'queryKey' | 'queryFn'
> {}
@@ -63,16 +72,25 @@ export interface UseQueryFn {
): UseQueryResult>>;
}
+export interface UseSuspenseQueryFn {
+ (
+ name: K,
+ params: Parameters | null,
+ options?: UseSuspenseQueryFnOptions,
+ ): UseSuspenseQueryResult>>;
+}
+
export interface UseMutationFn {
(
name: K,
- options?: UseMutationOptions>,
- ): UseMutationResult>, unknown, Parameters>;
+ options?: UseMutationOptions>,
+ ): UseMutationResult>, Error, Parameters>;
}
export interface ApiClient> {
methods: M;
useQuery: UseQueryFn;
+ useSuspenseQuery: UseSuspenseQueryFn;
useMutation: UseMutationFn;
refetchQueries: (key: K, params: Parameters) => Promise;
invalidateQueries: (key: K, params: Parameters) => Promise;
@@ -97,12 +115,23 @@ export function createRpcApi(
},
});
},
- useMutation: (key, options) => useMutation((params) => methods[key](...params), options),
+ useSuspenseQuery: (key, params, options) => {
+ return useSuspenseQuery({
+ ...options,
+ queryKey: [key, params],
+ queryFn: () => {
+ invariant(params, 'Query has no parameters');
+ return methods[key](...params);
+ },
+ });
+ },
+ useMutation: (key, options) =>
+ useMutation({ mutationFn: (params) => methods[key](...params), ...options }),
refetchQueries(key, params?) {
- return queryClient.refetchQueries([key, params]);
+ return queryClient.refetchQueries({ queryKey: [key, params] });
},
invalidateQueries(key, params) {
- return queryClient.invalidateQueries([key, params]);
+ return queryClient.invalidateQueries({ queryKey: [key, params] });
},
};
}
diff --git a/packages/toolpad-app/src/runtime/ToolpadApp.tsx b/packages/toolpad-app/src/runtime/ToolpadApp.tsx
index 506f616779a..715fb815c0e 100644
--- a/packages/toolpad-app/src/runtime/ToolpadApp.tsx
+++ b/packages/toolpad-app/src/runtime/ToolpadApp.tsx
@@ -118,7 +118,8 @@ const internalComponents: ToolpadComponents = Object.fromEntries(
);
const ReactQueryDevtoolsProduction = React.lazy(() =>
- import('@tanstack/react-query-devtools/build/lib/index.prod.js').then((d) => ({
+ // eslint-disable-next-line import/extensions
+ import('@tanstack/react-query-devtools/build/modern/production.js').then((d) => ({
default: d.ReactQueryDevtools,
})),
);
@@ -1281,18 +1282,16 @@ function MutationNode({ node, page }: MutationNodeProps) {
);
const {
- isLoading,
+ isPending,
data: responseData = EMPTY_OBJECT,
error: fetchError,
mutateAsync,
- } = useMutation(
- async (overrides: any = {}) => {
+ } = useMutation({
+ mutationKey: [node.name, params],
+ mutationFn: async (overrides: any = {}) => {
return api.methods.execQuery(page.name, node.name, { ...params, ...overrides });
},
- {
- mutationKey: [node.name, params],
- },
- );
+ });
const { data, error: apiError } = responseData || EMPTY_OBJECT;
@@ -1304,8 +1303,8 @@ function MutationNode({ node, page }: MutationNodeProps) {
await mutateAsync(overrides);
};
return {
- isLoading,
- isFetching: isLoading,
+ isLoading: isPending,
+ isFetching: isPending,
error,
data,
rows: Array.isArray(data) ? data : EMPTY_ARRAY,
@@ -1315,7 +1314,7 @@ function MutationNode({ node, page }: MutationNodeProps) {
throw new Error(`refetch is not supported in manual queries`);
},
};
- }, [isLoading, error, data, mutateAsync]);
+ }, [isPending, error, data, mutateAsync]);
React.useEffect(() => {
for (const [key, value] of Object.entries(mutationResult)) {
diff --git a/packages/toolpad-app/src/runtime/useDataQuery.ts b/packages/toolpad-app/src/runtime/useDataQuery.ts
index c38c87f6ecd..07b6999a715 100644
--- a/packages/toolpad-app/src/runtime/useDataQuery.ts
+++ b/packages/toolpad-app/src/runtime/useDataQuery.ts
@@ -48,14 +48,12 @@ export function useDataQuery(
error: fetchError,
data: responseData = EMPTY_OBJECT,
refetch,
- } = useQuery(
- [pageName, queryName, params],
- () => api.methods.execQuery(pageName, queryName, params),
- {
- ...options,
- enabled: isNodeAvailableOnServer && enabled,
- },
- );
+ } = useQuery({
+ queryKey: [pageName, queryName, params],
+ queryFn: () => api.methods.execQuery(pageName, queryName, params),
+ ...options,
+ enabled: isNodeAvailableOnServer && enabled,
+ });
const { data, error: apiError } = responseData;
diff --git a/packages/toolpad-app/src/server/secrets.ts b/packages/toolpad-app/src/server/secrets.ts
deleted file mode 100644
index ee6e1b24d5f..00000000000
--- a/packages/toolpad-app/src/server/secrets.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import UTF8 from 'crypto-js/enc-utf8';
-import AES from 'crypto-js/aes';
-import config from './config';
-
-/*
- * Proposed strategy:
- * Secrets are encrypted if at least one key is provided. If no keys are provided, the secrets are not encrypted
- * When multiple keys are provided, each key is tried, in order, to decrypt the secret, first one to work wins
- * This will allow for seamless key rotation down the line:
- * - add the new key as first in the list so that newly added or updated secrets use the new key
- * - Manual command to de-encrypt all secrets with the old key and re-encrypt with the new key
- * (ignore if secret can't be decrypted with the old key, it means it's already using the new key, or another old key)
- * - remove the old key from the list
- */
-
-const IDENTITY = (value: T): T => value;
-
-interface BoxedSecret {
- value: string;
-}
-
-function boxSecret(decoded: string): string {
- const boxed: BoxedSecret = { value: decoded };
- return JSON.stringify(boxed);
-}
-
-function unboxSecret(encoded: string): string {
- const boxed: BoxedSecret = JSON.parse(encoded);
- return boxed.value;
-}
-
-const encryptionMethod =
- config.encryptionKeys.length > 0
- ? (value: string): string => AES.encrypt(value, config.encryptionKeys[0]).toString()
- : IDENTITY;
-
-const decryptionMethods: ((value: string) => string)[] = [
- IDENTITY,
- ...config.encryptionKeys.map((key) => {
- return (value: string) => AES.decrypt(value, key).toString(UTF8);
- }),
-];
-
-export function encryptSecret(value: string): string {
- return encryptionMethod(boxSecret(value));
-}
-
-export function decryptSecret(value: string): string {
- for (const decryptionMethod of decryptionMethods) {
- try {
- return unboxSecret(decryptionMethod(value));
- } catch {
- // ignore
- }
- }
-
- throw new Error(`Failed to decrypt secret`);
-}
diff --git a/packages/toolpad-app/src/server/toolpadAppBuilder.ts b/packages/toolpad-app/src/server/toolpadAppBuilder.ts
index 1a051e9d270..f18c2c7da33 100644
--- a/packages/toolpad-app/src/server/toolpadAppBuilder.ts
+++ b/packages/toolpad-app/src/server/toolpadAppBuilder.ts
@@ -245,7 +245,7 @@ export function createViteConfig({
'@mui/x-date-pickers/LocalizationProvider',
'@mui/x-license-pro',
'@tanstack/react-query',
- '@tanstack/react-query-devtools/build/lib/index.prod.js',
+ '@tanstack/react-query-devtools/build/modern/production.js',
'dayjs',
'dayjs/locale/en',
'dayjs/locale/fr',
diff --git a/packages/toolpad-app/src/toolpad/AppState.tsx b/packages/toolpad-app/src/toolpad/AppState.tsx
index 004511d3066..40c93577df0 100644
--- a/packages/toolpad-app/src/toolpad/AppState.tsx
+++ b/packages/toolpad-app/src/toolpad/AppState.tsx
@@ -445,7 +445,7 @@ export interface DomContextProps {
export default function AppProvider({ appUrl, children }: DomContextProps) {
const projectApi = useProjectApi();
- const { data: dom } = projectApi.useQuery('loadDom', [], { suspense: true });
+ const { data: dom } = projectApi.useSuspenseQuery('loadDom', []);
invariant(dom, 'Suspense should load the dom');
diff --git a/packages/toolpad-app/src/toolpad/ToolpadShell/Header/UserFeedback/index.tsx b/packages/toolpad-app/src/toolpad/ToolpadShell/Header/UserFeedback/index.tsx
index 3b41b79d5ab..927d1b2f6dc 100644
--- a/packages/toolpad-app/src/toolpad/ToolpadShell/Header/UserFeedback/index.tsx
+++ b/packages/toolpad-app/src/toolpad/ToolpadShell/Header/UserFeedback/index.tsx
@@ -19,13 +19,7 @@ import HelpOutlinedIcon from '@mui/icons-material/HelpOutlined';
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
import invariant from 'invariant';
import useMenu from '../../../../utils/useMenu';
-import {
- TOOLPAD_TARGET_CLOUD,
- TOOLPAD_TARGET_CE,
- TOOLPAD_TARGET_PRO,
- DOCUMENTATION_URL,
- VERSION_CHECK_INTERVAL,
-} from '../../../../constants';
+import { DOCUMENTATION_URL, VERSION_CHECK_INTERVAL } from '../../../../constants';
import { useProjectApi } from '../../../../projectApi';
import useBoolean from '../../../../utils/useBoolean';
import type { PackageManager } from '../../../../server/versionInfo';
@@ -33,7 +27,7 @@ import type { PackageManager } from '../../../../server/versionInfo';
const REPORT_BUG_URL =
'https://github.com/mui/mui-toolpad/issues/new?assignees=&labels=status%3A+needs+triage&template=1.bug.yml';
const FEATURE_REQUEST_URL = 'https://github.com/mui/mui-toolpad/issues';
-
+const SUPPORT_URL = 'https://mui.com/toolpad/getting-started/support';
interface SnippetProps {
children: string;
}
@@ -69,19 +63,6 @@ function FeedbackMenuItemLink({ href, children }: FeedbackMenuItemLinkProps) {
);
}
-function getReadableTarget(): string {
- switch (process.env.TOOLPAD_TARGET) {
- case TOOLPAD_TARGET_CLOUD:
- return 'Cloud';
- case TOOLPAD_TARGET_CE:
- return 'Community Edition';
- case TOOLPAD_TARGET_PRO:
- return 'Pro';
- default:
- return 'Unknown';
- }
-}
-
function getUpgradeMessage(packageManager: PackageManager | null): string {
const pkgName = '@mui/toolpad';
switch (packageManager) {
@@ -142,8 +123,8 @@ function UserFeedback() {
Request or upvote feature
+ Request support
-