mirror of
https://github.com/fspc/workstand.git
synced 2026-09-16 16:41:38 -04:00
Update to stage-3.
This commit is contained in:
@@ -75,7 +75,7 @@ class BikeForm extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
handleSave = () => {
|
||||
handleSave() {
|
||||
const id = this.state.bike.id;
|
||||
const data = JSON.stringify(this.state.bike);
|
||||
const csrfToken = Cookies.get('csrftoken');
|
||||
@@ -99,7 +99,7 @@ class BikeForm extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
render = () => {
|
||||
render() {
|
||||
const timezone = moment.tz.guess();
|
||||
const {
|
||||
claimed_at,
|
||||
@@ -255,4 +255,8 @@ class BikeForm extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
BikeForm.propTypes = {
|
||||
editing: PropTypes.bool,
|
||||
handleClose: PropTypes.func,
|
||||
}
|
||||
export default BikeForm;
|
||||
|
||||
@@ -6,13 +6,7 @@ import BikeForm from '../BikeForm';
|
||||
/**
|
||||
* A modal dialog can only be closed by selecting one of the actions.
|
||||
*/
|
||||
export default class BikeModal extends React.Component {
|
||||
static propTypes = {
|
||||
open: PropTypes.bool,
|
||||
bike: PropTypes.object,
|
||||
editing: PropTypes.bool,
|
||||
}
|
||||
|
||||
class BikeModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
@@ -23,7 +17,7 @@ export default class BikeModal extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps = (newProps) => {
|
||||
componentWillReceiveProps(newProps) {
|
||||
this.setState({
|
||||
...this.state,
|
||||
open: newProps.open || false,
|
||||
@@ -32,7 +26,7 @@ export default class BikeModal extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
handleClose = () => {
|
||||
handleClose() {
|
||||
this.setState({ open: false });
|
||||
};
|
||||
|
||||
@@ -63,3 +57,9 @@ export default class BikeModal extends React.Component {
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
|
||||
export default BikeModal.propTypes = {
|
||||
open: PropTypes.bool,
|
||||
bike: PropTypes.object,
|
||||
editing: PropTypes.bool,
|
||||
};
|
||||
|
||||
@@ -42,19 +42,6 @@ export default class BikeTable extends React.Component {
|
||||
}
|
||||
|
||||
getBikes = () => {
|
||||
fetch('/api/v1/bikes/', {
|
||||
credentials: 'same-origin',
|
||||
})
|
||||
.then(checkStatus)
|
||||
.then(parseJSON)
|
||||
.then((data) => {
|
||||
this.setState({ bikes: data });
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('request failed', error);
|
||||
});
|
||||
}
|
||||
|
||||
handleEditBike(bike) {
|
||||
this.setState({
|
||||
...this.state,
|
||||
@@ -66,7 +53,7 @@ export default class BikeTable extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
handleAddBike = () => {
|
||||
handleAddBike() {
|
||||
this.setState({
|
||||
...this.state,
|
||||
bikeModal: {
|
||||
|
||||
@@ -32,15 +32,7 @@ const styles = {
|
||||
},
|
||||
};
|
||||
|
||||
export default class SignedInList extends React.Component {
|
||||
static propTypes = {
|
||||
members: PropTypes.arrayOf(PropTypes.shape({
|
||||
id: PropTypes.number,
|
||||
purpose: PropTypes.string,
|
||||
at: PropTypes.instanceOf(moment),
|
||||
})),
|
||||
}
|
||||
|
||||
class SignedInList extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { tick: 0 };
|
||||
@@ -117,3 +109,11 @@ export default class SignedInList extends React.Component {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SignedInList.propTypes = {
|
||||
members: PropTypes.arrayOf(PropTypes.shape({
|
||||
id: PropTypes.number,
|
||||
purpose: PropTypes.string,
|
||||
at: PropTypes.instanceOf(moment),
|
||||
})),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user