mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
Merge branch 'AD-499-whitelabel-prize-with-sluice-as-k'
This commit is contained in:
commit
756480e4cf
@ -80,8 +80,7 @@ let Edition = React.createClass({
|
||||
handleDeleteSuccess(response) {
|
||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search, this.state.orderBy, this.state.orderAsc);
|
||||
|
||||
// we don't need to refresh the edition list for a piece here, since its reloaded from
|
||||
// scatch once you click on show-editions anyway
|
||||
EditionListActions.refreshEditionList(this.props.edition.parent);
|
||||
EditionListActions.closeAllEditionLists();
|
||||
EditionListActions.clearAllEditionSelections();
|
||||
|
||||
|
@ -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/',
|
||||
|
@ -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);
|
||||
},
|
||||
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user