Merge pull request #14979 from padulam/feature/bug-modal-issue-link
Updates create issue button in bug modal to direct user to forum
This commit is contained in:
@ -68,7 +68,7 @@ export class BugModal extends PureComponent {
|
|||||||
bsStyle='primary'
|
bsStyle='primary'
|
||||||
onClick={ createIssue }
|
onClick={ createIssue }
|
||||||
>
|
>
|
||||||
Create my GitHub issue
|
Create topic for issue in community forum
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
block={ true }
|
block={ true }
|
||||||
|
@ -31,7 +31,7 @@ export default function bugSaga(actions$, getState, { window }) {
|
|||||||
.map(({ type }) => {
|
.map(({ type }) => {
|
||||||
const {
|
const {
|
||||||
challengesApp: {
|
challengesApp: {
|
||||||
challenge: challengeName,
|
legacyKey: challengeName,
|
||||||
files
|
files
|
||||||
}
|
}
|
||||||
} = getState();
|
} = getState();
|
||||||
@ -39,34 +39,45 @@ export default function bugSaga(actions$, getState, { window }) {
|
|||||||
navigator: { userAgent },
|
navigator: { userAgent },
|
||||||
location: { href }
|
location: { href }
|
||||||
} = window;
|
} = window;
|
||||||
|
let titleText = challengeName;
|
||||||
if (type === types.openIssueSearch) {
|
if (type === types.openIssueSearch) {
|
||||||
window.open(
|
window.open(
|
||||||
'https://github.com/freeCodeCamp/freeCodeCamp/issues?q=' +
|
'https://forum.freecodecamp.com/search?q=' +
|
||||||
'is:issue is:all ' +
|
window.encodeURIComponent(titleText)
|
||||||
challengeName
|
);
|
||||||
|
} else {
|
||||||
|
titleText = 'Need assistance in ' + challengeName;
|
||||||
|
let textMessage = [
|
||||||
|
'#### Challenge Name\n',
|
||||||
|
'[',
|
||||||
|
challengeName,
|
||||||
|
'](',
|
||||||
|
href,
|
||||||
|
') has an issue.\n',
|
||||||
|
'#### Issue Description\n',
|
||||||
|
'<!-- Describe below when the issue happens and how to ',
|
||||||
|
'reproduce it -->\n\n\n',
|
||||||
|
'#### Browser Information\n',
|
||||||
|
'<!-- Describe your workspace in which you are having issues-->\n',
|
||||||
|
'User Agent is: <code>',
|
||||||
|
userAgent,
|
||||||
|
'</code>.\n\n',
|
||||||
|
'#### Screenshot\n',
|
||||||
|
'<!-- Add a screenshot of your issue -->\n\n\n',
|
||||||
|
'#### Your Code'
|
||||||
|
].join('');
|
||||||
|
const body = filesToMarkdown(files);
|
||||||
|
if (body.length > 10) {
|
||||||
|
textMessage = textMessage + body;
|
||||||
|
}
|
||||||
|
window.open(
|
||||||
|
'https://forum.freecodecamp.com/new-topic?category=General&title=' +
|
||||||
|
window.encodeURIComponent(titleText) + '&body=' +
|
||||||
|
window.encodeURIComponent(textMessage),
|
||||||
|
'_blank'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let textMessage = [
|
|
||||||
'Challenge [',
|
|
||||||
challengeName,
|
|
||||||
'](',
|
|
||||||
href,
|
|
||||||
') has an issue.\n',
|
|
||||||
'User Agent is: <code>',
|
|
||||||
userAgent,
|
|
||||||
'</code>.\n',
|
|
||||||
'Please describe how to reproduce this issue, and include ',
|
|
||||||
'links to screenshots if possible.\n\n'
|
|
||||||
].join('');
|
|
||||||
const body = filesToMarkdown(files);
|
|
||||||
if (body.length > 10) {
|
|
||||||
textMessage = textMessage + body;
|
|
||||||
}
|
|
||||||
window.open(
|
|
||||||
'https://github.com/freecodecamp/freecodecamp/issues/new?&body=' +
|
|
||||||
window.encodeURIComponent(textMessage),
|
|
||||||
'_blank'
|
|
||||||
);
|
|
||||||
return closeBugModal();
|
return closeBugModal();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user