mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Fix comments in PR
This commit is contained in:
parent
b43faf9b45
commit
c1959033c0
@ -2,7 +2,7 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
let accordionListItemThumbnailPlaceholder = React.createClass({
|
||||
let AccordionListItemThumbnailPlaceholder = React.createClass({
|
||||
render() {
|
||||
return (
|
||||
<span className="ascribe-logo-circle">
|
||||
@ -12,4 +12,4 @@ let accordionListItemThumbnailPlaceholder = React.createClass({
|
||||
}
|
||||
});
|
||||
|
||||
export default accordionListItemThumbnailPlaceholder;
|
||||
export default AccordionListItemThumbnailPlaceholder;
|
||||
|
@ -94,8 +94,10 @@ let EditionActionPanel = React.createClass({
|
||||
},
|
||||
|
||||
render(){
|
||||
let { edition, currentUser } = this.props;
|
||||
let ActionPanelButtonListType = this.props.actionPanelButtonListType;
|
||||
const {
|
||||
actionPanelButtonListType: ActionPanelButtonListType,
|
||||
edition,
|
||||
currentUser } = this.props;
|
||||
|
||||
if (edition &&
|
||||
edition.notifications &&
|
||||
|
@ -37,7 +37,7 @@ let ConsignForm = React.createClass({
|
||||
|
||||
getInitialState() {
|
||||
return {
|
||||
email: this.props.email
|
||||
email: this.props.email || ''
|
||||
};
|
||||
},
|
||||
|
||||
@ -69,7 +69,7 @@ let ConsignForm = React.createClass({
|
||||
ref='form'
|
||||
url={url}
|
||||
getFormData={this.getFormData}
|
||||
handleSuccess={this.props.handleSuccess}
|
||||
handleSuccess={handleSuccess}
|
||||
buttons={
|
||||
<div className="modal-footer">
|
||||
<p className="pull-right">
|
||||
|
@ -210,7 +210,7 @@ let LoanForm = React.createClass({
|
||||
<input
|
||||
type="password"
|
||||
placeholder={getLangText('Enter your password')}
|
||||
required={showPassword ? 'required' : ''}/>
|
||||
required={showPassword}/>
|
||||
</Property>
|
||||
{children}
|
||||
</Form>
|
||||
|
@ -53,12 +53,10 @@ const InputContractAgreementCheckbox = React.createClass({
|
||||
},
|
||||
|
||||
componentWillReceiveProps({ email: nextEmail }) {
|
||||
const { contractAgreementList } = this.state;
|
||||
|
||||
if (this.props.email !== nextEmail) {
|
||||
if (isEmail(nextEmail)) {
|
||||
this.getContractAgreementsOrCreatePublic(nextEmail);
|
||||
} else if (contractAgreementList && contractAgreementList.length > 0) {
|
||||
} else if (this.getContractAgreement()) {
|
||||
ContractAgreementListActions.flushContractAgreementList();
|
||||
}
|
||||
}
|
||||
@ -69,7 +67,9 @@ const InputContractAgreementCheckbox = React.createClass({
|
||||
},
|
||||
|
||||
onStoreChange(state) {
|
||||
const contractAgreement = this.getContractAgreement(state.contractAgreementList);
|
||||
const contractAgreement = this.getContractAgreement(state.contractAgreementList);
|
||||
|
||||
// If there is no contract available, hide this `Property` from the user
|
||||
this.props.setExpanded(!!contractAgreement);
|
||||
|
||||
state = mergeOptions(state, {
|
||||
@ -97,16 +97,21 @@ const InputContractAgreementCheckbox = React.createClass({
|
||||
},
|
||||
|
||||
onChange(event) {
|
||||
// Sync the value between our `InputCheckbox` and this component's `terms`
|
||||
// so the parent `Property` is able to get the correct value of this component
|
||||
// when the `Form` queries it.
|
||||
this.setState({
|
||||
value: React.addons.update(this.state.value, {
|
||||
terms: { $set: event.target.value }
|
||||
})
|
||||
});
|
||||
|
||||
// Propagate change events from the checkbox up to the parent `Property`
|
||||
this.props.onChange(event);
|
||||
},
|
||||
|
||||
getContractAgreement(contractAgreementList = this.state.contractAgreementList) {
|
||||
if (contractAgreementList && contractAgreementList.length > 0) {
|
||||
if (contractAgreementList && contractAgreementList.length) {
|
||||
return contractAgreementList[0];
|
||||
}
|
||||
},
|
||||
|
@ -96,18 +96,21 @@ const InputFineUploader = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
const { fileInputElement,
|
||||
keyRoutine,
|
||||
createBlobRoutine,
|
||||
validation,
|
||||
setIsUploadReady,
|
||||
isReadyForFormSubmission,
|
||||
areAssetsDownloadable,
|
||||
enableLocalHashing,
|
||||
uploadMethod,
|
||||
fileClassToUpload,
|
||||
disabled } = this.props;
|
||||
let editable = this.props.isFineUploaderActive;
|
||||
const {
|
||||
areAssetsDownloadable,
|
||||
enableLocalHashing,
|
||||
createBlobRoutine,
|
||||
disabled,
|
||||
fileClassToUpload,
|
||||
fileInputElement,
|
||||
isFineUploaderActive,
|
||||
isReadyForFormSubmission,
|
||||
keyRoutine,
|
||||
setIsUploadReady,
|
||||
uploadMethod,
|
||||
validation } = this.props;
|
||||
|
||||
let editable = isFineUploaderActive;
|
||||
|
||||
// if disabled is actually set by property, we want to override
|
||||
// isFineUploaderActive
|
||||
|
@ -239,6 +239,10 @@ const Property = React.createClass({
|
||||
this.setState({ expanded });
|
||||
},
|
||||
|
||||
handleCheckboxToggle() {
|
||||
this.setExpanded(!this.state.expanded);
|
||||
},
|
||||
|
||||
renderChildren(style) {
|
||||
// Input's props should only be cloned and propagated down the tree,
|
||||
// if the component is actually being shown (!== 'expanded === false')
|
||||
@ -280,10 +284,6 @@ const Property = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
handleCheckboxToggle() {
|
||||
this.setState({expanded: !this.state.expanded});
|
||||
},
|
||||
|
||||
getCheckbox() {
|
||||
const { checkboxLabel } = this.props;
|
||||
|
||||
|
@ -30,7 +30,7 @@ let PieceListBulkModal = React.createClass({
|
||||
},
|
||||
|
||||
render() {
|
||||
if (Object.keys(this.props.availableAcls).length > 0) {
|
||||
if (Object.keys(this.props.availableAcls).length) {
|
||||
return (
|
||||
<div className={this.props.className}>
|
||||
<div className="row no-margin">
|
||||
|
@ -6,7 +6,7 @@ import Vivi23AccordionListItemThumbnailPlaceholder from './23vivi_accordion_list
|
||||
|
||||
import MarketPieceList from '../market/market_piece_list';
|
||||
|
||||
let vivi23PieceList = React.createClass({
|
||||
let Vivi23PieceList = React.createClass({
|
||||
propTypes: {
|
||||
location: React.PropTypes.object
|
||||
},
|
||||
@ -21,4 +21,4 @@ let vivi23PieceList = React.createClass({
|
||||
|
||||
});
|
||||
|
||||
export default vivi23PieceList;
|
||||
export default Vivi23PieceList;
|
||||
|
@ -199,7 +199,7 @@ let IkonotvRegisterPiece = React.createClass({
|
||||
|
||||
getSlideLoan() {
|
||||
if (this.canSubmit()) {
|
||||
const {piece, whitelabel} = this.state;
|
||||
const { piece, whitelabel } = this.state;
|
||||
let today = new Moment();
|
||||
let endDate = new Moment();
|
||||
endDate.add(2, 'years');
|
||||
|
@ -144,8 +144,7 @@ let MarketSubmitButton = React.createClass({
|
||||
} else {
|
||||
return (
|
||||
<AclProxy
|
||||
aclObject={{'acl_consign': availableAcls.acl_consign && canSubmit}}
|
||||
aclName='acl_consign'>
|
||||
show={availableAcls.acl_consign && canSubmit}>
|
||||
<ModalWrapper
|
||||
trigger={triggerButton}
|
||||
handleSuccess={handleSuccess}
|
||||
|
@ -55,7 +55,7 @@ let MarketAdditionalDataForm = React.createClass({
|
||||
{
|
||||
// Allow the form to be submitted if there's already an additional image uploaded
|
||||
isUploadReady: this.isUploadReadyOnChange(pieceStore.piece),
|
||||
forceUpdateKey: 0,
|
||||
forceUpdateKey: 0
|
||||
});
|
||||
},
|
||||
|
||||
@ -72,9 +72,7 @@ let MarketAdditionalDataForm = React.createClass({
|
||||
},
|
||||
|
||||
onChange(state) {
|
||||
this.setState(state);
|
||||
|
||||
this.setState({
|
||||
Object.assign({}, state, {
|
||||
// Allow the form to be submitted if the updated piece already has an additional image uploaded
|
||||
isUploadReady: this.isUploadReadyOnChange(state.piece),
|
||||
|
||||
@ -87,6 +85,8 @@ let MarketAdditionalDataForm = React.createClass({
|
||||
*/
|
||||
forceUpdateKey: this.state.forceUpdateKey + 1
|
||||
});
|
||||
|
||||
this.setState(state);
|
||||
},
|
||||
|
||||
getFormData() {
|
||||
@ -134,7 +134,9 @@ let MarketAdditionalDataForm = React.createClass({
|
||||
render() {
|
||||
const { editable, isInline, handleSuccess, showHeading, showNotification, submitLabel } = this.props;
|
||||
const { piece } = this.state;
|
||||
let buttons, spinner, heading;
|
||||
let buttons, heading;
|
||||
|
||||
let spinner = <AscribeSpinner color='dark-blue' size='lg' />;
|
||||
|
||||
if (!isInline) {
|
||||
buttons = (
|
||||
@ -148,7 +150,9 @@ let MarketAdditionalDataForm = React.createClass({
|
||||
|
||||
spinner = (
|
||||
<div className="modal-footer">
|
||||
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
||||
<p className="pull-right">
|
||||
{spinner}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -228,7 +232,7 @@ let MarketAdditionalDataForm = React.createClass({
|
||||
} else {
|
||||
return (
|
||||
<div className="ascribe-loading-position">
|
||||
<AscribeSpinner color='dark-blue' size='lg' />
|
||||
{spinner}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ let MarketRegisterPiece = React.createClass({
|
||||
handleAdditionalDataSuccess() {
|
||||
this.refreshPieceList();
|
||||
|
||||
this.history.pushState(null, `/collection`);
|
||||
this.history.pushState(null, '/collection');
|
||||
},
|
||||
|
||||
// We need to increase the step to lock the forms that are already filled out
|
||||
|
Loading…
Reference in New Issue
Block a user