-
Notifications
You must be signed in to change notification settings - Fork 288
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
feat: add Orders to Account Profile #507
Merged
Merged
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
c4d7d1e
add header / title to Address Book
kieckhafer 5448681
add ProfileOrders component to Profile page
kieckhafer c4a172e
add query and HOC to get multiple orders per accountId
kieckhafer 201c761
Merge remote-tracking branch 'origin/develop' into feat-kieckhafer-ne…
kieckhafer baa027e
use primaryShopId instead of shop._id in withORders
kieckhafer 96bf62e
add date-fns for date formatting on account orders page
kieckhafer 886c093
Merge remote-tracking branch 'origin/develop' into feat-kieckhafer-ne…
kieckhafer 458a24a
update gql with new edges / node
kieckhafer 5af41df
add language to query
kieckhafer 4eaecf6
fix proptype
kieckhafer fb67fac
add spacing around container
kieckhafer 39d7b08
add ProfileOrders component
kieckhafer 80e6920
add tracking info to gql query
kieckhafer fb34f49
add new components for OrderCard
kieckhafer d82ab80
ProfileOrders component
kieckhafer c340aa3
OrderCard component
kieckhafer b3e0692
destructure some variables
kieckhafer 499d4d7
add filter to gql query
kieckhafer 38dad5a
add header to addressbook page
kieckhafer 3ada014
OrderCardSummary component
kieckhafer 3158c57
OrderCardFulfillmentGroup component
kieckhafer 8256e4f
update OrderCardSummary to remove styles no longer needed with Compon…
kieckhafer 1acaf8e
add order summary to Order fragment
kieckhafer 4d170f5
lint fixes
kieckhafer 336f6e8
OrderCardHeader component
kieckhafer f1eb1aa
update reaction component library version
kieckhafer a4721bb
update test snapshots
kieckhafer 4edbb59
Merge remote-tracking branch 'origin/develop' into feat-kieckhafer-ne…
kieckhafer 6347b4c
move order status into it's own badge component
kieckhafer a5b5289
update tests for all new components
kieckhafer cb6cd88
Merge remote-tracking branch 'origin/develop' into feat-kieckhafer-ne…
kieckhafer ab1f6f8
fix console warnings
kieckhafer de74413
separate account profile UIstore data
kieckhafer f4f647d
udpate test with new data
kieckhafer a23823c
move language to display query
kieckhafer cf2444c
update with new data format
kieckhafer b9929ce
add pagination info to queries
kieckhafer f70a0a1
fix proptypes
kieckhafer fd9994c
move error check below dropdown
kieckhafer bd61059
update select with new dropdown names
kieckhafer 5de3153
add pagination component to ProfileOrders
kieckhafer 71cdd6f
split profile page to deal with pagination issues
kieckhafer b61e315
add ProfileMenu component
kieckhafer 3251034
use imported toJS to appease test gods
kieckhafer f5a068f
pass correct query name
kieckhafer 02adb5f
updated snapshots with new data
kieckhafer e8ce8d4
lint fix
kieckhafer 57bbca5
add more sizes to pagination defaults to allow smaller result groupin…
kieckhafer 3522b09
reset search params when switching order type
kieckhafer 152d437
tests and linting
kieckhafer 48fa874
use new `OrderCard` for order thank you page
kieckhafer 08849ac
Merge branch 'develop' into feat-kieckhafer-newAccountPage
kieckhafer 0778b80
refactor: change isHeaderOpen to isExpanded for better syncronicity a…
kieckhafer 1b0e5c2
Merge branch 'feat-kieckhafer-newAccountPage' of github.com:/reaction…
kieckhafer 31a60ec
Merge remote-tracking branch 'origin/develop' into feat-kieckhafer-ne…
kieckhafer 241713a
add fulfillmentGroup._id as key
kieckhafer 3b70679
update snapshots
kieckhafer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import React, { Component, Fragment } from "react"; | ||
import PropTypes from "prop-types"; | ||
import { withStyles } from "@material-ui/core/styles"; | ||
import Grid from "@material-ui/core/Grid"; | ||
import OrderCardHeader from "components/OrderCardHeader"; | ||
import OrderCardFulfillmentGroup from "components/OrderCardFulfillmentGroup"; | ||
import OrderCardSummary from "components/OrderCardSummary"; | ||
import PageLoading from "components/PageLoading"; | ||
|
||
const styles = (theme) => ({ | ||
orderCard: { | ||
border: `solid 1px ${theme.palette.reaction.black10}`, | ||
borderRadius: "2px", | ||
marginBottom: theme.spacing.unit * 2.5 | ||
}, | ||
orderCardHeader: {}, | ||
orderCardFulfillmentGroups: {}, | ||
orderCardSummary: { | ||
borderTop: theme.palette.borders.default, | ||
paddingBottom: theme.spacing.unit * 2, | ||
paddingLeft: theme.spacing.unit * 2, | ||
paddingRight: theme.spacing.unit * 2, | ||
paddingTop: theme.spacing.unit * 2 | ||
} | ||
}); | ||
|
||
@withStyles(styles, { withTheme: true }) | ||
class OrderCard extends Component { | ||
static propTypes = { | ||
classes: PropTypes.object, | ||
isExpanded: PropTypes.bool, | ||
isLoadingOrders: PropTypes.bool, | ||
order: PropTypes.shape({ | ||
email: PropTypes.string.isRequired, | ||
fulfillmentGroups: PropTypes.arrayOf(PropTypes.object).isRequired, | ||
payments: PropTypes.arrayOf(PropTypes.object), | ||
referenceId: PropTypes.string.isRequired | ||
}) | ||
}; | ||
|
||
renderFulfillmentGroups() { | ||
const { order: { fulfillmentGroups } } = this.props; | ||
|
||
return ( | ||
<Fragment> | ||
{fulfillmentGroups.map((fulfillmentGroup, index) => ( | ||
<OrderCardFulfillmentGroup | ||
key={`${fulfillmentGroup._id}`} | ||
fulfillmentGroup={fulfillmentGroup} | ||
currentGroupCount={index + 1} | ||
totalGroupsCount={fulfillmentGroups.length} | ||
/> | ||
))} | ||
</Fragment> | ||
); | ||
} | ||
|
||
renderHeader() { | ||
const { isExpanded, order } = this.props; | ||
|
||
return <OrderCardHeader isExpanded={isExpanded} order={order} />; | ||
} | ||
|
||
renderSummary() { | ||
const { order: { summary } } = this.props; | ||
return <OrderCardSummary summary={summary} />; | ||
} | ||
|
||
render() { | ||
const { classes, isLoadingOrders } = this.props; | ||
|
||
if (isLoadingOrders) return <PageLoading message="Loading order details..." />; | ||
|
||
return ( | ||
<Grid container> | ||
<Grid item xs={12} md={12}> | ||
<div className={classes.orderCard}> | ||
<header className={classes.orderCardHeader}> | ||
{this.renderHeader()} | ||
</header> | ||
<section className={classes.orderCardFulfillmentGroups}> | ||
{this.renderFulfillmentGroups()} | ||
</section> | ||
<section className={classes.orderCardSummary}> | ||
{this.renderSummary()} | ||
</section> | ||
</div> | ||
</Grid> | ||
</Grid> | ||
); | ||
} | ||
} | ||
|
||
export default OrderCard; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Was there a decision to use
date-fns
instead of moment for new projects? It's fine with me but I'd like to see the decision recorded and communicated if it hasn't been.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.
We had a chat in Slack about a light(er)weight solution for dates, considering we need very little. Made a DR and tagged you in Notion.