mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
Merge pull request #73 from ascribe/AD-1510-limit-create-editions-to-100
AD-1510 Limit edition creation to 1-100
This commit is contained in:
commit
93c2ea99e9
@ -19,7 +19,7 @@ let CreateEditionsForm = React.createClass({
|
|||||||
pieceId: React.PropTypes.number
|
pieceId: React.PropTypes.number
|
||||||
},
|
},
|
||||||
|
|
||||||
getFormData(){
|
getFormData() {
|
||||||
return {
|
return {
|
||||||
piece_id: parseInt(this.props.pieceId, 10)
|
piece_id: parseInt(this.props.pieceId, 10)
|
||||||
};
|
};
|
||||||
@ -58,7 +58,8 @@ let CreateEditionsForm = React.createClass({
|
|||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="(e.g. 32)"
|
placeholder="(e.g. 32)"
|
||||||
min={1}/>
|
min={1}
|
||||||
|
max={100} />
|
||||||
</Property>
|
</Property>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
@ -240,7 +240,17 @@ const Property = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleCheckboxToggle() {
|
handleCheckboxToggle() {
|
||||||
this.setExpanded(!this.state.expanded);
|
const expanded = !this.state.expanded;
|
||||||
|
|
||||||
|
this.setExpanded(expanded);
|
||||||
|
|
||||||
|
// Reset the value to be the initial value when the checkbox is unticked since the
|
||||||
|
// user doesn't want to specify their own value.
|
||||||
|
if (!expanded) {
|
||||||
|
this.setState({
|
||||||
|
value: this.state.initialValue
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
renderChildren(style) {
|
renderChildren(style) {
|
||||||
|
@ -89,7 +89,8 @@ let RegisterPiece = React.createClass( {
|
|||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="(e.g. 32)"
|
placeholder="(e.g. 32)"
|
||||||
min={0}/>
|
min={1}
|
||||||
|
max={100} />
|
||||||
</Property>
|
</Property>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user