Skip to content

Conversation

@evansiroky
Copy link
Contributor

This adds an action that will switch the from and to locations and then dispatch a trip plan action.

This PR builds on top of #13

also add test case for this function
This option allows setting the custom builder function in the config
when creating the reducer’s initial state.  When using all of the
reducers together they make calls to the planTrip action, but there
wasn’t really a way to pass in a custom function that way.  For now it
seems like the only way to do this could be to set something in the
config of the state.

This PR includes the work done in #12.
@evansiroky evansiroky requested a review from landonreed March 23, 2017 00:44
@codecov-io
Copy link

codecov-io commented Mar 23, 2017

Codecov Report

Merging #14 into dev will decrease coverage by 0.07%.
The diff coverage is 5.88%.

@@           Coverage Diff           @@
##            dev     #14      +/-   ##
=======================================
- Coverage   7.2%   7.13%   -0.08%     
=======================================
  Files        34      35       +1     
  Lines       555     575      +20     
=======================================
+ Hits         40      41       +1     
- Misses      515     534      +19
Impacted Files Coverage Δ
lib/util/state.js 100% <ø> (+14.28%) ⬆️
lib/index.js 0% <0%> (ø) ⬆️
lib/components/form/switch-button.js 0% <0%> (ø)
lib/actions/map.js 0% <0%> (ø) ⬆️
lib/actions/api.js 86.36% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dffd054...136ed60. Read the comment docs.

Copy link
Member

@landonreed landonreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evansiroky, just need you to remove an unused import and respond to question about filename.

example.js Outdated

// import Bootstrap Grid components for layout
import { Navbar, Grid, Row, Col } from 'react-bootstrap'
import { Navbar, Grid, Row, Col, Button } from 'react-bootstrap'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Button import is not used.

@@ -0,0 +1,33 @@
import React, { Component, PropTypes } from 'react'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to be naming files in hear with dashes fil-name.js, rather than camelCase. Any reason it was switched up here?

* Add Switch Button to lib
* Alphabetize all the things in lib/index.js
* rename file for switch button
@evansiroky
Copy link
Contributor Author

I added the changes requested. Also, I don't particularly like where the switch button show up in the example. I merely added it so I could test out the functionality. It seems like every trip planner implements the switch button in a slightly different visual way. In my other project I'm mainly interested in using the new action that I made.

@evansiroky evansiroky merged commit 53393d9 into dev Mar 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants