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 ( + + + + ); + } else { + return ( + + ); + } + }, + + render() { + const { location } = this.props; return (
@@ -328,18 +351,11 @@ const PRRegisterPieceForm = React.createClass({ className="ascribe-property-collapsible-toggle" style={{paddingBottom: 0}}> - {getLangText('By submitting this form, you agree to the Terms of Service of Portfolio Review.')} - + {this.getSubmitButton()}
); } diff --git a/sass/whitelabel/prize/portfolioreview/portfolioreview_custom_style.scss b/sass/whitelabel/prize/portfolioreview/portfolioreview_custom_style.scss index 5e50dac6..9f79441f 100644 --- a/sass/whitelabel/prize/portfolioreview/portfolioreview_custom_style.scss +++ b/sass/whitelabel/prize/portfolioreview/portfolioreview_custom_style.scss @@ -24,7 +24,7 @@ $pr--button-color: $pr--nav-fg-prim-color; } .ascribe-property { - > p > span, + > p > span:not(> .span), > textarea, > input { color: $pr--nav-fg-prim-color;