diff --git a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/EditChallenge.js b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/EditChallenge.js index f116354e1..829ae6270 100644 --- a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/EditChallenge.js +++ b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/EditChallenge.js @@ -758,10 +758,6 @@ export class EditChallenge extends Component { this.isFinishing = false; prevStep(stepName); }} - nextStep={() => { - this.isFinishing = false; - nextStep(); - }} finish={() => { this.isFinishing = true; this.handleSubmit(); @@ -977,10 +973,6 @@ export class EditChallenge extends Component { this.isFinishing = false; prevStep(stepName); }} - nextStep={() => { - this.isFinishing = false; - nextStep(); - }} finish={() => { this.isFinishing = true; this.handleSubmit(); diff --git a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/Schemas/AutomatedEditsCodeAgreementSchema.js b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/Schemas/AutomatedEditsCodeAgreementSchema.js index 847757758..80e673272 100644 --- a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/Schemas/AutomatedEditsCodeAgreementSchema.js +++ b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/Schemas/AutomatedEditsCodeAgreementSchema.js @@ -14,7 +14,7 @@ export const jsSchema = (intl) => { title: intl.formatMessage(messages.automatedEditsCodeLabel), type: "boolean", default: false, - enum: [false, true], + enum: [true], agreementDescription: intl.formatMessage(messages.automatedEditsCodeDescription), checkboxLabel: messages.automatedEditsCodeUICheckboxLabel } diff --git a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/Schemas/InstructionsSchema.js b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/Schemas/InstructionsSchema.js index 82a82b2d4..44894ca0e 100644 --- a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/Schemas/InstructionsSchema.js +++ b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/Schemas/InstructionsSchema.js @@ -16,8 +16,15 @@ import messages from '../Messages' * * @author [Neil Rotstan](https://github.com/nrotstan) */ + +const validateMinLength = val => { + if(!isNaN(val)) return val | 0 + return 150 +} + export const jsSchema = (intl) => { - const instructionsMinLength = process.env.REACT_APP_CHALLENGE_INSTRUCTIONS_MIN_LENGTH || 150 + const instructionsMinLength = validateMinLength(process.env.REACT_APP_CHALLENGE_INSTRUCTIONS_MIN_LENGTH) + const schemaFields = { "$schema": "http://json-schema.org/draft-07/schema#", type: "object", diff --git a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/WorkflowSteps.js b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/WorkflowSteps.js index c1b0349b4..87ef6ef75 100644 --- a/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/WorkflowSteps.js +++ b/src/components/AdminPane/Manage/ManageChallenges/EditChallenge/WorkflowSteps.js @@ -182,6 +182,10 @@ const newChallengeSteps = { next: 'AutomatedEditsCodeAgreement', previous: 'Description', }), + 'AutomatedEditsCodeAgreement': Object.assign({}, automatedEditsCodeAgreementStep, { + next: 'AdvancedOptions', + previous: 'Instructions' + }), 'AdvancedOptions': Object.assign({}, advancedOptionsStep, { next: [ 'Discoverability', @@ -236,10 +240,6 @@ const newChallengeSteps = { previous: 'AdvancedOptions', canFinish: true, }), - 'AutomatedEditsCodeAgreement': Object.assign({}, automatedEditsCodeAgreementStep, { - next: 'AdvancedOptions', - previous: 'Instructions' - }) } // String together workflow steps for editing an existing challenge diff --git a/src/components/AdminPane/Manage/StepNavigation/StepNavigation.js b/src/components/AdminPane/Manage/StepNavigation/StepNavigation.js index ab14282e1..89e76237a 100644 --- a/src/components/AdminPane/Manage/StepNavigation/StepNavigation.js +++ b/src/components/AdminPane/Manage/StepNavigation/StepNavigation.js @@ -37,8 +37,8 @@ export default class StepNavigation extends Component { {_isString(this.props.activeStep.next) &&