mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Merge branch 'main' into feature/compute
This commit is contained in:
commit
e180ab0085
@ -20,6 +20,13 @@
|
||||
"rows": 10,
|
||||
"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. This file URL will be publicly available after publishing.",
|
||||
"type": "files"
|
||||
},
|
||||
{
|
||||
"name": "timeout",
|
||||
"label": "Timeout",
|
||||
|
16509
package-lock.json
generated
16509
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -27,8 +27,8 @@
|
||||
"@coingecko/cryptoformat": "^0.4.2",
|
||||
"@loadable/component": "^5.14.1",
|
||||
"@oceanprotocol/art": "^3.0.0",
|
||||
"@oceanprotocol/lib": "^0.10.1",
|
||||
"@oceanprotocol/react": "^0.5.1",
|
||||
"@oceanprotocol/lib": "^0.11.4",
|
||||
"@oceanprotocol/react": "^0.5.5",
|
||||
"@oceanprotocol/typographies": "^0.1.0",
|
||||
"@portis/web3": "^3.0.3",
|
||||
"@sindresorhus/slugify": "^1.0.0",
|
||||
|
9
src/@types/MetaData.d.ts
vendored
9
src/@types/MetaData.d.ts
vendored
@ -36,7 +36,7 @@ export interface MetadataPublishFormDataset {
|
||||
termsAndConditions: boolean
|
||||
// ---- optional fields ----
|
||||
tags?: string
|
||||
links?: string | File[]
|
||||
links?: string | EditableMetadataLinks[]
|
||||
}
|
||||
|
||||
export interface MetadataPublishFormAlgorithm {
|
||||
@ -55,6 +55,13 @@ export interface MetadataPublishFormAlgorithm {
|
||||
tags?: string
|
||||
}
|
||||
|
||||
export interface MetadataEditForm {
|
||||
name: string
|
||||
description: string
|
||||
timeout: string
|
||||
links?: string | EditableMetadataLinks[]
|
||||
}
|
||||
|
||||
export interface ServiceMetadataMarket extends ServiceMetadata {
|
||||
attributes: MetadataMarket
|
||||
}
|
||||
|
@ -150,8 +150,7 @@ function Title({ row }: { row: TransactionHistoryPoolTransactions }) {
|
||||
) : null
|
||||
}
|
||||
|
||||
function getColumns(minimal?: boolean) {
|
||||
return [
|
||||
const columns = [
|
||||
{
|
||||
name: 'Title',
|
||||
selector: function getTitleRow(row: TransactionHistoryPoolTransactions) {
|
||||
@ -166,8 +165,7 @@ function getColumns(minimal?: boolean) {
|
||||
.replace('0x', 'did:op:')
|
||||
|
||||
return <AssetTitle did={did} />
|
||||
},
|
||||
omit: minimal
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Time',
|
||||
@ -183,8 +181,10 @@ function getColumns(minimal?: boolean) {
|
||||
},
|
||||
maxWidth: '10rem'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
// hack! if we use a function to omit one field this will display a strange refresh to the enduser for each row
|
||||
const columnsMinimal = [columns[0], columns[2]]
|
||||
|
||||
export default function PoolTransactions({
|
||||
poolAddress,
|
||||
@ -214,7 +214,7 @@ export default function PoolTransactions({
|
||||
|
||||
return (
|
||||
<Table
|
||||
columns={getColumns(minimal)}
|
||||
columns={minimal ? columnsMinimal : columns}
|
||||
data={logs}
|
||||
isLoading={loading}
|
||||
noTableHead={minimal}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { useOcean } from '@oceanprotocol/react'
|
||||
import { Formik } from 'formik'
|
||||
import React, { ReactElement, useState } from 'react'
|
||||
import { MetadataPublishFormDataset } from '../../../../@types/MetaData'
|
||||
import { MetadataEditForm } from '../../../../@types/MetaData'
|
||||
import {
|
||||
validationSchema,
|
||||
getInitialValues
|
||||
@ -66,14 +66,15 @@ export default function Edit({
|
||||
const hasFeedback = error || success
|
||||
|
||||
async function handleSubmit(
|
||||
values: Partial<MetadataPublishFormDataset>,
|
||||
values: Partial<MetadataEditForm>,
|
||||
resetForm: () => void
|
||||
) {
|
||||
try {
|
||||
// Construct new DDO with new values
|
||||
const ddoEditedMetdata = await ocean.assets.editMetadata(ddo, {
|
||||
title: values.name,
|
||||
description: values.description
|
||||
description: values.description,
|
||||
links: typeof values.links !== 'string' ? values.links : []
|
||||
})
|
||||
|
||||
if (!ddoEditedMetdata) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { MetadataMarket, MetadataPublishFormDataset } from '../@types/MetaData'
|
||||
import { secondsToString } from '../utils/metadata'
|
||||
import { EditableMetadataLinks } from '@oceanprotocol/lib'
|
||||
import * as Yup from 'yup'
|
||||
|
||||
export const validationSchema = Yup.object().shape({
|
||||
@ -7,6 +8,7 @@ export const validationSchema = Yup.object().shape({
|
||||
.min(4, (param) => `Title must be at least ${param.min} characters`)
|
||||
.required('Required'),
|
||||
description: Yup.string().required('Required').min(10),
|
||||
links: Yup.array<EditableMetadataLinks[]>().nullable(),
|
||||
timeout: Yup.string().required('Required')
|
||||
})
|
||||
|
||||
@ -17,6 +19,7 @@ export function getInitialValues(
|
||||
return {
|
||||
name: metadata.main.name,
|
||||
description: metadata.additionalInformation.description,
|
||||
links: metadata.additionalInformation.links,
|
||||
timeout: secondsToString(timeout)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user