1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

Merge remote-tracking branch 'remotes/origin/AD-499-whitelabel-prize-with-sluice-as-k' into AD-419-decouple-piece-registration-from-

This commit is contained in:
diminator 2015-07-15 16:56:38 +02:00
commit 08137cdb09
5 changed files with 17 additions and 6 deletions

View File

@ -125,7 +125,7 @@ let FileUploader = React.createClass({
return (
<Form>
<Property
label="Additional files">
label="Additional files (max. 10MB)">
<ReactS3FineUploader
keyRoutine={{
url: AppConstants.serverUrl + 's3/key/',

View File

@ -113,7 +113,7 @@ let FileDragAndDrop = React.createClass({
this.props.handleResumeFile(fileId);
},
handleOnClick() {
handleOnClick(event) {
// when multiple is set to false and the user already uploaded a piece,
// do not propagate event
if(this.props.dropzoneInactive) {
@ -128,6 +128,7 @@ let FileDragAndDrop = React.createClass({
bubbles: true,
cancelable: true
});
evt.stopPropagation();
this.refs.fileinput.getDOMNode().dispatchEvent(evt);
},

View File

@ -22,11 +22,11 @@ let FileDragAndDropDialog = React.createClass({
<span className="file-drag-and-drop-dialog">
<p>Drag a file here</p>
<p>or</p>
<button
<span
className="btn btn-default"
onClick={this.props.onClick}>
choose a file to upload
</button>
</span>
</span>
);
}

View File

@ -197,7 +197,8 @@ var ReactS3FineUploader = React.createClass({
onProgress: this.onProgress,
onDeleteComplete: this.onDeleteComplete,
onSessionRequestComplete: this.onSessionRequestComplete,
onError: this.onError
onError: this.onError,
onValidate: this.onValidate
}
};
},
@ -235,6 +236,7 @@ var ReactS3FineUploader = React.createClass({
createBlob(file) {
let defer = new fineUploader.Promise();
window.fetch(this.props.createBlobRoutine.url, {
method: 'post',
headers: {
@ -312,6 +314,14 @@ var ReactS3FineUploader = React.createClass({
GlobalNotificationActions.appendGlobalNotification(notification);
},
onValidate(data) {
if(data.size > this.props.validation.sizeLimit) {
this.state.uploader.cancelAll();
let notification = new GlobalNotificationModel('Your file is bigger than 10MB', 'danger', 5000);
GlobalNotificationActions.appendGlobalNotification(notification);
}
},
onCancel(id) {
this.removeFileWithIdFromFilesToUpload(id);

View File

@ -142,7 +142,7 @@ let RegisterPiece = React.createClass( {
},
getSpecifyEditions() {
if (this.state.whitelabel.acl_editions) {
if(this.state.whitelabel.acl_editions || Object.keys(this.state.whitelabel).length === 0) {
return (
<PropertyCollapsible
name="num_editions"