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

PURCHASE-1656: Add phone number field to Address for pickup #3075

Closed

Conversation

lilyfromseattle
Copy link
Contributor

@lilyfromseattle lilyfromseattle commented Jan 2, 2020

PURCHASE-1656 Add phone number field to Address for pickup

https://www.figma.com/file/LieDNuIuKAfhDeEPkjan4p/Checkout-Flow?node-id=0%3A1

This field should be required.

This is a refactor of this PR as was suggested in the comments

Before:
Screen Shot 2020-01-02 at 11 49 45 AM

After:
Screen Shot 2020-01-02 at 11 49 30 AM

@artsy-peril artsy-peril bot added Jira Synced Version: Patch Indicates that this PR should have a patch deploy, usually for bug fixes labels Jan 2, 2020
@@ -85,7 +86,9 @@ export class AddressForm extends React.Component<
}

phoneNumberInputDescription = (): string | null => {
if (this.props.billing && this.props.showPhoneNumberInput) {
if (this.props.phoneNumberOnly) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thoughts on adding a separate component for this phone number input instead of trying to reuse AddressForm? There's a lot of conditional logic added, seems like it would be simpler/easier to reason about if it were separate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did it that way at first, but I found myself duplicating so much that this seemed like a better option

Copy link
Contributor

Choose a reason for hiding this comment

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

What was duplicated? It seems like you can keep the input fields the same but create a version of this component that is pared down to just the phone number input. Would that work?

Since this component is used across the site where we need people to add shipping/billing addresses for credit cards (auctions, user settings payments, orders), it feels odd to extend it for this purpose.

We should probably (not as part of this PR 😄) re-name this component and extract it from the Order sub-app.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like the handlers and stuff. It just felt like a lot of duplication when I started doing it that way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I talked it over with Ashkan and he thought this way was fine but can do it that way if you think its better

@codecov
Copy link

codecov bot commented Jan 2, 2020

Codecov Report

Merging #3075 into master will increase coverage by <.1%.
The diff coverage is 100%.

@@           Coverage Diff            @@
##           master   #3075     +/-   ##
========================================
+ Coverage      82%     82%   +<.1%     
========================================
  Files         736     736             
  Lines       10794   10801      +7     
  Branches     2160    2165      +5     
========================================
+ Hits         8853    8862      +9     
+ Misses       1359    1357      -2     
  Partials      582     582

@@ -392,6 +416,7 @@ export const ShippingFragmentContainer = createFragmentContainer(
state
requestedFulfillment {
__typename

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it will only fetch the phoneNumber for shipping orders-- should phoneNumber be here instead of nested under that type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly...but I get errors when I move it

Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to add:

... on CommercePickup {
  phoneNumber
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unknown field 'phoneNumber' on type 'CommercePickup'

@zephraph zephraph added Version: Minor Indicates that this PR should have a minor deploy, usually for new features and removed Version: Patch Indicates that this PR should have a patch deploy, usually for bug fixes labels Jan 2, 2020
@sweir27
Copy link
Contributor

sweir27 commented Jan 23, 2020

@lilyfromseattle I think this one can be closed. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jira Synced Version: Minor Indicates that this PR should have a minor deploy, usually for new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants