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 aquariusHost = 'localhost'
|
||||||
export const aquariusPort = 5000
|
export const aquariusPort = 5000
|
||||||
|
|
||||||
export const brizoScheme = 'https'
|
export const brizoScheme = 'http'
|
||||||
export const brizoHost = 'localhost'
|
export const brizoHost = 'localhost'
|
||||||
export const brizoPort = 8030
|
export const brizoPort = 8030
|
||||||
|
|
||||||
|
@ -17,23 +17,9 @@ const AssetModel = {
|
|||||||
compression: null,
|
compression: null,
|
||||||
contentType: null,
|
contentType: null,
|
||||||
workExample: null,
|
workExample: null,
|
||||||
files: [
|
files: [],
|
||||||
{
|
|
||||||
url: null,
|
|
||||||
checksum: null,
|
|
||||||
checksumType: null,
|
|
||||||
contentLength: null,
|
|
||||||
resourceId: null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
categories: [],
|
categories: [],
|
||||||
links: [
|
links: [],
|
||||||
{
|
|
||||||
name: null,
|
|
||||||
type: null,
|
|
||||||
url: null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
inLanguage: null,
|
inLanguage: null,
|
||||||
tags: [],
|
tags: [],
|
||||||
price: null
|
price: null
|
||||||
|
@ -35,12 +35,14 @@ export default class Details extends Component<DetailsProps, DetailsState> {
|
|||||||
service.serviceDefinitionId,
|
service.serviceDefinitionId,
|
||||||
account[0]
|
account[0]
|
||||||
)
|
)
|
||||||
|
Logger.log(service)
|
||||||
await this.context.ocean.initializeServiceAgreement(
|
await this.context.ocean.initializeServiceAgreement(
|
||||||
ddo.id,
|
ddo.id,
|
||||||
service.serviceDefinitionId,
|
service.serviceDefinitionId,
|
||||||
serviceAgreementSignatureResult.serviceAgreementId,
|
serviceAgreementSignatureResult.serviceAgreementId,
|
||||||
serviceAgreementSignatureResult.serviceAgreementSignature,
|
serviceAgreementSignatureResult.serviceAgreementSignature,
|
||||||
(files: any) => {
|
(files: any) => {
|
||||||
|
Logger.log('downloading files', files)
|
||||||
files.forEach((file: any) => {
|
files.forEach((file: any) => {
|
||||||
const parsedUrl: any = quertString.parseUrl(file)
|
const parsedUrl: any = quertString.parseUrl(file)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import styles from './Item.module.scss'
|
import styles from './Item.module.scss'
|
||||||
|
|
||||||
const Item = ({ item, removeItem }: { item: string; removeItem: any }) => (
|
const Item = ({ item, removeItem }: { item: any; removeItem: any }) => (
|
||||||
<li>
|
<li>
|
||||||
<a href={item}>{item}</a>
|
<a href={item.url}>{item.url}</a>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={styles.remove}
|
className={styles.remove}
|
||||||
|
@ -7,7 +7,7 @@ import Item from './Item'
|
|||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
|
|
||||||
interface FilesProps {
|
interface FilesProps {
|
||||||
files: string[]
|
files: any[]
|
||||||
placeholder: string
|
placeholder: string
|
||||||
help?: string
|
help?: string
|
||||||
name: string
|
name: string
|
||||||
@ -31,7 +31,7 @@ export default class Files extends PureComponent<FilesProps, FilesStates> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public addItem = (value: string) => {
|
public addItem = (value: string) => {
|
||||||
this.props.files.push(value)
|
this.props.files.push({url: value})
|
||||||
// this.props.resetForm()
|
// this.props.resetForm()
|
||||||
this.setState({ isFormShown: !this.state.isFormShown })
|
this.setState({ isFormShown: !this.state.isFormShown })
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ export default class Files extends PureComponent<FilesProps, FilesStates> {
|
|||||||
component="ul"
|
component="ul"
|
||||||
className={styles.itemsList}
|
className={styles.itemsList}
|
||||||
>
|
>
|
||||||
{files.map((item: string, index: number) => (
|
{files.map((item: any, index: number) => (
|
||||||
<CSSTransition
|
<CSSTransition
|
||||||
key={index}
|
key={index}
|
||||||
timeout={400}
|
timeout={400}
|
||||||
|
@ -19,7 +19,7 @@ interface PublishState {
|
|||||||
name?: string
|
name?: string
|
||||||
dateCreated?: Date
|
dateCreated?: Date
|
||||||
description?: string
|
description?: string
|
||||||
files?: string[]
|
files?: any[]
|
||||||
price?: number
|
price?: number
|
||||||
author?: string
|
author?: string
|
||||||
type?: AssetType
|
type?: AssetType
|
||||||
@ -147,7 +147,7 @@ class Publish extends Component<{}, PublishState> {
|
|||||||
author: this.state.author,
|
author: this.state.author,
|
||||||
license: this.state.license,
|
license: this.state.license,
|
||||||
copyrightHolder: this.state.copyrightHolder,
|
copyrightHolder: this.state.copyrightHolder,
|
||||||
files: [this.state.files],
|
files: this.state.files,
|
||||||
price: this.state.price,
|
price: this.state.price,
|
||||||
type: this.state.type,
|
type: this.state.type,
|
||||||
categories: [this.state.categories],
|
categories: [this.state.categories],
|
||||||
@ -170,7 +170,6 @@ class Publish extends Component<{}, PublishState> {
|
|||||||
newAsset,
|
newAsset,
|
||||||
account[0]
|
account[0]
|
||||||
)
|
)
|
||||||
Logger.log('asset:', asset)
|
|
||||||
this.setState({
|
this.setState({
|
||||||
publishedDid: asset.id,
|
publishedDid: asset.id,
|
||||||
isPublished: true
|
isPublished: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user