Skip to content
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

refactor: order invoice print layout #5476

Merged
merged 16 commits into from
Aug 26, 2019

Conversation

kieckhafer
Copy link
Member

@kieckhafer kieckhafer commented Aug 22, 2019

Impact: minor
Type: refactor

Issue

The old print layout for an Order invoice was very outdated, from the styles to the data, nothing was current.

Solution

Update to go along with new design. This was done with the blessing of @reactioncommerce/design , but without any actual input from them, so we can / should revisit if needed. The outline is there for visualizing what the printed page will look like, it doesn't actually print the border.

Breaking changes

None

Testing

1.Create an order

  1. Click the "print invoice" button
  2. See the updated look
  3. Print
  4. See page prints.

Old:
Dashboard_pdf_orders

New:
Order__3idZrsiKuvmQ3yGL9_printable_invoice

@kieckhafer kieckhafer requested a review from mikemurray August 22, 2019 22:31
@kieckhafer kieckhafer changed the title Ref kieckhafer order invoice print layout refactor: order invoice print layout Aug 22, 2019
Signed-off-by: Erik Kieckhafer <[email protected]>
@rymorgan
Copy link
Contributor

@kieckhafer Looks good dude! One of the ugly corners of the Reaction Admin going away. One change, can you lose the icon in the button? We haven't established icons in buttons in our design system and I don't want to break any future rules we might set.

Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

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

The < back and print button no longer work after you close the print dialog either by printing or canceling.

The page needs some padding at the bottom.

import Typography from "@material-ui/core/Typography";
import Address from "@reactioncommerce/components/Address/v1";
import { i18next, Reaction } from "/client/api";

Copy link
Member

Choose a reason for hiding this comment

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

Import make styles (and the other material UI things with the named import "{}" style
"import { Button , Divider, ..etc, makeStyles } from "@material-ui/core"

Copy link
Member Author

Choose a reason for hiding this comment

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

Why are we doing it like this again? Didn't we switch it up from this style to doing each one independent at some point?

Copy link
Member

Choose a reason for hiding this comment

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

Tree shaking in MUI works better when you don't import the file directly. This is because tre shaking can also remove dead code within files, like if you export a function, but never import it, then it will be omitted in the final build. Using named imports import { someThing } from "something" can lead to better tree shaking.

Also, it reduces the risk of a breaking change because if files move around, they'd still be available at the root import level by name.

@kieckhafer
Copy link
Member Author

@rymorgan do you want to lose the print icon, and the left chevron on the back button? Or just the print icon?

@rymorgan
Copy link
Contributor

@rymorgan do you want to lose the print icon, and the left chevron on the back button? Or just the print icon?

Just the print icon. Now that I'm looking at this again the pattern for "detail" pages is to have the backlink happen in the app bar.

See image -
Screen Shot 2019-08-23 at 4 24 37 PM

@kieckhafer
Copy link
Member Author

@rymorgan is that just a design with the back arrow in the nav? I don't see it in action anywhere.

@mikemurray do we have that back button built into the AppBar at the moment?

@mikemurray
Copy link
Member

@kieckhafer We don't have a back button build into the app bar at the moment. How it's implemented is up for discussion (whether it's automatic, or you have a prop you set)

@kieckhafer
Copy link
Member Author

@rymorgan once the back pattern is settled, will revisit: https://github.com/reactioncommerce/reaction/issues/5480

@kieckhafer kieckhafer requested a review from mikemurray August 26, 2019 18:29
@kieckhafer
Copy link
Member Author

@mikemurray issues addressed, ready for another check

Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

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

👍

@mikemurray mikemurray merged commit 2c9a4dd into develop Aug 26, 2019
@mikemurray mikemurray deleted the ref-kieckhafer-orderInvoicePrintLayout branch August 26, 2019 20:35
@kieckhafer kieckhafer mentioned this pull request Aug 28, 2019
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