{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/26423","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/26423/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/26423/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/26423/events","html_url":"https://github.com/Automattic/wp-calypso/pull/26423","id":346337586,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MjI2MjMy","number":26423,"title":"Store: Add \"product weight\" and \"product value\" fields to the Customs form","user":{"login":"DanReyLop","id":1715800,"node_id":"MDQ6VXNlcjE3MTU4MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/1715800?v=4","gravatar_id":"","url":"https://api.github.com/users/DanReyLop","html_url":"https://github.com/DanReyLop","followers_url":"https://api.github.com/users/DanReyLop/followers","following_url":"https://api.github.com/users/DanReyLop/following{/other_user}","gists_url":"https://api.github.com/users/DanReyLop/gists{/gist_id}","starred_url":"https://api.github.com/users/DanReyLop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanReyLop/subscriptions","organizations_url":"https://api.github.com/users/DanReyLop/orgs","repos_url":"https://api.github.com/users/DanReyLop/repos","events_url":"https://api.github.com/users/DanReyLop/events{/privacy}","received_events_url":"https://api.github.com/users/DanReyLop/received_events","type":"User","site_admin":false},"labels":[{"id":545515130,"node_id":"MDU6TGFiZWw1NDU1MTUxMzA=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Store","name":"Store","color":"96588a","default":false},{"id":763775593,"node_id":"MDU6TGFiZWw3NjM3NzU1OTM=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Store%20Services","name":"Store Services","color":"96588a","default":false},{"id":285010019,"node_id":"MDU6TGFiZWwyODUwMTAwMTk=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Author%20Reply","name":"[Status] Needs Author Reply","color":"eb6420","default":false},{"id":285010023,"node_id":"MDU6TGFiZWwyODUwMTAwMjM=","url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Design%20Review","name":"[Status] Needs Design Review","color":"13CDF7","default":false}],"state":"open","locked":false,"assignee":{"login":"DanReyLop","id":1715800,"node_id":"MDQ6VXNlcjE3MTU4MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/1715800?v=4","gravatar_id":"","url":"https://api.github.com/users/DanReyLop","html_url":"https://github.com/DanReyLop","followers_url":"https://api.github.com/users/DanReyLop/followers","following_url":"https://api.github.com/users/DanReyLop/following{/other_user}","gists_url":"https://api.github.com/users/DanReyLop/gists{/gist_id}","starred_url":"https://api.github.com/users/DanReyLop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanReyLop/subscriptions","organizations_url":"https://api.github.com/users/DanReyLop/orgs","repos_url":"https://api.github.com/users/DanReyLop/repos","events_url":"https://api.github.com/users/DanReyLop/events{/privacy}","received_events_url":"https://api.github.com/users/DanReyLop/received_events","type":"User","site_admin":false},"assignees":[{"login":"DanReyLop","id":1715800,"node_id":"MDQ6VXNlcjE3MTU4MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/1715800?v=4","gravatar_id":"","url":"https://api.github.com/users/DanReyLop","html_url":"https://github.com/DanReyLop","followers_url":"https://api.github.com/users/DanReyLop/followers","following_url":"https://api.github.com/users/DanReyLop/following{/other_user}","gists_url":"https://api.github.com/users/DanReyLop/gists{/gist_id}","starred_url":"https://api.github.com/users/DanReyLop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanReyLop/subscriptions","organizations_url":"https://api.github.com/users/DanReyLop/orgs","repos_url":"https://api.github.com/users/DanReyLop/repos","events_url":"https://api.github.com/users/DanReyLop/events{/privacy}","received_events_url":"https://api.github.com/users/DanReyLop/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-07-31T20:03:09Z","updated_at":"2018-08-02T12:12:45Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/26423","html_url":"https://github.com/Automattic/wp-calypso/pull/26423","diff_url":"https://github.com/Automattic/wp-calypso/pull/26423.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/26423.patch"},"body":"Note: This should be tested using the `update/add-customs-weight-and-value-to-meta` branch on `woocommerce-services`.\r\n\r\nI hope the commits are more-or-less self-explanatory because you non-AFK Hydras will be stuck improving any annoyance. I've done some testing with a product with no weight and $0 price and it worked fine, but this could use some more testing.\r\n\r\nThis PR adds a `Declared Value` and `Weight` fields to the items of the Customs form. Like every other field in the flow, it has validation that only triggers after the user has interacted with the field or the step has been submitted.\r\n\r\nThe things I would improve if I had more time are:\r\n* Styles, definitely. This is a blocker, but I don't know how to improve it (hoping that pinging designers will help)\r\n* Using the `ignoreTariffNumberValidation` pattern, copy&pasting it exactly the same way for the weight and value fields. Maybe we should do the `every field is valid until interacted with` logic in another cleaner way.\r\n* The values for `value` and `weight` can be `string` or `number` depending on their source. This should be normalized at the reducer level, instead of letting the components just accept any type of value.\r\n\r\n@kellychoffman The mobile styles look fine, but the desktop styles produce this monstrosity:\r\n<img width=\"547\" alt=\"screen shot 2018-07-31 at 21 17 20\" src=\"https://user-images.githubusercontent.com/1715800/43483109-f3a9d17a-950a-11e8-850b-965602da7bd1.png\">\r\n\r\nI didn't even try to style it because there's no way those 5 columns physically fit into the modal. Do you have any ideas on how to structure this?\r\n\r\n**To test:**\r\n- Create or edit a product so it has no weight and/or no price (`$0`)\r\n- Create an order with that product and with an international destination. Note that you won't be able to use `USPS` with a weightless product, so you should use Free Shipping or Flat Rate. Also, you won't be able to use the `Checkout` for a `$0` order so you should add another item if you're testing the `$0` product.\r\n- Go print a label for that order.\r\n- Make the screen narrow so you get the mobile styles for the `Customs` form. That's the only useable UI for now.\r\n- See that in the Customs form, the item without weight/price has those fields blank or zero.\r\n- Check you can edit those fields, and validation works (no non-numeric strings, no negative or zero values allowed).\r\n- Refresh the page, go to the Customs form again and submit it. Check that the errors didn't show before, but they show after you clicked the `Submit` button.\r\n- After putting valid values for `weight` and `value`, submit the step so rates can be fetched.\r\n- Refresh the page, go to the Customs form again, check that the values you entered were persisted.\r\n- Check that the real product weight was updated (you can go to WP-Admin for that)."},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/409905068","html_url":"https://github.com/Automattic/wp-calypso/pull/26423#issuecomment-409905068","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/26423","id":409905068,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTkwNTA2OA==","user":{"login":"marcinbot","id":800604,"node_id":"MDQ6VXNlcjgwMDYwNA==","avatar_url":"https://avatars1.githubusercontent.com/u/800604?v=4","gravatar_id":"","url":"https://api.github.com/users/marcinbot","html_url":"https://github.com/marcinbot","followers_url":"https://api.github.com/users/marcinbot/followers","following_url":"https://api.github.com/users/marcinbot/following{/other_user}","gists_url":"https://api.github.com/users/marcinbot/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinbot/subscriptions","organizations_url":"https://api.github.com/users/marcinbot/orgs","repos_url":"https://api.github.com/users/marcinbot/repos","events_url":"https://api.github.com/users/marcinbot/events{/privacy}","received_events_url":"https://api.github.com/users/marcinbot/received_events","type":"User","site_admin":false},"created_at":"2018-08-02T12:12:45Z","updated_at":"2018-08-02T12:12:45Z","author_association":"CONTRIBUTOR","body":"Ok, I rebased this with the main branch and fixed the styling on desktop by moving the units from prefix/suffix to the header.\r\n\r\nThis is mobile:\r\n<img width=\"523\" alt=\"screen shot 2018-08-02 at 15 10 30\" src=\"https://user-images.githubusercontent.com/800604/43582832-5bf459b0-9666-11e8-9e73-f51e76ff6978.png\">\r\n\r\nAnd this is desktop:\r\n<img width=\"998\" alt=\"screen shot 2018-08-02 at 15 10 07\" src=\"https://user-images.githubusercontent.com/800604/43582848-64fb3466-9666-11e8-8123-0ca4bfad5d45.png\">\r\n"}}
{"actor":{"display_login":"marcinbot"}}