mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
commit
7abb3741fc
25
library.json
Normal file
25
library.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "commons-marketplace",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/oceanprotocol/commons-marketplace.git"
|
||||
},
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "keeper-contracts",
|
||||
"version": "~0.6.12"
|
||||
},
|
||||
{
|
||||
"name": "brizo",
|
||||
"version": "~0.2.0"
|
||||
},
|
||||
{
|
||||
"name": "aquarius",
|
||||
"version": "~0.1.8"
|
||||
},
|
||||
{
|
||||
"name": "squid-js",
|
||||
"version": "~0.3.0"
|
||||
}
|
||||
]
|
||||
}
|
28
package-lock.json
generated
28
package-lock.json
generated
@ -1022,9 +1022,9 @@
|
||||
"integrity": "sha512-p2n505t2K0zD1ZvGPhI6EsSviEVLCB7BYowhf/ONmVaWED138PaG4Z9nY6YuHU383uOoIWT+Lq3dLkFzDzstXw=="
|
||||
},
|
||||
"@oceanprotocol/keeper-contracts": {
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/keeper-contracts/-/keeper-contracts-0.5.3.tgz",
|
||||
"integrity": "sha512-Fm1iV76d38VxKXPWdGInH5Qt/yEsiWYAeyfxVLArAalxoI5QsvNrfgiFcDcKUxX/+OY6ptnEtbowr62gdCtt4g=="
|
||||
"version": "0.6.12",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/keeper-contracts/-/keeper-contracts-0.6.12.tgz",
|
||||
"integrity": "sha512-vWs4jVAvFHZobHB64444MuQDxsNIWttt6u93wa0/NA6xMxjjoqa5V4Fv8LXDi5TW2WH3Z+2YzHoqKARe0gQBmw=="
|
||||
},
|
||||
"@oceanprotocol/secret-store-client": {
|
||||
"version": "0.0.14",
|
||||
@ -1035,11 +1035,11 @@
|
||||
}
|
||||
},
|
||||
"@oceanprotocol/squid": {
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/squid/-/squid-0.2.8.tgz",
|
||||
"integrity": "sha512-AgV+V81nba+v9Q8hyG7LnF+jtzkbFkPqousx5+QeDj9yscIhTHSwkRGW6nhqSbwDn7IC8ajkGKsD/l4lLJtu6Q==",
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/squid/-/squid-0.3.0.tgz",
|
||||
"integrity": "sha512-j0qC2VcUHNoqjdD01VYoifJlRQBAuMmDAufsZ4fQo59wN5aI+/ftwYLVlaoeIg1YWhhNx07X92Dv1PjWtWg4UA==",
|
||||
"requires": {
|
||||
"@oceanprotocol/keeper-contracts": "^0.5.3",
|
||||
"@oceanprotocol/keeper-contracts": "^0.6.12",
|
||||
"@oceanprotocol/secret-store-client": "~0.0.14",
|
||||
"@types/node-fetch": "^2.1.4",
|
||||
"bignumber.js": "^8.0.1",
|
||||
@ -1181,9 +1181,9 @@
|
||||
"integrity": "sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ=="
|
||||
},
|
||||
"@types/node-fetch": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.1.4.tgz",
|
||||
"integrity": "sha512-tR1ekaXUGpmzOcDXWU9BW73YfA2/VW1DF1FH+wlJ82BbCSnWTbdX+JkqWQXWKIGsFPnPsYadbXfNgz28g+ccWg==",
|
||||
"version": "2.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.1.6.tgz",
|
||||
"integrity": "sha512-Hv1jgh3pfpUEl2F2mqUd1AfLSk1YbUCeBJFaP36t7esAO617dErqdxWb5cdG2NfJGOofkmBW36fdx0dVewxDRg==",
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
@ -6314,13 +6314,13 @@
|
||||
}
|
||||
},
|
||||
"ethereumjs-util": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.0.0.tgz",
|
||||
"integrity": "sha512-E3yKUyl0Fs95nvTFQZe/ZSNcofhDzUsDlA5y2uoRmf1+Ec7gpGhNCsgKkZBRh7Br5op8mJcYF/jFbmjj909+nQ==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz",
|
||||
"integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==",
|
||||
"requires": {
|
||||
"bn.js": "^4.11.0",
|
||||
"create-hash": "^1.1.2",
|
||||
"ethjs-util": "^0.1.6",
|
||||
"ethjs-util": "0.1.6",
|
||||
"keccak": "^1.0.2",
|
||||
"rlp": "^2.0.0",
|
||||
"safe-buffer": "^5.1.1",
|
||||
|
@ -16,7 +16,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@oceanprotocol/art": "^2.2.0",
|
||||
"@oceanprotocol/squid": "^0.2.8",
|
||||
"@oceanprotocol/squid": "^0.3.0",
|
||||
"@types/is-url": "^1.2.28",
|
||||
"@types/react-helmet": "^5.0.8",
|
||||
"@types/react-transition-group": "^2.0.15",
|
||||
|
@ -49,7 +49,7 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
||||
}
|
||||
|
||||
public InputComponent = () => {
|
||||
const { type, options, group, name, required } = this.props
|
||||
const { type, options, group, name, required, onChange } = this.props
|
||||
|
||||
const wrapClass = this.inputWrapClasses()
|
||||
|
||||
@ -63,8 +63,9 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
||||
required={required}
|
||||
onFocus={this.toggleFocus}
|
||||
onBlur={this.toggleFocus}
|
||||
onChange={onChange}
|
||||
>
|
||||
<option value="none">---</option>
|
||||
<option value="">---</option>
|
||||
{options &&
|
||||
options.map((option: string, index: number) => (
|
||||
<option
|
||||
|
@ -6,7 +6,7 @@ export const aquariusScheme = 'http'
|
||||
export const aquariusHost = 'localhost'
|
||||
export const aquariusPort = 5000
|
||||
|
||||
export const brizoScheme = 'https'
|
||||
export const brizoScheme = 'http'
|
||||
export const brizoHost = 'localhost'
|
||||
export const brizoPort = 8030
|
||||
|
||||
|
@ -23,37 +23,6 @@
|
||||
"required": true,
|
||||
"rows": 5
|
||||
},
|
||||
"type": {
|
||||
"label": "Type",
|
||||
"type": "select",
|
||||
"options": ["Data set", "Algorithm", "Container", "Workflow", "Other"]
|
||||
},
|
||||
"author": {
|
||||
"label": "Author",
|
||||
"placeholder": "i.e. Jelly McJellyfish",
|
||||
"type": "text",
|
||||
"required": true
|
||||
},
|
||||
"license": {
|
||||
"label": "License",
|
||||
"type": "select",
|
||||
"required": true,
|
||||
"options": [
|
||||
"Public Domain",
|
||||
"CC BY: Attribution",
|
||||
"CC BY-SA: Attribution ShareAlike",
|
||||
"CC BY-ND: Attribution-NoDerivs",
|
||||
"CC BY-NC: Attribution-NonCommercial",
|
||||
"CC BY-NC-SA: Attribution-NonCommercial-ShareAlike",
|
||||
"CC BY-NC-ND: Attribution-NonCommercial-NoDerivs"
|
||||
]
|
||||
},
|
||||
"copyrightHolder": {
|
||||
"label": "Copyright Holder",
|
||||
"placeholder": "i.e. fwhfiw",
|
||||
"type": "text",
|
||||
"required": true
|
||||
},
|
||||
"categories": {
|
||||
"label": "Categories",
|
||||
"type": "select",
|
||||
@ -90,6 +59,32 @@
|
||||
"Communication & Journalism",
|
||||
"Other"
|
||||
]
|
||||
},
|
||||
"copyrightHolder": {
|
||||
"label": "Copyright Holder",
|
||||
"placeholder": "i.e. fwhfiw",
|
||||
"type": "text",
|
||||
"required": true
|
||||
},
|
||||
"author": {
|
||||
"label": "Author",
|
||||
"placeholder": "i.e. Jelly McJellyfish",
|
||||
"type": "text",
|
||||
"required": true
|
||||
},
|
||||
"license": {
|
||||
"label": "License",
|
||||
"type": "select",
|
||||
"required": true,
|
||||
"options": [
|
||||
"Public Domain",
|
||||
"CC BY: Attribution",
|
||||
"CC BY-SA: Attribution ShareAlike",
|
||||
"CC BY-ND: Attribution-NoDerivs",
|
||||
"CC BY-NC: Attribution-NonCommercial",
|
||||
"CC BY-NC-SA: Attribution-NonCommercial-ShareAlike",
|
||||
"CC BY-NC-ND: Attribution-NonCommercial-NoDerivs"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,14 +17,9 @@ const AssetModel = {
|
||||
compression: null,
|
||||
contentType: null,
|
||||
workExample: null,
|
||||
contentUrls: [],
|
||||
links: [
|
||||
{
|
||||
name: null,
|
||||
type: null,
|
||||
url: null
|
||||
}
|
||||
],
|
||||
files: [],
|
||||
categories: [],
|
||||
links: [],
|
||||
inLanguage: null,
|
||||
tags: [],
|
||||
price: null
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Ocean } from '@oceanprotocol/squid/dist/node/squid'
|
||||
import { Ocean } from '@oceanprotocol/squid'
|
||||
|
||||
import {
|
||||
address,
|
||||
|
@ -32,7 +32,7 @@ export default class Details extends Component<DetailsProps, DetailsState> {
|
||||
try {
|
||||
const account = await this.context.ocean.getAccounts()
|
||||
const service = ddo.findServiceByType('Access')
|
||||
const serviceAgreementSignatureResult: any = await this.context.ocean.signServiceAgreement(
|
||||
const serviceAgreementSignatureResult = await this.context.ocean.signServiceAgreement(
|
||||
ddo.id,
|
||||
service.serviceDefinitionId,
|
||||
account[0]
|
||||
@ -40,9 +40,10 @@ export default class Details extends Component<DetailsProps, DetailsState> {
|
||||
await this.context.ocean.initializeServiceAgreement(
|
||||
ddo.id,
|
||||
service.serviceDefinitionId,
|
||||
serviceAgreementSignatureResult.serviceAgreementId,
|
||||
serviceAgreementSignatureResult.serviceAgreementSignature,
|
||||
serviceAgreementSignatureResult.agreementId,
|
||||
serviceAgreementSignatureResult.signature,
|
||||
(files: any) => {
|
||||
Logger.log('downloading files', files)
|
||||
files.forEach((file: any) => {
|
||||
const parsedUrl: any = queryString.parseUrl(file)
|
||||
setTimeout(() => {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react'
|
||||
import styles from './Item.module.scss'
|
||||
|
||||
const Item = ({ item, removeItem }: { item: string; removeItem: any }) => (
|
||||
const Item = ({ item, removeItem }: { item: any; removeItem: any }) => (
|
||||
<li>
|
||||
<a href={item}>{item}</a>
|
||||
<a href={item.url}>{item.url}</a>
|
||||
<button
|
||||
type="button"
|
||||
className={styles.remove}
|
||||
|
@ -7,7 +7,7 @@ import Item from './Item'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
interface FilesProps {
|
||||
files: string[]
|
||||
files: any[]
|
||||
placeholder: string
|
||||
help?: string
|
||||
name: string
|
||||
@ -31,7 +31,7 @@ export default class Files extends PureComponent<FilesProps, FilesStates> {
|
||||
}
|
||||
|
||||
public addItem = (value: string) => {
|
||||
this.props.files.push(value)
|
||||
this.props.files.push({ url: value })
|
||||
// this.props.resetForm()
|
||||
this.setState({ isFormShown: !this.state.isFormShown })
|
||||
}
|
||||
@ -62,7 +62,7 @@ export default class Files extends PureComponent<FilesProps, FilesStates> {
|
||||
component="ul"
|
||||
className={styles.itemsList}
|
||||
>
|
||||
{files.map((item: string, index: number) => (
|
||||
{files.map((item: any, index: number) => (
|
||||
<CSSTransition
|
||||
key={index}
|
||||
timeout={400}
|
||||
|
@ -19,7 +19,7 @@ interface PublishState {
|
||||
name?: string
|
||||
dateCreated?: Date
|
||||
description?: string
|
||||
files?: string[]
|
||||
files?: any[]
|
||||
price?: number
|
||||
author?: string
|
||||
type?: AssetType
|
||||
@ -118,13 +118,13 @@ class Publish extends Component<{}, PublishState> {
|
||||
name: '',
|
||||
dateCreated: new Date(),
|
||||
description: '',
|
||||
files: [''],
|
||||
files: [],
|
||||
price: 0,
|
||||
author: '',
|
||||
type: 'dataset' as AssetType,
|
||||
license: '',
|
||||
copyrightHolder: '',
|
||||
categories: [''],
|
||||
categories: [],
|
||||
isPublishing: false,
|
||||
isPublished: false
|
||||
})
|
||||
@ -147,9 +147,10 @@ class Publish extends Component<{}, PublishState> {
|
||||
author: this.state.author,
|
||||
license: this.state.license,
|
||||
copyrightHolder: this.state.copyrightHolder,
|
||||
contentUrls: [this.state.files],
|
||||
files: this.state.files,
|
||||
price: this.state.price,
|
||||
type: this.state.type,
|
||||
categories: [this.state.categories],
|
||||
size: '',
|
||||
encoding: '',
|
||||
compression: undefined,
|
||||
@ -169,7 +170,6 @@ class Publish extends Component<{}, PublishState> {
|
||||
newAsset,
|
||||
account[0]
|
||||
)
|
||||
Logger.log('asset:', asset)
|
||||
this.setState({
|
||||
publishedDid: asset.id,
|
||||
isPublished: true
|
||||
|
Loading…
Reference in New Issue
Block a user