-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order filtering by date #2860
Order filtering by date #2860
Conversation
@joykare here are my thoughts on the date picker styling. https://zpl.io/bz8M3ME |
@rymorgan I did not add question-label at the bottom of the calendar because it does not have any functionality (the keyboard shortcuts on react-dates don't work with this particular implementation). Otherwise good for a quick check |
….com/reactioncommerce/reaction into joykare-order-filtering-by-date-2359
@joykare I'll check it out. I only added the question mark b/c I thought the react calendar had that to explain how to use the calendar. But, I think, not including it is fine. I'll check out your PR. |
Also, one more thing for the rollover state it looks can you use the hover color from here: This one: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested yet but just some minor style questions
|
||
class OrderActions extends Component { | ||
static propTypes = { | ||
className: PropTypes.string, | ||
className: PropTypes.object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable name sounds like it should be a string but it appears it's not now. Can we give it a more descriptive name?
@@ -18,6 +18,7 @@ class OrderDashboard extends Component { | |||
handleSelect: PropTypes.func, | |||
isLoading: PropTypes.object, | |||
multipleSelect: PropTypes.bool, | |||
onDatesChange: PropTypes.func, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there some sort of pattern you are using for naming functions onThisChange
as opposed to handleThisChange
? If not I would like to standardize on one or the other. If so, let's codify this in a style guide somewhere so we can be consistent.
import React, { Component } from "react"; | ||
import PropTypes from "prop-types"; | ||
import { registerComponent } from "@reactioncommerce/reaction-components"; | ||
import { DayPickerRangeController } from "react-dates"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import order
}); | ||
|
||
if (this.props.onDatesChange) { | ||
this.props.onDatesChange(startDate, endDate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we wrapping this in a conditional? Will this function not always exist? And if not shouldn't we throw an error? I feel like this is an anti-pattern that has crept into our code somehow.
Also, maybe this is unavoidable but it seems like having this function and the one passed in via props both having the same name is a recipe for a bug down the road?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we have that conditional is b/c you dont have to have a prop function for when dates change; but in case you want to add some operations/ or change some stuff onDateChange specific to the component that extends the calendarPicker you could do that under this function.
Other example: https://github.com/reactioncommerce/reaction/blob/master/imports/plugins/core/ui/client/components/menu/menu.js#L7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense to me
@@ -3,3 +3,4 @@ import "./favicons"; | |||
|
|||
// Scripts | |||
import "bootstrap/dist/js/npm.js"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not add a blank line for no reason
Also, it's not working responsively. I think we should - |
Ran into one problem with filter but doesn't seem to be related to this PR. (#2902). Otherwise this seems to work well. Just had some minor style things to address and this should be ready to go. |
….com/reactioncommerce/reaction into joykare-order-filtering-by-date-2359
In anticipation of merging this PR I made a bug for the mobile responsive issue #2910 |
@kieha We're still waiting for your official blessing on this |
@rymorgan fixed the select. Works both ways now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well. LGTM. 👍🏽
@joykare Is making the filter disappear at more narrow width a quick fix you can do here rather than having it linger in another ticket? |
@zenweasel not as quick a fix as I thought initially, so I asked Ryan to have that as a separate ticket so that we can move along with getting all the filters in. |
Because BH is not working running ESLint gives me these errors
|
Resolves #2359
How to test