diff --git a/js/components/whitelabel/prize/portfolioreview/components/pr_forms/pr_register_piece_form.js b/js/components/whitelabel/prize/portfolioreview/components/pr_forms/pr_register_piece_form.js
index 98a5f2f8..1b900ec6 100644
--- a/js/components/whitelabel/prize/portfolioreview/components/pr_forms/pr_register_piece_form.js
+++ b/js/components/whitelabel/prize/portfolioreview/components/pr_forms/pr_register_piece_form.js
@@ -9,6 +9,7 @@ import InputTextAreaToggable from '../../../../../ascribe_forms/input_textarea_t
import UploadButton from '../../../../../ascribe_uploader/ascribe_upload_button/upload_button';
import InputFineuploader from '../../../../../ascribe_forms/input_fineuploader';
+import AscribeSpinner from '../../../../../ascribe_spinner';
import GlobalNotificationModel from '../../../../../../models/global_notification_model';
import GlobalNotificationActions from '../../../../../../actions/global_notification_actions';
@@ -36,13 +37,14 @@ const PRRegisterPieceForm = React.createClass({
getInitialState(){
return {
- digitalWorkKeyReady: false,
- thumbnailKeyReady: false,
+ digitalWorkKeyReady: true,
+ thumbnailKeyReady: true,
// we set this to true, as it is not required
supportingMaterialsReady: true,
- proofOfPaymentReady: false,
- piece: null
+ proofOfPaymentReady: true,
+ piece: null,
+ submitted: false
};
},
@@ -55,11 +57,10 @@ const PRRegisterPieceForm = React.createClass({
if(!this.validateForms()) {
return;
} else {
+ // disable the submission button right after the user
+ // clicks on it to avoid double submission
this.setState({
- digitalWorkKeyReady: false,
- thumbnailKeyReady: false,
- supportingMaterialsReady: false,
- proofOfPaymentReady: false
+ submitted: true
});
}
@@ -91,7 +92,7 @@ const PRRegisterPieceForm = React.createClass({
proofOfPayment.refs.input.createBlobRoutine();
});
- setCookie(currentUser.email, piece.id);
+ //setCookie(currentUser.email, piece.id);
return requests.post(ApiUrls.piece_extradata, {
body: {
@@ -149,12 +150,34 @@ const PRRegisterPieceForm = React.createClass({
};
},
- render() {
- const { location } = this.props;
+ getSubmitButton() {
const { digitalWorkKeyReady,
thumbnailKeyReady,
supportingMaterialsReady,
- proofOfPaymentReady } = this.state;
+ proofOfPaymentReady,
+ submitted } = this.state;
+
+ if(submitted) {
+ return (
+
+