Skip to content

Commit ba0eedc

Browse files
committed
chore: Update to webpack 3 and React 15
1 parent 2dc5382 commit ba0eedc

File tree

23 files changed

+13802
-1599
lines changed

23 files changed

+13802
-1599
lines changed

immutable_app/app/actions/lanes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {List, Map} from 'immutable';
2-
import uuid from 'node-uuid';
1+
import { List, Map } from 'immutable';
2+
import uuid from 'uuid';
33

44
export const CREATE_LANE = 'CREATE_LANE';
55
export function createLane(lane) {

immutable_app/app/actions/notes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import uuid from 'node-uuid';
1+
import uuid from 'uuid';
22

33
export const CREATE_NOTE = 'CREATE_NOTE';
44
export function createNote(note) {

immutable_app/app/components/Editable.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import React from 'react';
22

33
export default class Editable extends React.Component {
44
render() {
5-
const {value, onEdit, onValueClick, editing, ...props} = this.props;
5+
const { value, onEdit, onValueClick, editing, className } = this.props;
66

77
return (
8-
<div {...props}>
8+
<div className={className}>
99
{editing ? this.renderEdit() : this.renderValue()}
1010
</div>
1111
);

immutable_app/app/components/Lane.jsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2-
import {compose} from 'redux';
3-
import {connect} from 'react-redux';
4-
import {DropTarget} from 'react-dnd';
2+
import { compose } from 'redux';
3+
import { connect } from 'react-redux';
4+
import { DropTarget } from 'react-dnd';
55
import Notes from './Notes.jsx';
66
import Editable from './Editable.jsx';
77
import ItemTypes from '../constants/itemTypes';
@@ -24,11 +24,14 @@ const noteTarget = {
2424

2525
class Lane extends React.Component {
2626
render() {
27-
const {connectDropTarget, lane, laneNotes, ...props} = this.props;
27+
const props = this.props;
28+
const {
29+
connectDropTarget, lane, laneNotes, className
30+
} = props;
2831
const laneId = lane.get('id');
2932

3033
return connectDropTarget(
31-
<div {...props}>
34+
<div className={className}>
3235
<div className="lane-header"
3336
onClick={() => props.updateLane({id: laneId, editing: true})}>
3437
<div className="lane-add-note">

immutable_app/app/components/Note.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import React from 'react';
2-
import {compose} from 'redux';
3-
import {DragSource, DropTarget} from 'react-dnd';
2+
import { compose } from 'redux';
3+
import { DragSource, DropTarget } from 'react-dnd';
44
import ItemTypes from '../constants/itemTypes';
55

66
const noteSource = {
77
beginDrag(props) {
88
return {
99
id: props.id
1010
};
11+
},
12+
isDragging(props, monitor) {
13+
return props.id === monitor.getItem().id
1114
}
1215
};
1316

immutable_app/app/components/Notes.jsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
import React from 'react';
2-
import {connect} from 'react-redux';
2+
import { connect } from 'react-redux';
33
import Editable from './Editable.jsx';
44
import Note from './Note.jsx';
5-
import {move} from '../actions/lanes';
5+
import { move } from '../actions/lanes';
66

7-
class Notes extends React.Component {
8-
render() {
9-
const {notes, move, onValueClick, onEdit, onDelete} = this.props;
7+
const Notes = ({
8+
notes, move, onValueClick, onEdit, onDelete
9+
}) => (
10+
<ul className="notes">{notes.map((note) => {
11+
const noteId = note.get('id');
1012

11-
return (<ul className="notes">{notes.map((note) =>
12-
<Note className="note" id={note.get('id')} key={note.get('id')}
13-
editing={note.get('editing')} onMove={move}>
13+
return (
14+
<Note className="note" id={noteId} key={noteId}
15+
editing={note.editing} onMove={move}>
1416
<Editable
1517
editing={note.get('editing')}
1618
value={note.get('task')}
17-
onValueClick={onValueClick.bind(null, note.get('id'))}
18-
onEdit={onEdit.bind(null, note.get('id'))}
19-
onDelete={onDelete.bind(null, note.get('id'))} />
19+
onValueClick={onValueClick.bind(null, noteId)}
20+
onEdit={onEdit.bind(null, noteId)}
21+
onDelete={onDelete.bind(null, noteId)} />
2022
</Note>
21-
)}</ul>);
22-
}
23-
}
23+
);
24+
})}</ul>
25+
);
2426

2527
export default connect(() => ({}), {
2628
move

immutable_app/app/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {fromJS} from 'immutable';
44
import Root from './containers/Root.jsx';
55
import configureStore from './store/configureStore';
66
import storage from './libs/storage';
7+
import './main.css';
78

89
const APP_STORAGE = 'immutable_kanban';
910

immutable_app/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module.exports = function karmaConfig (config) {
4747
},
4848

4949
// Test webpack config
50-
webpack: require('./webpack.config'),
50+
webpack: require('./webpack.config')('test'),
5151

5252
// Hide webpack build information from output
5353
webpackMiddleware: {

0 commit comments

Comments
 (0)