vuestorefront / magento2

Vue Storefront 2 integration for Magento 2
https://docs.vuestorefront.io/magento
MIT License
171 stars 118 forks source link

[BC] Remove userAddressManipulator.ts #1341

Open sync-by-unito[bot] opened 2 years ago

sync-by-unito[bot] commented 2 years ago

The CustomerAddress returned from graphql returns the street as an array of strings.

What userAddressManipulator does is overwrite the street name so that:

!image-20220518-102436.png|width=444,height=119!

This is unnecessary and makes it impossible to use correct types in components/ts file because using CustomerAddress would be wrong in this case (CustomerAddress['street'] is string[ ] not string)

Acceptance criteria:

  1. The userAddressManipulator.ts file is removed along with all of its containg functions
  2. Composables are updated to work without userAddressManipulator functions (this means components will work on the array form of “street”)
  3. The TransformedCustomerAddress type is removed - use CustomerAddress from GraphQL instead
  4. Components are updated so that they work with new implementation of composables. This is tricky becase you’ll have to update eg. AddressEdit and AddressNew to work on arrays of strings, not strings (form.street) etc.

┆Attachments: image-20220518-102436.png

sync-by-unito[bot] commented 2 years ago

➤ Artur Tagisow commented:

It’s difficult to type the arguments of userAddressManipulator functions - I wanted to fix the implicit any occurrences. I’d say this is not worth salvaging, since it smells a lot like a legacy vsf core mapper, so it’s best to remove it.