Skip to content

Commit

Permalink
chore: Update to webpack 3 and React 15
Browse files Browse the repository at this point in the history
  • Loading branch information
bebraw committed Aug 7, 2017
1 parent 2dc5382 commit ba0eedc
Show file tree
Hide file tree
Showing 23 changed files with 13,802 additions and 1,599 deletions.
4 changes: 2 additions & 2 deletions immutable_app/app/actions/lanes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {List, Map} from 'immutable';
import uuid from 'node-uuid';
import { List, Map } from 'immutable';
import uuid from 'uuid';

export const CREATE_LANE = 'CREATE_LANE';
export function createLane(lane) {
Expand Down
2 changes: 1 addition & 1 deletion immutable_app/app/actions/notes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import uuid from 'node-uuid';
import uuid from 'uuid';

export const CREATE_NOTE = 'CREATE_NOTE';
export function createNote(note) {
Expand Down
4 changes: 2 additions & 2 deletions immutable_app/app/components/Editable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';

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

return (
<div {...props}>
<div className={className}>
{editing ? this.renderEdit() : this.renderValue()}
</div>
);
Expand Down
13 changes: 8 additions & 5 deletions immutable_app/app/components/Lane.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import {compose} from 'redux';
import {connect} from 'react-redux';
import {DropTarget} from 'react-dnd';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { DropTarget } from 'react-dnd';
import Notes from './Notes.jsx';
import Editable from './Editable.jsx';
import ItemTypes from '../constants/itemTypes';
Expand All @@ -24,11 +24,14 @@ const noteTarget = {

class Lane extends React.Component {
render() {
const {connectDropTarget, lane, laneNotes, ...props} = this.props;
const props = this.props;
const {
connectDropTarget, lane, laneNotes, className
} = props;
const laneId = lane.get('id');

return connectDropTarget(
<div {...props}>
<div className={className}>
<div className="lane-header"
onClick={() => props.updateLane({id: laneId, editing: true})}>
<div className="lane-add-note">
Expand Down
7 changes: 5 additions & 2 deletions immutable_app/app/components/Note.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import React from 'react';
import {compose} from 'redux';
import {DragSource, DropTarget} from 'react-dnd';
import { compose } from 'redux';
import { DragSource, DropTarget } from 'react-dnd';
import ItemTypes from '../constants/itemTypes';

const noteSource = {
beginDrag(props) {
return {
id: props.id
};
},
isDragging(props, monitor) {
return props.id === monitor.getItem().id
}
};

Expand Down
30 changes: 16 additions & 14 deletions immutable_app/app/components/Notes.jsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
import React from 'react';
import {connect} from 'react-redux';
import { connect } from 'react-redux';
import Editable from './Editable.jsx';
import Note from './Note.jsx';
import {move} from '../actions/lanes';
import { move } from '../actions/lanes';

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

return (<ul className="notes">{notes.map((note) =>
<Note className="note" id={note.get('id')} key={note.get('id')}
editing={note.get('editing')} onMove={move}>
return (
<Note className="note" id={noteId} key={noteId}
editing={note.editing} onMove={move}>
<Editable
editing={note.get('editing')}
value={note.get('task')}
onValueClick={onValueClick.bind(null, note.get('id'))}
onEdit={onEdit.bind(null, note.get('id'))}
onDelete={onDelete.bind(null, note.get('id'))} />
onValueClick={onValueClick.bind(null, noteId)}
onEdit={onEdit.bind(null, noteId)}
onDelete={onDelete.bind(null, noteId)} />
</Note>
)}</ul>);
}
}
);
})}</ul>
);

export default connect(() => ({}), {
move
Expand Down
1 change: 1 addition & 0 deletions immutable_app/app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {fromJS} from 'immutable';
import Root from './containers/Root.jsx';
import configureStore from './store/configureStore';
import storage from './libs/storage';
import './main.css';

const APP_STORAGE = 'immutable_kanban';

Expand Down
2 changes: 1 addition & 1 deletion immutable_app/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = function karmaConfig (config) {
},

// Test webpack config
webpack: require('./webpack.config'),
webpack: require('./webpack.config')('test'),

// Hide webpack build information from output
webpackMiddleware: {
Expand Down
Loading

0 comments on commit ba0eedc

Please sign in to comment.