1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00
market/src/components/Publish/_constants.tsx
EnzoVezzaro 74a9d074ed
fix file validation on edit form (#1677)
* split validation / constants

* some minor refactor

* fix edit form (duplication ErrorMessage)

* fix Feedback UI

* remove logs

* fix empty space when loading total sales

* added isTrue to valid

* remove hardcoded FileInfo typing in publish and edit

* fix more FileInfo typing

* fix missing error message on inputs
2022-09-26 14:01:51 +01:00

114 lines
2.9 KiB
TypeScript

import React from 'react'
import { allowFixedPricing } from '../../../app.config.js'
import {
FormPublishData,
MetadataAlgorithmContainer,
PublishFeedback,
StepContent
} from './_types'
import content from '../../../content/publish/form.json'
import PricingFields from './Pricing'
import MetadataFields from './Metadata'
import ServicesFields from './Services'
import Preview from './Preview'
import Submission from './Submission'
import { ServiceComputeOptions } from '@oceanprotocol/lib'
import contentFeedback from '../../../content/publish/feedback.json'
export const wizardSteps: StepContent[] = [
{
step: 1,
title: content.metadata.title,
component: <MetadataFields />
},
{
step: 2,
title: content.services.title,
component: <ServicesFields />
},
{
step: 3,
title: content.pricing.title,
component: <PricingFields />
},
{
step: 4,
title: content.preview.title,
component: <Preview />
},
{
step: 5,
title: content.submission.title,
component: <Submission />
}
]
const computeOptions: ServiceComputeOptions = {
allowRawAlgorithm: false,
allowNetworkAccess: true,
publisherTrustedAlgorithmPublishers: [],
publisherTrustedAlgorithms: []
}
export const initialValues: FormPublishData = {
user: {
stepCurrent: 1,
chainId: 1,
accountId: ''
},
metadata: {
nft: { name: '', symbol: '', description: '', image_data: '' },
transferable: true,
type: 'dataset',
name: '',
author: '',
description: '',
tags: '',
termsAndConditions: false,
dockerImage: '',
dockerImageCustom: '',
dockerImageCustomTag: '',
dockerImageCustomEntrypoint: ''
},
services: [
{
files: [{ url: '', type: '' }],
links: [{ url: '', type: '' }],
dataTokenOptions: { name: '', symbol: '' },
timeout: '',
access: 'access',
providerUrl: {
url: 'https://provider.mainnet.oceanprotocol.com',
valid: true,
custom: false
},
computeOptions
}
],
pricing: {
baseToken: { address: '', name: '', symbol: 'OCEAN', decimals: 18 },
price: 0,
type: allowFixedPricing === 'true' ? 'fixed' : 'free',
freeAgreement: false
}
}
export const algorithmContainerPresets: MetadataAlgorithmContainer[] = [
{
image: 'node',
tag: '18.6.0', // TODO: Put this back to latest once merging the PR that fetches the container digest from docker hub via dockerhub-proxy
entrypoint: 'node $ALGO',
checksum:
'sha256:c60726646352202d95de70d9e8393c15f382f8c6074afc5748b7e570ccd5995f'
},
{
image: 'python',
tag: '3.10.5', // TODO: Put this back to latest once merging the PR that fetches the container digest from docker hub via dockerhub-proxy
entrypoint: 'python $ALGO',
checksum:
'sha256:607635763e54907fd75397fedfeb83890e62a0f9b54a1d99d27d748c5d269be4'
}
]
export const initialPublishFeedback: PublishFeedback = contentFeedback