-
Notifications
You must be signed in to change notification settings - Fork 685
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
Saved payment methods main view. #2882
Merged
dpatil-magento
merged 34 commits into
develop
from
revanth/saved_payment_methods_main_view
Dec 17, 2020
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
2af3f7a
Enabled saved payments link.
revanth0212 2c505ae
Added payment skeleton.
revanth0212 b90fe86
Moved stuff around.
revanth0212 e295112
Snapshot update.
revanth0212 4098a4c
Added other card types.
revanth0212 6ac74aa
Cleaned up some css.
revanth0212 e294ac8
Using INTL.
revanth0212 7c73950
Minor.
revanth0212 b1d7f04
Minor css change.
revanth0212 3a1c7fe
Changed name of payments target to checkoutPagePaymentTypes.
revanth0212 721a521
Added savedPaymentTypes target.
revanth0212 e586dbc
Updated target docs.
revanth0212 8eb9f2c
Minor.
revanth0212 27234d2
Merge remote-tracking branch 'origin/develop' into revanth/saved_paym…
revanth0212 6a35ae6
Hide delete text in mobile view.
revanth0212 d3ea89e
Address PR feedback
tjwiebell 133131c
Snapshot updates.
revanth0212 229aa67
Merge remote-tracking branch 'origin/develop' into revanth/saved_paym…
revanth0212 4b85318
Updated snapshots.
revanth0212 a6d5603
Updated tests.
revanth0212 b6a62ba
Added new tests.
revanth0212 1b483cb
Minor
revanth0212 e00d30d
Hiding delete button till PWA-638 comes in.
revanth0212 33677e8
Added new tests.
revanth0212 71a4f64
Minor.
revanth0212 0320f7f
Merge branch 'develop' into revanth/saved_payment_methods_main_view
dpatil-magento 59672a4
Rendering no payments message.
revanth0212 9634eed
Clear CustomerPaymentTokens on signout.
revanth0212 ca5f94a
Rendering fullpageindicator when data is loading.
revanth0212 e2ab10c
Merge branch 'develop' into revanth/saved_payment_methods_main_view
dpatil-magento 7282748
Snapshot update.
revanth0212 cfef3f9
Merge branch 'revanth/saved_payment_methods_main_view' of https://git…
revanth0212 a6a7e18
Merge branch 'develop' into revanth/saved_payment_methods_main_view
dpatil-magento a607400
Removing unnecessary piece of code.
revanth0212 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
8 changes: 8 additions & 0 deletions
8
...ne/lib/talons/SavedPaymentsPage/__tests__/__snapshots__/useSavedPaymentsPage.spec.js.snap
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,8 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`it returns the proper shape 1`] = ` | ||
Object { | ||
"isLoading": false, | ||
"savedPayments": Array [], | ||
} | ||
`; |
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
66 changes: 66 additions & 0 deletions
66
...venia-ui/lib/components/SavedPaymentsPage/__tests__/__snapshots__/creditCard.spec.js.snap
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,66 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Should render properly 1`] = ` | ||
<div> | ||
<div> | ||
<mock-FormattedMessage | ||
defaultMessage="Credit Card" | ||
id="storedPayments.creditCard" | ||
/> | ||
</div> | ||
<div> | ||
**** 1234 Visa | ||
</div> | ||
<div> | ||
Dec. 12 | ||
</div> | ||
<div> | ||
<button | ||
disabled={false} | ||
onClick={[Function]} | ||
type="button" | ||
> | ||
<span> | ||
<span> | ||
<svg | ||
fill="none" | ||
height={16} | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
viewBox="0 0 24 24" | ||
width={16} | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<polyline | ||
points="3 6 5 6 21 6" | ||
/> | ||
<path | ||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" | ||
/> | ||
<line | ||
x1="10" | ||
x2="10" | ||
y1="11" | ||
y2="17" | ||
/> | ||
<line | ||
x1="14" | ||
x2="14" | ||
y1="11" | ||
y2="17" | ||
/> | ||
</svg> | ||
</span> | ||
<span> | ||
<mock-FormattedMessage | ||
defaultMessage="Delete" | ||
id="storedPayments.delete" | ||
/> | ||
</span> | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
`; |
14 changes: 14 additions & 0 deletions
14
...enia-ui/lib/components/SavedPaymentsPage/__tests__/__snapshots__/paymentCard.spec.js.snap
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,14 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Should render properly 1`] = ` | ||
<mock-CreditCard | ||
details={ | ||
Object { | ||
"expirationDate": "12/12/2022", | ||
"maskedCC": "1234", | ||
"type": "VI", | ||
} | ||
} | ||
payment_method_code="braintree" | ||
/> | ||
`; |
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.
This is a clever solution, just give the collection an identity. I would normally suggest that the
PaymentToken
type needs an identity, but that may not be necessary since there's no way to mutate it. I also don't like adding these hidden requirements to queries, not sure how Apollo reacts when the field for the key identity is missing.@sirugh - is there a technical reason we should do something like:
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 solution you are proposing would work on individual tokens, the one I have here is for the whole collection. I feel like adding
keyFields
to each token would be overkill unless it provides some use. I am not equipped enough to make the call about the apollo types we are using here, I am fine with what the team thinks is the right approach.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 is from the docs. I wouldn't try to get much more creative that our use case. We only use this because we need a handle on the cache key in order to delete it. If we find that other properties are still cached and not garbage collected after the deletion of these other objects then we may need to identify PaymentTokens with keyFields and delete them too.