mirror of
https://github.com/fspc/workstand.git
synced 2025-02-23 09:13:23 -05:00
Update to stage-3.
This commit is contained in:
parent
2219366859
commit
7c2df81c6a
@ -1,3 +1,4 @@
|
||||
{
|
||||
presets: ['es2015', 'stage-0', 'react']
|
||||
"presets": ["latest", "stage-3", "react"],
|
||||
"plugins": ["transform-runtime"]
|
||||
}
|
@ -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),
|
||||
})),
|
||||
};
|
||||
|
@ -29,9 +29,9 @@
|
||||
"babel-core": "^6.9.1",
|
||||
"babel-loader": "^6.2.4",
|
||||
"babel-polyfill": "^6.22.0",
|
||||
"babel-preset-es2015": "^6.9.0",
|
||||
"babel-preset-latest": "^6.22.0",
|
||||
"babel-preset-react": "^6.5.0",
|
||||
"babel-preset-stage-0": "^6.5.0",
|
||||
"babel-preset-stage-3": "^6.22.0",
|
||||
"css-loader": "^0.23.1",
|
||||
"eslint": "^3.9.1",
|
||||
"eslint-plugin-import": "^2.1.0",
|
||||
|
@ -1,50 +0,0 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const BundleTracker = require('webpack-bundle-tracker');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
|
||||
module.exports = {
|
||||
context: __dirname,
|
||||
devtool: 'inline-source-map',
|
||||
entry: {
|
||||
signin: './assets/js/index',
|
||||
members: './assets/js/members/index',
|
||||
},
|
||||
output: {
|
||||
path: path.resolve('./assets/bundles/'),
|
||||
filename: '[name]-[hash].js',
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new BundleTracker({ filename: './webpack-stats.json' }),
|
||||
new ExtractTextPlugin('react-toolbox.css', { allChunks: true }),
|
||||
new webpack.NoErrorsPlugin(),
|
||||
],
|
||||
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader',
|
||||
query: {
|
||||
presets: ['es2015', 'stage-0', 'react'],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /(\.scss|\.css)$/,
|
||||
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap!toolbox'),
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
modulesDirectories: [
|
||||
'node_modules',
|
||||
'bower_components',
|
||||
path.resolve(__dirname, './node_modules'),
|
||||
],
|
||||
extensions: ['', '.js', '.jsx', '.scss'],
|
||||
},
|
||||
postcss: [autoprefixer],
|
||||
};
|
@ -30,13 +30,15 @@ config.plugins = config.plugins.concat([
|
||||
new ExtractTextPlugin('react-toolbox.css', { allChunks: true }),
|
||||
]);
|
||||
|
||||
// Add a loader for JSX files with react-hot enabled
|
||||
// Add a loader for JSX files
|
||||
config.module.loaders.push(
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /node_modules/,
|
||||
loaders: ['react-hot', 'babel-loader'],
|
||||
|
||||
loader: 'babel-loader',
|
||||
query: {
|
||||
presets: ['latest', 'react', 'stage-3'],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /(\.scss|\.css)$/,
|
||||
|
Loading…
x
Reference in New Issue
Block a user