diff --git a/client/src/components/atoms/Form/Input.tsx b/client/src/components/atoms/Form/Input.tsx index 5956fd3..9788e78 100644 --- a/client/src/components/atoms/Form/Input.tsx +++ b/client/src/components/atoms/Form/Input.tsx @@ -60,7 +60,7 @@ export default class Input extends PureComponent { 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 { className={styles.input} onFocus={this.toggleFocus} onBlur={this.toggleFocus} + id={name} + name={name} /> ) diff --git a/client/src/data/form-publish.json b/client/src/data/form-publish.json index c55b743..bc80928 100644 --- a/client/src/data/form-publish.json +++ b/client/src/data/form-publish.json @@ -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, diff --git a/client/src/routes/Publish/Files/Item.tsx b/client/src/routes/Publish/Files/Item.tsx index e25204b..0665ba2 100644 --- a/client/src/routes/Publish/Files/Item.tsx +++ b/client/src/routes/Publish/Files/Item.tsx @@ -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 }) => (
  • @@ -16,11 +21,13 @@ const Item = ({
    URL {item.found ? 'confirmed' : ' not confirmed'} - {item.found && item.size ? filesize(item.size) : 'unknown size'} + {item.found && item.contentLength + ? filesize(item.contentLength) + : 'unknown size'} - {item.found && item.type - ? item.type.split('/')[1] + {item.found && item.contentType + ? item.contentType.split('/')[1] : 'unknown type'}
    diff --git a/client/src/routes/Publish/index.tsx b/client/src/routes/Publish/index.tsx index 5133f12..3fe5a19 100644 --- a/client/src/routes/Publish/index.tsx +++ b/client/src/routes/Publish/index.tsx @@ -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,