From 9069947ca10ffb94c39b15703fc6988596f224b6 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 28 Feb 2019 14:24:04 -0300 Subject: [PATCH] form.steps fix, add todos --- src/routes/Publish/index.tsx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/routes/Publish/index.tsx b/src/routes/Publish/index.tsx index c02e8c9..00ad0d9 100644 --- a/src/routes/Publish/index.tsx +++ b/src/routes/Publish/index.tsx @@ -7,7 +7,7 @@ import { User } from '../../context/User' import Step from './Step' import Progress from './Progress' -import form from '../../data/form-publish.json' +import { steps } from '../../data/form-publish.json' type AssetType = 'dataset' | 'algorithm' | 'container' | 'workflow' | 'other' @@ -82,7 +82,7 @@ class Publish extends Component<{}, PublishState> { private next = () => { let { currentStep } = this.state - const totalSteps = form.steps.length + const totalSteps = steps.length currentStep = currentStep >= totalSteps - 1 ? totalSteps : currentStep + 1 @@ -147,7 +147,8 @@ class Publish extends Component<{}, PublishState> { // // Step 1 // - // TODO: also validate files with validationStatus[1].files here + // TODO: also validate files with validationStatus[1].files here, + // change event for hidden file input is not working // if (validationStatus[1].name) { this.setState(prevState => ({ @@ -166,6 +167,9 @@ class Publish extends Component<{}, PublishState> { // // Step 2 // + // TODO: validationStatus[2].categories is not working, + // select change event is not firing + // if (validationStatus[2].description && validationStatus[2].categories) { this.setState(prevState => ({ validationStatus: { @@ -183,6 +187,9 @@ class Publish extends Component<{}, PublishState> { // // Step 3 // + // TODO: validationStatus[3].license is not working, + // select change event is not firing + // if ( validationStatus[3].author && validationStatus[3].copyrightHolder && @@ -262,13 +269,10 @@ class Publish extends Component<{}, PublishState> { title="Publish" description="Publish a new data set into the Ocean Protocol Network." > - +
- {form.steps.map((step: any, index: number) => ( + {steps.map((step: any, index: number) => ( { state={this.state} next={this.next} prev={this.prev} - totalSteps={form.steps.length} + totalSteps={steps.length} tryAgain={this.tryAgain} toStart={this.toStart} content={step.content}