1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 10:25:08 +01:00

Sync thumbnail uploader to digitalWork uploader in RegisterPieceForm

This commit is contained in:
Tim Daubenschütz 2015-11-19 11:45:29 +01:00
parent 2dcd375850
commit 6d08540d8b
2 changed files with 11 additions and 1 deletions

View File

@ -93,10 +93,19 @@ let RegisterPieceForm = React.createClass({
const thumbnailKeyDialogExpanded = AppConstants.supportedThumbnailFileFormats.indexOf(mimeSubType) === -1; const thumbnailKeyDialogExpanded = AppConstants.supportedThumbnailFileFormats.indexOf(mimeSubType) === -1;
this.setState({ thumbnailKeyDialogExpanded }); this.setState({ thumbnailKeyDialogExpanded });
} else { } else {
this.refs.form.refs.thumbnail_file.reset();
this.refs.form.refs.digital_work_key.reset();
this.setState({ thumbnailKeyDialogExpanded: false }); this.setState({ thumbnailKeyDialogExpanded: false });
} }
}, },
handleSelectFilesThumbnail([thumbnailFile, ]) {
// This is truly terrible, but at least we're not coding this mess into ReactS3Fineuploader
let file = this.refs.form.refs.digital_work_key.refs.input.refs.fineuploader.state.filesToUpload[0];
file.type = thumbnailFile.type;
file.url = thumbnailFile.url;
},
render() { render() {
const { disabled, const { disabled,
handleSuccess, handleSuccess,
@ -168,6 +177,7 @@ let RegisterPieceForm = React.createClass({
createBlobRoutine={{ createBlobRoutine={{
url: ApiUrls.blob_thumbnails url: ApiUrls.blob_thumbnails
}} }}
handleSelectFiles={this.handleSelectFilesThumbnail}
isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile} isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile}
keyRoutine={{ keyRoutine={{
url: AppConstants.serverUrl + 's3/key/', url: AppConstants.serverUrl + 's3/key/',

View File

@ -3,7 +3,7 @@
cursor: default !important; cursor: default !important;
display: block; display: block;
height: auto; height: auto;
margin-top: 1em; /* margin-top: 1em; */
outline: 1px dashed #9e9e9e; outline: 1px dashed #9e9e9e;
overflow: auto; overflow: auto;
text-align: center; text-align: center;