From 98ff6823e2a4a36a2a148aa301e1dbfaab4a9ab6 Mon Sep 17 00:00:00 2001 From: Shaun Hamilton <51722130+ShaunSHamilton@users.noreply.github.com> Date: Tue, 9 Feb 2021 05:53:10 +0000 Subject: [PATCH] feat(learn): add backend solution url to help post (#40950) Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> --- .../Challenges/redux/create-question-epic.js | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/client/src/templates/Challenges/redux/create-question-epic.js b/client/src/templates/Challenges/redux/create-question-epic.js index 9eedf5cab97..1d654ada91c 100644 --- a/client/src/templates/Challenges/redux/create-question-epic.js +++ b/client/src/templates/Challenges/redux/create-question-epic.js @@ -4,7 +4,8 @@ import { types, closeModal, challengeFilesSelector, - challengeMetaSelector + challengeMetaSelector, + projectFormValuesSelector } from '../redux'; import { tap, mapTo } from 'rxjs/operators'; import { forumLocation } from '../../../../../config/env.json'; @@ -35,7 +36,9 @@ function createQuestionEpic(action$, state$, { window }) { navigator: { userAgent }, location: { href } } = window; - + const projectFormValues = Object.entries( + projectFormValuesSelector(state) + ); const endingText = dedent( `**Your browser information:** @@ -48,8 +51,18 @@ function createQuestionEpic(action$, state$, { window }) { ); let textMessage = dedent( - `**Tell us what's happening:**\n\n\n\n**Your code so far** - ${filesToMarkdown(files)}\n${endingText}` + `**Tell us what's happening:** + \n\n + ${ + projectFormValues.length + ? `**Your project link(s)**\n` + : `**Your code so far**` + } + ${projectFormValues + ?.map(([key, val]) => `${key}: ${val}\n`) + ?.join('') || filesToMarkdown(files)} + \n + ${endingText}` ); const altTextMessage = dedent(