mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
working file add
This commit is contained in:
parent
c8479e62e5
commit
c3507cebc3
@ -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
|
||||
|
||||
|
@ -17,23 +17,9 @@ const AssetModel = {
|
||||
compression: null,
|
||||
contentType: null,
|
||||
workExample: null,
|
||||
files: [
|
||||
{
|
||||
url: null,
|
||||
checksum: null,
|
||||
checksumType: null,
|
||||
contentLength: null,
|
||||
resourceId: null
|
||||
}
|
||||
],
|
||||
files: [],
|
||||
categories: [],
|
||||
links: [
|
||||
{
|
||||
name: null,
|
||||
type: null,
|
||||
url: null
|
||||
}
|
||||
],
|
||||
links: [],
|
||||
inLanguage: null,
|
||||
tags: [],
|
||||
price: null
|
||||
|
@ -35,12 +35,14 @@ export default class Details extends Component<DetailsProps, DetailsState> {
|
||||
service.serviceDefinitionId,
|
||||
account[0]
|
||||
)
|
||||
Logger.log(service)
|
||||
await this.context.ocean.initializeServiceAgreement(
|
||||
ddo.id,
|
||||
service.serviceDefinitionId,
|
||||
serviceAgreementSignatureResult.serviceAgreementId,
|
||||
serviceAgreementSignatureResult.serviceAgreementSignature,
|
||||
(files: any) => {
|
||||
Logger.log('downloading files', files)
|
||||
files.forEach((file: any) => {
|
||||
const parsedUrl: any = quertString.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
|
||||
@ -147,7 +147,7 @@ class Publish extends Component<{}, PublishState> {
|
||||
author: this.state.author,
|
||||
license: this.state.license,
|
||||
copyrightHolder: this.state.copyrightHolder,
|
||||
files: [this.state.files],
|
||||
files: this.state.files,
|
||||
price: this.state.price,
|
||||
type: this.state.type,
|
||||
categories: [this.state.categories],
|
||||
@ -170,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