From 40a5aa131a2065aac54e176dc606295fad2e261b Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Mon, 18 Sep 2023 20:51:23 +0200 Subject: [PATCH] [docs-infra] Open demo crash in the right repository (#39006) --- .../modules/components/DemoErrorBoundary.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/src/modules/components/DemoErrorBoundary.js b/docs/src/modules/components/DemoErrorBoundary.js index bc79d35ae813fb..5817e494b47509 100644 --- a/docs/src/modules/components/DemoErrorBoundary.js +++ b/docs/src/modules/components/DemoErrorBoundary.js @@ -9,7 +9,7 @@ import Button from '@mui/material/Button'; * with node 8 + IE11 support i.e. not using URL (URLSearchParams.set replaced with Map.set) */ function newGitHubIssueUrl(options) { - const url = `https://github.com/${options.user}/${options.repo}/issues/new`; + const url = `${process.env.SOURCE_CODE_REPO}/issues/new`; const query = Object.keys(options) .map((type) => { @@ -38,23 +38,23 @@ export default class DemoErrorBoundary extends React.Component { const title = `[docs] Demo ${name} crashes`; const searchQuery = encodeURIComponent(`is:issue ${title}`); const issueLink = newGitHubIssueUrl({ - user: 'mui', - repo: 'material-ui', title, body: ` -- [ ] I have [searched for similar issues](https://github.com/mui/material-ui/issues?q=${searchQuery}) in this repository and believe that this is not a duplicate. +- [ ] I have [searched for similar issues](${ + process.env.SOURCE_CODE_REPO + }/issues?q=${searchQuery}) in this repository and believe that this is not a duplicate. -## Steps to Reproduce +## Steps to reproduce 1. Visit ${window.location.href} 2. ?? 3. demo *${name}* crashes -## Your Environment +## Your environment | Tech | Version | |--------------|---------| -| MUI | v${process.env.LIB_VERSION} | +| Version | v${process.env.LIB_VERSION} | | Netlify deploy | ${process.env.NETLIFY_DEPLOY_URL} | | Browser | ${ typeof window !== 'undefined' && window.navigator @@ -71,15 +71,15 @@ export default class DemoErrorBoundary extends React.Component { This demo had a runtime error! - We would appreciate it if you{' '} + {'We would appreciate it if you '} report this error - {' '} - directly in our issue tracker. You will be provided with a prefilled description that - includes valuable information about this error. + + {` directly in our issue tracker with the steps you took to trigger it. +The "report this error" link prefills the issue description with valuable information.`}
{error.toString()}
-