1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

metadata hotfixes

This commit is contained in:
Matthias Kretschmann 2019-04-01 13:49:25 +02:00
parent 7e340cca07
commit 2ad4937d05
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 17 additions and 13 deletions

View File

@ -60,7 +60,7 @@ export default class Input extends PureComponent<InputProps, InputState> {
this.setState({ isFocused: !this.state.isFocused })
}
public handleDateChange = (date: Date) => {
private handleDateChange = (date: Date) => {
this.setState({
startDate: date
})
@ -161,6 +161,8 @@ export default class Input extends PureComponent<InputProps, InputState> {
className={styles.input}
onFocus={this.toggleFocus}
onBlur={this.toggleFocus}
id={name}
name={name}
/>
</div>
)

View File

@ -33,7 +33,7 @@
"rows": 5
},
"categories": {
"label": "Categories",
"label": "Category",
"help": "Pick a category which best fits your data set.",
"type": "select",
"required": true,

View File

@ -6,7 +6,12 @@ const Item = ({
item,
removeItem
}: {
item: { url: string; found: boolean; type: string; size: number }
item: {
url: string
found: boolean
contentType: string
contentLength: number
}
removeItem(): void
}) => (
<li>
@ -16,11 +21,13 @@ const Item = ({
<div className={styles.details}>
<span>URL {item.found ? 'confirmed' : ' not confirmed'}</span>
<span>
{item.found && item.size ? filesize(item.size) : 'unknown size'}
{item.found && item.contentLength
? filesize(item.contentLength)
: 'unknown size'}
</span>
<span>
{item.found && item.type
? item.type.split('/')[1]
{item.found && item.contentType
? item.contentType.split('/')[1]
: 'unknown type'}
</span>
</div>

View File

@ -53,7 +53,6 @@ class Publish extends Component<{}, PublishState> {
2: {
description: false,
categories: false,
dateCreated: false,
allFieldsValid: false
},
3: {
@ -122,7 +121,7 @@ class Publish extends Component<{}, PublishState> {
})
}
private validateInputs = (name: string, value: any) => {
private validateInputs = (name: string, value: string) => {
let hasContent = value.length > 0
// Setting state for all fields
@ -189,11 +188,7 @@ class Publish extends Component<{}, PublishState> {
//
// Step 2
//
if (
validationStatus[2].description &&
validationStatus[2].categories &&
validationStatus[2].dateCreated
) {
if (validationStatus[2].description && validationStatus[2].categories) {
this.setState(prevState => ({
validationStatus: {
...prevState.validationStatus,