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

Add purchase history component #392

Conversation

AlexeyKaryka
Copy link
Contributor

This PR is a:

[ X ] New feature
[ ] Enhancement/Optimization
[ ] Refactor
[ ] Bugfix
[ ] Test for existing code
[ ] Documentation

Summary

When this pull request is merged, it will...

Additional information

@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Oct 19, 2018

Fails
🚫

The following file(s) were not formatted with prettier. Make sure to execute npm run prettier locally prior to committing.

packages/venia-concept/src/components/PurchaseHistory/purchaseHistory.js
packages/venia-concept/src/components/PurchaseHistory/PurchaseHistoryItem/helpers.js
packages/venia-concept/src/components/PurchaseHistory/PurchaseHistoryItem/purchaseHistoryItem.js
🚫

The following file(s) did not pass ESLint. Execute npm run lint locally for more details

packages/venia-concept/src/components/PurchaseHistory/PurchaseHistoryItem/purchaseHistoryItem.js

Generated by 🚫 dangerJS

@AlexeyKaryka AlexeyKaryka force-pushed the feature/purchase-history-component branch from 5e00a7c to 6ed917b Compare October 22, 2018 07:24
} = this.props;

const trimedTitle =
title.length >= 19 ? `${title.substring(0, 19)}...` : title;
Copy link
Contributor

Choose a reason for hiding this comment

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

First of all, why it is 19? It better to avoid magical numbers. Secondly, it is better to create common util function trimString(str, maxLength) or something like this and move the logic there. Thirdly, you can add ellipsis using css text-overflow: ellipsis;

// this.props.fetchPurchaseHistory();
// }

// componentWillUnmount() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, do not add commented code to pull requests

id: 2,
imageSrc: 'asd',
title: 'consectetur adipiscing elit',
date: '12,12,2018',
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a strange format for date.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's simply example of string formatted date, produced and put by the container component

display: flex;
align-items: center;
position: relative;
padding: 17px 23px 9.5px 0px;
Copy link
Contributor

Choose a reason for hiding this comment

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

It is a good practice to specify even number of pixels.

@AlexeyKaryka AlexeyKaryka force-pushed the feature/purchase-history-component branch 2 times, most recently from 8682403 to c8530bd Compare October 23, 2018 10:37
};

processDate(date) {
return `${date.getDate()}, ${date.getMonth()}, ${date.getFullYear()}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

You can move this to helpers.js file.

@AlexeyKaryka AlexeyKaryka force-pushed the feature/purchase-history-component branch 3 times, most recently from edefb67 to 3775fe7 Compare October 23, 2018 11:44
@AlexeyKaryka AlexeyKaryka force-pushed the feature/purchase-history-component branch from 3775fe7 to 17aea33 Compare October 23, 2018 12:43
@Starotitorov Starotitorov merged commit 05fc10d into magento:feature/purchase-history-page Oct 23, 2018
Starotitorov pushed a commit that referenced this pull request Oct 26, 2018
Starotitorov pushed a commit that referenced this pull request Nov 16, 2018
Starotitorov pushed a commit that referenced this pull request Nov 20, 2018
jimbo pushed a commit that referenced this pull request Nov 20, 2018
* Add purchase history component (#392)

* Fix link and prop types (#407)

* Finish item image

* Simple test for static part of purchase history page (#417)

* Add simple test for purchase history page and prettier a few files

* Add tests for purchase history item component

* Add some styles to filter component (#448)

* Add semantic tags in list, prettier a few files (#443)

* Convert px to rem

* Address review comments

* Update purchase history styles
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.

3 participants