Skip to content

Commit

Permalink
[docs-infra] Open demo crash in the right repository (mui#39006)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and christophermorin committed Sep 21, 2023
1 parent 3ad4f1f commit 40a5aa1
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/src/modules/components/DemoErrorBoundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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: `
<!-- Please make sure you have fulfilled the following items before submitting -->
<!-- Checked checkbox should look like this: [x] -->
- [ ] 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
Expand All @@ -71,15 +71,15 @@ export default class DemoErrorBoundary extends React.Component {
This demo had a runtime error!
</Typography>
<Typography>
We would appreciate it if you{' '}
{'We would appreciate it if you '}
<Link href={issueLink} rel="noreferrer" target="_blank">
report this error
</Link>{' '}
directly in our issue tracker. You will be provided with a prefilled description that
includes valuable information about this error.
</Link>
{` 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.`}
</Typography>
<pre style={{ whiteSpace: 'pre-wrap' }}>{error.toString()}</pre>
<Button color="secondary" onClick={onResetDemoClick} variant="text">
<Button onClick={onResetDemoClick} variant="text">
{t('resetDemo')}
</Button>
</div>
Expand Down

0 comments on commit 40a5aa1

Please sign in to comment.