diff --git a/client/modules/IDE/actions/files.js b/client/modules/IDE/actions/files.js index 1108a2b6..6ded6a7b 100644 --- a/client/modules/IDE/actions/files.js +++ b/client/modules/IDE/actions/files.js @@ -3,6 +3,7 @@ import axios from 'axios'; import objectID from 'bson-objectid'; import blobUtil from 'blob-util'; import { setUnsavedChanges } from './ide'; +import { reset } from 'redux-form'; const ROOT_URL = location.href.indexOf('localhost') > 0 ? 'http://localhost:8000/api' : '/api'; @@ -61,9 +62,10 @@ export function createFile(formProps) { ...response.data, parentId }); - dispatch({ - type: ActionTypes.HIDE_MODAL - }); + dispatch(reset('new-file')); + // dispatch({ + // type: ActionTypes.HIDE_MODAL + // }); dispatch(setUnsavedChanges(true)); }) .catch(response => dispatch({ @@ -82,9 +84,10 @@ export function createFile(formProps) { parentId, children: [] }); - dispatch({ - type: ActionTypes.HIDE_MODAL - }); + dispatch(reset('new-file')); + // dispatch({ + // type: ActionTypes.HIDE_MODAL + // }); dispatch(setUnsavedChanges(true)); } }; diff --git a/client/modules/IDE/components/FileUploader.jsx b/client/modules/IDE/components/FileUploader.jsx index 81a25230..9c315a7c 100644 --- a/client/modules/IDE/components/FileUploader.jsx +++ b/client/modules/IDE/components/FileUploader.jsx @@ -17,13 +17,12 @@ class FileUploader extends React.Component { method: 'post', autoProcessQueue: true, clickable: true, - maxFiles: 1, - parallelUploads: 1, + maxFiles: 6, + parallelUploads: 2, maxFilesize: 5, // in mb - maxThumbnailFilesize: 8, // 3MB + maxThumbnailFilesize: 8, // 8 mb thumbnailWidth: 200, thumbnailHeight: 200, - addRemoveLinks: true, // TODO what is a good list of MIME types???? acceptedFiles: `image/*,audio/*,text/javascript,text/html,text/css, application/json,application/x-font-ttf,application/x-font-truetype, diff --git a/client/modules/IDE/components/NewFileForm.jsx b/client/modules/IDE/components/NewFileForm.jsx index 3e0c6059..c3b64c50 100644 --- a/client/modules/IDE/components/NewFileForm.jsx +++ b/client/modules/IDE/components/NewFileForm.jsx @@ -7,21 +7,22 @@ class NewFileForm extends React.Component { this.createFile = this.props.createFile.bind(this); } - componentDidMount() { - this.refs.fileName.focus(); - } - render() { const { fields: { name }, handleSubmit } = this.props; return ( -