@samitouri / QOS-React / commits / 4ca62cac45

Improve DevTools bug template text (#21413)

Brian Vaughn committed May 3, 2021 at 16:57 UTC 4ca62cac45c288878d2532e5056981d177f9fdac
1 file changed +37 -19
packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ReportNewIssue.js
+37 -19
@@ -11,6 +11,10 @@ import * as React from 'react';
11 import Icon from '../Icon';
12 import styles from './shared.css';
13
14 +function encodeURIWrapper(string: string): string {
15 + return encodeURI(string).replace(/#/g, '%23');
16 +}
17 +
18 type Props = {|
19 callStack: string | null,
20 componentStack: string | null,
@@ -28,26 +32,40 @@ export default function ReportNewIssue({
32 }
33
34 const title = `Error: "${errorMessage || ''}"`;
31 - const label = 'Component: Developer Tools';
32 -
33 - let body = 'Describe what you were doing when the bug occurred:';
34 - body += '\n1. ';
35 - body += '\n2. ';
36 - body += '\n3. ';
37 - body += '\n\n---------------------------------------------';
38 - body += '\nPlease do not remove the text below this line';
39 - body += '\n---------------------------------------------';
40 - body += `\n\nDevTools version: ${process.env.DEVTOOLS_VERSION || ''}`;
41 - if (callStack) {
42 - body += `\n\nCall stack: ${callStack.trim()}`;
43 - }
44 - if (componentStack) {
45 - body += `\n\nComponent stack: ${componentStack.trim()}`;
46 - }
35 + const labels = ['Component: Developer Tools', 'Status: Unconfirmed'];
36 +
37 + const body = `
38 +<!-- Please answer both questions below before submitting this issue. -->
39 +
40 +### Which website or app were you using when the bug happened?
41 +
42 +Please provide a link to the URL of the website (if it is public), a CodeSandbox (https://codesandbox.io/s/new) example that reproduces the bug, or a project on GitHub that we can checkout and run locally.
43 +
44 +### What were you doing on the website or app when the bug happened?
45 +
46 +If possible, please describe how to reproduce this bug on the website or app mentioned above:
47 +1. <!-- FILL THIS IN -->
48 +2. <!-- FILL THIS IN -->
49 +3. <!-- FILL THIS IN -->
50 +
51 +<!--------------------------------------------------->
52 +<!-- Please do not remove the text below this line -->
53 +<!--------------------------------------------------->
54 +
55 +### Generated information
56 +
57 +DevTools version: ${process.env.DEVTOOLS_VERSION || ''}
58 +
59 +Call stack:
60 +${callStack || '(not available)'}
61 +
62 +Component stack:
63 +${componentStack || '(not available)'}
64 + `;
65
48 - bugURL += `/issues/new?labels=${encodeURI(label)}&title=${encodeURI(
49 - title,
50 - )}&body=${encodeURI(body)}`;
66 + bugURL += `/issues/new?labels=${encodeURIWrapper(
67 + labels.join(','),
68 + )}&title=${encodeURIWrapper(title)}&body=${encodeURIWrapper(body.trim())}`;
69
70 return (
71 <div className={styles.GitHubLinkRow}>