diff --git a/content/pages/publish.json b/content/pages/publish.json index 59ea6e2e7..58487ac67 100644 --- a/content/pages/publish.json +++ b/content/pages/publish.json @@ -20,12 +20,19 @@ }, { "name": "files", - "label": "Files", + "label": "File", "placeholder": "e.g. https://file.com/file.json", "help": "Please provide a URL to your data set file.", "type": "files", "required": true }, + { + "name": "links", + "label": "Sample file", + "placeholder": "e.g. https://file.com/samplefile.json", + "help": "Please provide a URL to a sample of your data set file. This file should reveal the data structure of your data set, e.g. by including the header and one line of a CSV file.", + "type": "files" + }, { "name": "access", "label": "Access Type", diff --git a/src/components/atoms/Button.tsx b/src/components/atoms/Button.tsx index 7e3769742..6327e46f1 100644 --- a/src/components/atoms/Button.tsx +++ b/src/components/atoms/Button.tsx @@ -17,6 +17,8 @@ interface ButtonProps { style?: 'primary' | 'ghost' | 'text' type?: 'submit' download?: boolean + target?: string + rel?: string } export default function Button({ diff --git a/src/components/pages/Publish/Preview.tsx b/src/components/pages/Publish/Preview.tsx index 00789ebbb..79655a7c1 100644 --- a/src/components/pages/Publish/Preview.tsx +++ b/src/components/pages/Publish/Preview.tsx @@ -6,6 +6,7 @@ import MetaItem from '../../organisms/AssetContent/MetaItem' import styles from './Preview.module.css' import File from '../../atoms/File' import { MetadataPublishForm } from '../../../@types/MetaData' +import Button from '../../atoms/Button' export default function Preview({ values @@ -25,6 +26,18 @@ export default function Preview({ small /> )} + {values.links && values.links.length && ( + + )} {values.tags && } @@ -37,6 +50,7 @@ export default function Preview({ key.includes('description') || key.includes('tags') || key.includes('files') || + key.includes('links') || key.includes('termsAndConditions') || key.includes('price') || value === undefined || diff --git a/src/components/pages/Publish/PublishForm.tsx b/src/components/pages/Publish/PublishForm.tsx index ac4ff747e..7b927adf2 100644 --- a/src/components/pages/Publish/PublishForm.tsx +++ b/src/components/pages/Publish/PublishForm.tsx @@ -1,6 +1,6 @@ import React, { ReactElement, useEffect, FormEvent } from 'react' import styles from './PublishForm.module.css' -import { useOcean, usePublish } from '@oceanprotocol/react' +import { useOcean } from '@oceanprotocol/react' import { useFormikContext, Form, Field } from 'formik' import Input from '../../atoms/Input' import Button from '../../atoms/Button' @@ -25,7 +25,6 @@ export default function PublishForm({ setErrors, setTouched, resetForm, - setValues, initialValues } = useFormikContext() const formName = 'ocean-publish-form' diff --git a/src/components/pages/Publish/index.tsx b/src/components/pages/Publish/index.tsx index 187d28750..94c38ab6b 100644 --- a/src/components/pages/Publish/index.tsx +++ b/src/components/pages/Publish/index.tsx @@ -27,12 +27,6 @@ export default function PublishPage({ values: MetadataPublishForm, resetForm: () => void ): Promise { - // console.log(` - // Collected form values: - // ---------------------- - // ${JSON.stringify(values, null, 2)} - // `) - const metadata = transformPublishFormToMetadata(values) const { tokensToMint, @@ -42,13 +36,6 @@ export default function PublishPage({ } = values.price const serviceType = values.access === 'Download' ? 'access' : 'compute' - // console.log(` - // Transformed metadata values: - // ---------------------- - // ${JSON.stringify(metadata, null, 2)} - // Tokens to mint: ${tokensToMint} - // `) - try { // mpAddress and mpFee are not yet implemented in ocean js so are not uset const ddo = await publish(