fix(help): change help button to direct user to correct forum (#284)
* fix(help): change help button to direct user to correct forum * Refactor category selection to challengeTypes
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
cd98a39bfe
commit
3801cecb72
@ -7,6 +7,7 @@ import {
|
|||||||
} from '../redux';
|
} from '../redux';
|
||||||
import { tap } from 'rxjs/operators/tap';
|
import { tap } from 'rxjs/operators/tap';
|
||||||
import { mapTo } from 'rxjs/operators/mapTo';
|
import { mapTo } from 'rxjs/operators/mapTo';
|
||||||
|
import { helpCategory } from '../../../../utils/challengeTypes';
|
||||||
|
|
||||||
function filesToMarkdown(files = {}) {
|
function filesToMarkdown(files = {}) {
|
||||||
const moreThenOneFile = Object.keys(files).length > 1;
|
const moreThenOneFile = Object.keys(files).length > 1;
|
||||||
@ -53,11 +54,10 @@ function createQuestionEpic(action$, { getState }, { window }) {
|
|||||||
'**Link to the challenge:**\n',
|
'**Link to the challenge:**\n',
|
||||||
href
|
href
|
||||||
].join('');
|
].join('');
|
||||||
const categories = ['HTML-CSS', 'JavaScript'];
|
|
||||||
window.open(
|
window.open(
|
||||||
'https://forum.freecodecamp.org/new-topic' +
|
'https://forum.freecodecamp.org/new-topic' +
|
||||||
'?category=' +
|
'?category=' +
|
||||||
window.encodeURIComponent(categories[challengeType] || 'Help') +
|
window.encodeURIComponent(helpCategory[challengeType] || 'Help') +
|
||||||
'&title=' +
|
'&title=' +
|
||||||
window.encodeURIComponent(challengeTitle) +
|
window.encodeURIComponent(challengeTitle) +
|
||||||
'&body=' +
|
'&body=' +
|
||||||
|
@ -65,3 +65,11 @@ exports.submitTypes = {
|
|||||||
[backend]: 'backend',
|
[backend]: 'backend',
|
||||||
[modern]: 'tests'
|
[modern]: 'tests'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// determine which help forum questions should be posted to
|
||||||
|
exports.helpCategory = {
|
||||||
|
[html]: 'HTML-CSS',
|
||||||
|
[js]: 'JavaScript',
|
||||||
|
[backend]: 'JavaScript',
|
||||||
|
[modern]: 'JavaScript'
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user