feat: update Ask for help (#40114)
* feat: get helpCategory from frontmatter * DEBUG: sets all the projects to JavaScript This is just so the tests pass, it'll need to go. * fix: updated helpCategoryMap categories * fix: added Python to helpCategory frontmatter key Co-authored-by: Randell Dawson <rdawson@onepathtech.com>
This commit is contained in:
committed by
GitHub
parent
7857dc53f4
commit
e4a9b2988c
@@ -7,7 +7,6 @@ import {
|
||||
challengeMetaSelector
|
||||
} from '../redux';
|
||||
import { tap, mapTo } from 'rxjs/operators';
|
||||
import { helpCategory } from '../../../../utils/challengeTypes';
|
||||
import { forumLocation } from '../../../../../config/env.json';
|
||||
|
||||
function filesToMarkdown(files = {}) {
|
||||
@@ -29,7 +28,9 @@ function createQuestionEpic(action$, state$, { window }) {
|
||||
tap(() => {
|
||||
const state = state$.value;
|
||||
const files = challengeFilesSelector(state);
|
||||
const { block, title: challengeTitle } = challengeMetaSelector(state);
|
||||
const { title: challengeTitle, helpCategory } = challengeMetaSelector(
|
||||
state
|
||||
);
|
||||
const {
|
||||
navigator: { userAgent },
|
||||
location: { href }
|
||||
@@ -69,13 +70,13 @@ function createQuestionEpic(action$, state$, { window }) {
|
||||
\`\`\`
|
||||
|
||||
Replace these two sentences with your copied code.
|
||||
Please leave the \`\`\` line above and the \`\`\` line below,
|
||||
Please leave the \`\`\` line above and the \`\`\` line below,
|
||||
because they allow your code to properly format in the post.
|
||||
|
||||
\`\`\`\n${endingText}`
|
||||
);
|
||||
|
||||
const category = window.encodeURIComponent(helpCategory[block] || 'Help');
|
||||
const category = window.encodeURIComponent(helpCategory || 'Help');
|
||||
|
||||
const studentCode = window.encodeURIComponent(textMessage);
|
||||
const altStudentCode = window.encodeURIComponent(altTextMessage);
|
||||
|
Reference in New Issue
Block a user