From 21ca4e3f67096e4827c94773e2f232c49c7564ca Mon Sep 17 00:00:00 2001 From: Shaun Hamilton <51722130+Sky020@users.noreply.github.com> Date: Thu, 7 May 2020 17:19:06 +0100 Subject: [PATCH] fix(client): add relevant placeholder to link submission (#38411) --- .../{ProjectForm.js => SolutionForm.js} | 28 ++++---- .../Challenges/projects/backend/Show.js | 64 ++++++------------- .../Challenges/projects/frontend/Show.js | 20 +++--- .../Challenges/redux/completion-epic.js | 4 +- .../src/templates/Challenges/redux/index.js | 8 +-- 5 files changed, 50 insertions(+), 74 deletions(-) rename client/src/templates/Challenges/projects/{ProjectForm.js => SolutionForm.js} (64%) diff --git a/client/src/templates/Challenges/projects/ProjectForm.js b/client/src/templates/Challenges/projects/SolutionForm.js similarity index 64% rename from client/src/templates/Challenges/projects/ProjectForm.js rename to client/src/templates/Challenges/projects/SolutionForm.js index d2323d8d5b..6935bf882f 100644 --- a/client/src/templates/Challenges/projects/ProjectForm.js +++ b/client/src/templates/Challenges/projects/SolutionForm.js @@ -5,13 +5,14 @@ import { Form } from '../../../components/formHelpers'; const propTypes = { isFrontEnd: PropTypes.bool, + isProject: PropTypes.bool, isSubmitting: PropTypes.bool, onSubmit: PropTypes.func.isRequired, - updateProjectForm: PropTypes.func.isRequired + updateSolutionForm: PropTypes.func.isRequired }; -const frontEndFields = ['solution']; -const backEndFields = ['solution', 'githubLink']; +const challengeFields = ['solution']; +const backEndProjectFields = ['solution', 'githubLink']; const options = { types: { @@ -21,38 +22,39 @@ const options = { required: ['solution'] }; -export class ProjectForm extends Component { +export class SolutionForm extends Component { constructor(props) { super(props); this.handleSubmit = this.handleSubmit.bind(this); } componentDidMount() { - this.props.updateProjectForm({}); + this.props.updateSolutionForm({}); } handleSubmit(values) { - this.props.updateProjectForm(values); + this.props.updateSolutionForm(values); this.props.onSubmit(); } render() { - const { isSubmitting, isFrontEnd } = this.props; + const { isSubmitting, isFrontEnd, isProject } = this.props; const buttonCopy = isSubmitting ? 'Submit and go to my next challenge' : "I've completed this challenge"; return (
- {challengeType === backend ? ( - - ) : ( -