diff --git a/docs/feature_list.md b/docs/feature_list.md new file mode 100644 index 00000000..568f7146 --- /dev/null +++ b/docs/feature_list.md @@ -0,0 +1,63 @@ +# Feature list + +This list specifies all features in Onion that ought to be tested before actually pushing live: + +- sign up & email activation +- login +- log out +- form input + + reset + + save + + disabled state +- form checkbox + + reset + + save + + disabled state +- create app + + refresh token +- loan contract + + upload + + download + + delete +- register work + + with edition + + without edition + + correct encoding of video upload +- fineuploader + + upload file + + upload multiple files + + delete file + + cancel upload of file +- create editions + + in piece list + + in piece detail +- all notes in edition/piece detail +- transfer & consign & loan & share & delete + + bulk + + single + + withdraw +- piece list + + filter (also check for correct filtering of opened edition tables) + + order + + search + + pagination + + expandable edition list for piece +- download coa + +## sluice +- hero landing page +- activation email +- submission (also check extra form fields) + + of existing pieces + + newly registered pieces +- rating + + in piece list + + in piece detail +- short listing (not yet implemented) +- piece list + + order by rating + +## Cyland +- hero landing page +- activation email +- submission (check states of submission (1,2,3)) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index fa5f855e..8ecaf40b 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -229,7 +229,6 @@ var ReactS3FineUploader = React.createClass({ onDeleteComplete: this.onDeleteComplete, onSessionRequestComplete: this.onSessionRequestComplete, onError: this.onError, - onValidate: this.onValidate, onUploadChunk: this.onUploadChunk, onUploadChunkSuccess: this.onUploadChunkSuccess } @@ -425,13 +424,17 @@ var ReactS3FineUploader = React.createClass({ GlobalNotificationActions.appendGlobalNotification(notification); }, - onValidate(data) { - if(data.size > this.props.validation.sizeLimit) { - this.state.uploader.cancelAll(); + isFileValid(file) { + if(file.size > this.props.validation.sizeLimit) { let fileSizeInMegaBytes = this.props.validation.sizeLimit / 1000000; - let notification = new GlobalNotificationModel(getLangText('Your file is bigger than %d MB', fileSizeInMegaBytes), 'danger', 5000); + + let notification = new GlobalNotificationModel(getLangText('A file you submitted is bigger than ' + fileSizeInMegaBytes + 'MB.'), 'danger', 5000); GlobalNotificationActions.appendGlobalNotification(notification); + + return false; + } else { + return true; } }, @@ -581,8 +584,18 @@ var ReactS3FineUploader = React.createClass({ return; } + // validate each submitted file if it fits the file size + let validFiles = []; + for(let i = 0; i < files.length; i++) { + if(this.isFileValid(files[i])) { + validFiles.push(files[i]); + } + } + // override standard files list with only valid files + files = validFiles; + // Call this method to signal the outside component that an upload is in progress - if(this.props.uploadStarted && typeof this.props.uploadStarted === 'function') { + if(this.props.uploadStarted && typeof this.props.uploadStarted === 'function' && files.length > 0) { this.props.uploadStarted(); } @@ -696,8 +709,10 @@ var ReactS3FineUploader = React.createClass({ // if we're not hashing the files locally, we're just going to hand them over to fineuploader // to upload them to the server } else { - this.state.uploader.addFiles(files); - this.synchronizeFileLists(files); + if(files.length > 0) { + this.state.uploader.addFiles(files); + this.synchronizeFileLists(files); + } } }, diff --git a/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_additional_data_form.js b/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_additional_data_form.js index c8dd7f2c..f7946be5 100644 --- a/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_additional_data_form.js +++ b/js/components/whitelabel/wallet/components/cyland/ascribe_forms/cyland_additional_data_form.js @@ -61,10 +61,9 @@ let CylandAdditionalDataForm = React.createClass({ }, isReadyForFormSubmission(files) { - let uploadedFiles = files.filter((file) => file.status === 'upload successful'); let uploadingFiles = files.filter((file) => file.status === 'submitting'); - if (uploadedFiles.length > 0 && uploadingFiles.length === 0) { + if (uploadingFiles.length === 0) { return true; } else { return false;