mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
metadata hotfixes
This commit is contained in:
parent
7e340cca07
commit
2ad4937d05
@ -60,7 +60,7 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
|||||||
this.setState({ isFocused: !this.state.isFocused })
|
this.setState({ isFocused: !this.state.isFocused })
|
||||||
}
|
}
|
||||||
|
|
||||||
public handleDateChange = (date: Date) => {
|
private handleDateChange = (date: Date) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
startDate: date
|
startDate: date
|
||||||
})
|
})
|
||||||
@ -161,6 +161,8 @@ export default class Input extends PureComponent<InputProps, InputState> {
|
|||||||
className={styles.input}
|
className={styles.input}
|
||||||
onFocus={this.toggleFocus}
|
onFocus={this.toggleFocus}
|
||||||
onBlur={this.toggleFocus}
|
onBlur={this.toggleFocus}
|
||||||
|
id={name}
|
||||||
|
name={name}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
"rows": 5
|
"rows": 5
|
||||||
},
|
},
|
||||||
"categories": {
|
"categories": {
|
||||||
"label": "Categories",
|
"label": "Category",
|
||||||
"help": "Pick a category which best fits your data set.",
|
"help": "Pick a category which best fits your data set.",
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"required": true,
|
"required": true,
|
||||||
|
@ -6,7 +6,12 @@ const Item = ({
|
|||||||
item,
|
item,
|
||||||
removeItem
|
removeItem
|
||||||
}: {
|
}: {
|
||||||
item: { url: string; found: boolean; type: string; size: number }
|
item: {
|
||||||
|
url: string
|
||||||
|
found: boolean
|
||||||
|
contentType: string
|
||||||
|
contentLength: number
|
||||||
|
}
|
||||||
removeItem(): void
|
removeItem(): void
|
||||||
}) => (
|
}) => (
|
||||||
<li>
|
<li>
|
||||||
@ -16,11 +21,13 @@ const Item = ({
|
|||||||
<div className={styles.details}>
|
<div className={styles.details}>
|
||||||
<span>URL {item.found ? 'confirmed' : ' not confirmed'}</span>
|
<span>URL {item.found ? 'confirmed' : ' not confirmed'}</span>
|
||||||
<span>
|
<span>
|
||||||
{item.found && item.size ? filesize(item.size) : 'unknown size'}
|
{item.found && item.contentLength
|
||||||
|
? filesize(item.contentLength)
|
||||||
|
: 'unknown size'}
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
{item.found && item.type
|
{item.found && item.contentType
|
||||||
? item.type.split('/')[1]
|
? item.contentType.split('/')[1]
|
||||||
: 'unknown type'}
|
: 'unknown type'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -53,7 +53,6 @@ class Publish extends Component<{}, PublishState> {
|
|||||||
2: {
|
2: {
|
||||||
description: false,
|
description: false,
|
||||||
categories: false,
|
categories: false,
|
||||||
dateCreated: false,
|
|
||||||
allFieldsValid: false
|
allFieldsValid: false
|
||||||
},
|
},
|
||||||
3: {
|
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
|
let hasContent = value.length > 0
|
||||||
|
|
||||||
// Setting state for all fields
|
// Setting state for all fields
|
||||||
@ -189,11 +188,7 @@ class Publish extends Component<{}, PublishState> {
|
|||||||
//
|
//
|
||||||
// Step 2
|
// Step 2
|
||||||
//
|
//
|
||||||
if (
|
if (validationStatus[2].description && validationStatus[2].categories) {
|
||||||
validationStatus[2].description &&
|
|
||||||
validationStatus[2].categories &&
|
|
||||||
validationStatus[2].dateCreated
|
|
||||||
) {
|
|
||||||
this.setState(prevState => ({
|
this.setState(prevState => ({
|
||||||
validationStatus: {
|
validationStatus: {
|
||||||
...prevState.validationStatus,
|
...prevState.validationStatus,
|
||||||
|
Loading…
Reference in New Issue
Block a user