mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
data structure cleanup, initial values
This commit is contained in:
parent
24a7bdbd81
commit
d72d798b06
3
src/@types/MetaData.d.ts
vendored
3
src/@types/MetaData.d.ts
vendored
@ -5,12 +5,9 @@ import {
|
||||
ServiceMetadata
|
||||
} from '@oceanprotocol/lib'
|
||||
|
||||
export declare type AccessType = 'Download' | 'Compute'
|
||||
|
||||
export interface AdditionalInformationMarket extends AdditionalInformation {
|
||||
links?: File[]
|
||||
termsAndConditions: boolean
|
||||
access: AccessType | string
|
||||
}
|
||||
|
||||
export interface MetadataMarket extends Metadata {
|
||||
|
@ -36,7 +36,7 @@ export default function FilesInput(props: InputProps): ReactElement {
|
||||
|
||||
return (
|
||||
<>
|
||||
{typeof field.value === 'object' ? (
|
||||
{field && typeof field.value === 'object' ? (
|
||||
<FileInfo file={field.value[0]} removeItem={removeItem} />
|
||||
) : (
|
||||
<FileInput
|
||||
|
@ -16,11 +16,9 @@ export default function PublishForm({
|
||||
const { ocean, account } = useOcean()
|
||||
const { publishStepText, isLoading } = usePublish()
|
||||
const {
|
||||
values,
|
||||
status,
|
||||
setStatus,
|
||||
isValid,
|
||||
touched,
|
||||
setErrors,
|
||||
setTouched,
|
||||
resetForm,
|
||||
|
@ -16,8 +16,7 @@ export function transformPublishFormToMetadata(
|
||||
tags,
|
||||
links,
|
||||
termsAndConditions,
|
||||
files,
|
||||
access
|
||||
files
|
||||
} = data
|
||||
|
||||
const metadata: MetadataMarket = {
|
||||
@ -38,8 +37,7 @@ export function transformPublishFormToMetadata(
|
||||
// links: {
|
||||
// url: links
|
||||
// },
|
||||
termsAndConditions,
|
||||
access: access || 'Download'
|
||||
termsAndConditions
|
||||
},
|
||||
curation: AssetModel.curation
|
||||
}
|
||||
|
@ -5,21 +5,20 @@ const AssetModel: MetadataMarket = {
|
||||
// https://github.com/oceanprotocol/OEPs/tree/master/8
|
||||
main: {
|
||||
type: 'dataset',
|
||||
name: '',
|
||||
dateCreated: '',
|
||||
author: '',
|
||||
license: '',
|
||||
name: undefined,
|
||||
dateCreated: undefined,
|
||||
author: undefined,
|
||||
license: undefined,
|
||||
files: []
|
||||
},
|
||||
additionalInformation: {
|
||||
description: '',
|
||||
copyrightHolder: '',
|
||||
tags: [],
|
||||
links: [],
|
||||
description: undefined,
|
||||
copyrightHolder: undefined,
|
||||
tags: undefined,
|
||||
links: undefined,
|
||||
|
||||
// custom items
|
||||
termsAndConditions: false,
|
||||
access: 'Download'
|
||||
termsAndConditions: false
|
||||
},
|
||||
curation: {
|
||||
rating: 0,
|
||||
|
@ -25,18 +25,18 @@ export const validationSchema = Yup.object().shape<MetadataPublishForm>({
|
||||
})
|
||||
|
||||
export const initialValues: MetadataPublishForm = {
|
||||
name: '',
|
||||
author: '',
|
||||
name: undefined,
|
||||
author: undefined,
|
||||
price: {
|
||||
cost: 1,
|
||||
tokensToMint: 1
|
||||
},
|
||||
files: '',
|
||||
description: '',
|
||||
license: '',
|
||||
access: '',
|
||||
files: undefined,
|
||||
description: undefined,
|
||||
license: undefined,
|
||||
access: undefined,
|
||||
termsAndConditions: false,
|
||||
copyrightHolder: '',
|
||||
tags: '',
|
||||
links: ''
|
||||
copyrightHolder: undefined,
|
||||
tags: undefined,
|
||||
links: undefined
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user