-
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
Use "Completed Order" component in Profile page #3112
Conversation
- Create a template for userOrdersList - Create an helper function for userOrdersList - Fix CSS style errors - Update profile template with new template
@efalayi As I've mentioned before, when we want Ryan to review something let's add the |
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 make sure that everything we display makes sense within the context of the user profile.
import CompletedOrder from "/imports/plugins/core/checkout/client/components/completedOrder"; | ||
|
||
/** | ||
* @method handleDisplayMedia |
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.
Isn't there a way we could be rendering the Completed Order container rather than duplicating all this code?
<span data-i18n="cartCompleted.noOrdersFound">No orders found.</span> | ||
</div> | ||
{{/each}} | ||
</template> |
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.
Missing CR/LF
- Refactor userOrdersList helper function
- Remove margin-bottom
@ryan should the tweak in layout be specific to just the user profile page? |
@efalayi Yep, only on the user profile page. |
@ryan I just observed that the layout above is a bit different from the one here: https://scene.zeplin.io/project/58af8900737c137280322bd6/screen/59b7272087fcafc969870826. Do we still intend to use the layout on zeplin? |
@efalayi The layout in Zeplin is where we are going in the future w/ a refreshed design of our user profile views. The issue we are working in this PR is using the component consistently. So use the designs I provided here vs the Zeplin ones, which we will tackle when we work on the rest of the user profile updates. |
- Fix CSS styles on profile page
@zenweasel @rymorgan I've implemented all requested changes on this PR. |
…date-esther-fix-issue-3018
…merce/reaction into update-esther-fix-issue-3018
@efalayi I'm seeing some formatting problems and after that, this PR should be good from a design perspective. Need to vertically center align the copy in the rows for 'Your items'. On mobile - |
- Aligns items properly - Make titles sentence case
…date-esther-fix-issue-3018
@rymorgan I've updated the PR with the changes specified. |
A few of my comments didn't get addressed yet. Match the spacing between outer box and inner box. The 'Your orders' box should match the address box. So, we need to reduce the spacing to match. I know this wasn't in the original ticket, but while we are on this page, I'd like to fix the casing issue on the address book title. Should read 'Address book'. I also noticed two other spacing issues see below: The spacing is inconsistent between all of the boxes. All the boxes w/ title should have even spacing between them. The Your items box has more space both above and below than it should. This is happening on mobile and desktop. There's an awkward unevenness between the shipping and payment boxes on desktop. |
- Fix element margin and padding - Create list component for orders - Refactor code - Add JSDoc
@zenweasel I created an |
@rymorgan Are we will saying "Your cart" in the completed order page? Should we just say "Your items"? |
I'll get to it and update the PR asap. |
@zenweasel @rymorgan after making the change, this is what completed order page looks like:
|
- Fix css styles
- Fix error display
@zenweasel I just updated the PR with the changes. I noticed that no message was displayed if the user has no orders (that's now fixed in the update). |
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.
A few code changes here still. Mostly want to try and eliminate as much Blaze code as we can.
* @since 1.5.1 | ||
* @return {Array} - an array of orders | ||
*/ | ||
function getOrders() { |
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.
I'm confused as to why we are doing anything at all in the template. If we still need the template at all the only thing it should be doing is rendering the component.
{{> React completedOrders }} | ||
</div> | ||
{{else}} | ||
<div class="alert alert-info"> |
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 component should be handling both the found and not found cases.
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.
Okay. I'll create functions to render found and not found cases in the component.
return ( | ||
<div className="container order-completed"> | ||
|
||
let headerText; |
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 component should not need to be aware of what route it is in. It should be handled by passing in a prop. Components should be as dumb as possible.
@@ -10,16 +9,24 @@ import CompletedOrderItem from "./completedOrderItem"; | |||
* @property {String} shopName - The name of the shop | |||
* @property {Array} items - an array of individual items for this shop | |||
* @property {Function} handleDisplayMedia - A function for displaying product images | |||
* @property {boolean} isProfilePage - Checks if current page is Profile Page |
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.
Consistent casing for Javascript types
return ( | ||
<div className="order-details-shop-breakdown"> | ||
{/* This is the left side / main content */} | ||
<div className="order-details-info-box"> | ||
<div className="store-detail-box"> | ||
<span className="order-details-store-title">{shopName}</span> | ||
<span className="order-details-shipping-name">{shippingMethod.carrier} - {shippingMethod.label}</span> | ||
<span className="order-details-shipping-name">{shippingName}</span> |
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 was this changed?
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.
shippingName
varies depending on whether the current page is profile page. It is defined in line 16.
@@ -6,9 +6,11 @@ import { Components, registerComponent } from "@reactioncommerce/reaction-compon | |||
* @summary Displays the order summary for each shop | |||
* @param {Object} props - React PropTypes | |||
* @property {Object} shopSummary - An object representing the summary information for this Shop | |||
* @property {boolean} isProfilePage - Checks if current page is Profile Page |
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.
Consistent casing
@zenweasel Agree, let's add a rule between different orders. Two things:
|
- Fix css styles - Fix typo errors
…e-3018 Use "Completed Order" component in Profile page
Resolves #3018
Displayed orders list on user profile page uses the old completed order Blaze template but we should reuse the Completed Order component that was converted to React and made marketplace-aware.
Fix
CompletedOrder
react componentTest