Frontend profile settings #20

Merged
bilal.catic merged 35 commits from frontend-profileSettings into master 2018-09-20 14:27:03 +02:00
bilal.catic commented 2018-09-11 09:55:41 +02:00 (Migrated from gitlab.com)

Asana Card

SMOKE TEST:

  1. Login to frontend
  2. Open user profile (Top right corner)
  3. Try to change name and/or phone and save
  4. Name should be changed in top right corner, and also on profile page
  5. Change company name and/or VAT number and save
  6. Company name and VAT number should be changed on profile page
  7. Add few delivery addresses (country, city, address and zip code are required and message should show if they are empty)
  8. Try to edit address (change country, city name, ...)
  9. Try to delete address
  10. Add few billing addresses (country, city, address and zip code are required and message should show if they are empty)
  11. Try to edit address (change country, city name, ...)
  12. Try to delete address

Run unit tests

<a href="https://app.asana.com/0/697944902557002/744133144344695/f">Asana Card</a> SMOKE TEST: 1. Login to frontend 2. Open user profile (Top right corner) 3. Try to change name and/or phone and save 4. Name should be changed in top right corner, and also on profile page 5. Change company name and/or VAT number and save 6. Company name and VAT number should be changed on profile page 7. Add few delivery addresses (country, city, address and zip code are required and message should show if they are empty) 8. Try to edit address (change country, city name, ...) 9. Try to delete address 10. Add few billing addresses (country, city, address and zip code are required and message should show if they are empty) 11. Try to edit address (change country, city name, ...) 12. Try to delete address Run unit tests
bilal.catic commented 2018-09-11 10:46:30 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 8caeffa6 - add unit tests

Compare with previous version

added 1 commit <ul><li>8caeffa6 - add unit tests</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=22757685&start_sha=3aaff8862ed0c63e98ee9db7f7dd67e8d4e8fe2c)
bilal.catic commented 2018-09-11 10:47:07 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
bilal.catic commented 2018-09-11 11:03:58 +02:00 (Migrated from gitlab.com)

assigned to @akrdzic

assigned to @akrdzic
bilal.catic commented 2018-09-11 11:29:29 +02:00 (Migrated from gitlab.com)

marked as a Work In Progress

marked as a **Work In Progress**
bilal.catic commented 2018-09-11 11:29:29 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
bilal.catic commented 2018-09-13 06:31:41 +02:00 (Migrated from gitlab.com)

added 26 commits

  • 8caeffa6...d4c75dcf - 5 commits from branch master
  • 26ddf439 - add user controller
  • 029daa03 - add user info to JWT token response
  • 301a6632 - use custom user endpoint for validation and JWT auth for login
  • 469d828d - update and read customer phone number, company name and VAT number
  • 166548ab - add list of available countries
  • c1611b9c - add tests for rest-user-api
  • 42a73b82 - user profile edit actions
  • 8d32fe7d - improve frontend code
  • 4bf030fe - create user class and make use of it
  • 50b1539f - add unit tests
  • edd5747d - change property name to comply with frontend
  • 54abe214 - keep old variable name
  • 84a86dbd - Enable address changes in cart module
  • 7a1296ce - add aditional fields to profile address on frontend
  • 635568c6 - add first name, last name and email fields to profile address on backend
  • 8f67016a - change property name to comply with frontend
  • b7e80837 - display name, last name and email above address for profile addresses
  • 2d7154d0 - turn off autocomplete also for billing address input/edit
  • 70099b71 - use new list of countries and adapt backend and frontend to it
  • 29d76ef7 - simple backend address validation
  • 01573884 - simple frontend address validation

Compare with previous version

added 26 commits <ul><li>8caeffa6...d4c75dcf - 5 commits from branch <code>master</code></li><li>26ddf439 - add user controller</li><li>029daa03 - add user info to JWT token response</li><li>301a6632 - use custom user endpoint for validation and JWT auth for login</li><li>469d828d - update and read customer phone number, company name and VAT number</li><li>166548ab - add list of available countries</li><li>c1611b9c - add tests for rest-user-api</li><li>42a73b82 - user profile edit actions</li><li>8d32fe7d - improve frontend code</li><li>4bf030fe - create user class and make use of it</li><li>50b1539f - add unit tests</li><li>edd5747d - change property name to comply with frontend</li><li>54abe214 - keep old variable name</li><li>84a86dbd - Enable address changes in cart module</li><li>7a1296ce - add aditional fields to profile address on frontend</li><li>635568c6 - add first name, last name and email fields to profile address on backend</li><li>8f67016a - change property name to comply with frontend</li><li>b7e80837 - display name, last name and email above address for profile addresses</li><li>2d7154d0 - turn off autocomplete also for billing address input/edit</li><li>70099b71 - use new list of countries and adapt backend and frontend to it</li><li>29d76ef7 - simple backend address validation</li><li>01573884 - simple frontend address validation</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=22939626&start_sha=8caeffa65fc92c309fee5da028b7713953e9dc88)
bilal.catic commented 2018-09-13 06:34:20 +02:00 (Migrated from gitlab.com)

added 1 commit

  • 1d7059d8 - remove comment

Compare with previous version

added 1 commit <ul><li>1d7059d8 - remove comment</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=22939668&start_sha=0157388487e5dc5e59d153d9f276c66a799c2666)
bilal.catic commented 2018-09-13 06:38:44 +02:00 (Migrated from gitlab.com)

unmarked as a Work In Progress

unmarked as a **Work In Progress**
bilal.catic commented 2018-09-13 06:38:44 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
bilal.catic commented 2018-09-13 06:40:00 +02:00 (Migrated from gitlab.com)

changed the description

changed the description
akrdzic commented 2018-09-13 11:01:36 +02:00 (Migrated from gitlab.com)

Add this additional customer properties using snake case notation as the rest of customer properties.

Add this additional customer properties using snake case notation as the rest of customer properties.
akrdzic commented 2018-09-13 11:01:54 +02:00 (Migrated from gitlab.com)

use snake case notation for countries.

use snake case notation for countries.
akrdzic commented 2018-09-13 13:18:52 +02:00 (Migrated from gitlab.com)

Since only wiaas customers have multiple addresses, logic for it should be separated into class-wiaas-customer.php file.

Since only wiaas customers have multiple addresses, logic for it should be separated into class-wiaas-customer.php file.
akrdzic commented 2018-09-13 13:20:31 +02:00 (Migrated from gitlab.com)

Access to wiaas customer address data should be handled with access methods and not using 'get_user_meta' everywhere. These addresses will later be used in cart and orders and access to them should be transparent for them.

Access to wiaas customer address data should be handled with access methods and not using 'get_user_meta' everywhere. These addresses will later be used in cart and orders and access to them should be transparent for them.
akrdzic commented 2018-09-13 13:24:59 +02:00 (Migrated from gitlab.com)

Handling of customer addresses should be handled with specific address CRUD methods for customer as extension of
customer/[id]/addresses endpoint

Handling of customer addresses should be handled with specific address CRUD methods for customer as extension of `customer/[id]/addresses` endpoint
bilal.catic commented 2018-09-19 17:35:28 +02:00 (Migrated from gitlab.com)

resolved all discussions

resolved all discussions
bilal.catic commented 2018-09-20 01:39:21 +02:00 (Migrated from gitlab.com)

changed this line in version 5 of the diff

changed this line in [version 5 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=23506604&start_sha=1d7059d80d2fd4ff044860a271ea47aa0d5d969a#6248b36ccb88e27e3748cee7eb1d276ec7f3fdc3_50_21)
bilal.catic commented 2018-09-20 01:39:21 +02:00 (Migrated from gitlab.com)

changed this line in version 5 of the diff

changed this line in [version 5 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=23506604&start_sha=1d7059d80d2fd4ff044860a271ea47aa0d5d969a#4e844949c70089d082188e7a29b9ff6c2572c973_51_51)
bilal.catic commented 2018-09-20 01:39:22 +02:00 (Migrated from gitlab.com)

changed this line in version 5 of the diff

changed this line in [version 5 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=23506604&start_sha=1d7059d80d2fd4ff044860a271ea47aa0d5d969a#6248b36ccb88e27e3748cee7eb1d276ec7f3fdc3_28_21)
bilal.catic commented 2018-09-20 01:39:22 +02:00 (Migrated from gitlab.com)

changed this line in version 5 of the diff

changed this line in [version 5 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=23506604&start_sha=1d7059d80d2fd4ff044860a271ea47aa0d5d969a#6248b36ccb88e27e3748cee7eb1d276ec7f3fdc3_46_21)
bilal.catic commented 2018-09-20 01:39:22 +02:00 (Migrated from gitlab.com)

changed this line in version 5 of the diff

changed this line in [version 5 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=23506604&start_sha=1d7059d80d2fd4ff044860a271ea47aa0d5d969a#6248b36ccb88e27e3748cee7eb1d276ec7f3fdc3_133_21)
bilal.catic commented 2018-09-20 01:39:22 +02:00 (Migrated from gitlab.com)

added 36 commits

  • 1d7059d8...7c2a77b7 - 3 commits from branch master
  • 105df060 - add user controller
  • dcf2b76f - add user info to JWT token response
  • b35c2961 - use custom user endpoint for validation and JWT auth for login
  • 3816eae6 - update and read customer phone number, company name and VAT number
  • 783765a1 - add list of available countries
  • 935f83a3 - add tests for rest-user-api
  • 6f7e554a - user profile edit actions
  • 8d03601f - improve frontend code
  • 65b19acd - create user class and make use of it
  • 7df7383e - add unit tests
  • 9bd5e512 - change property name to comply with frontend
  • 4280c66d - keep old variable name
  • 6c115663 - Enable address changes in cart module
  • 430169de - add aditional fields to profile address on frontend
  • 238010ba - add first name, last name and email fields to profile address on backend
  • 33f337cd - change property name to comply with frontend
  • d32bdfba - display name, last name and email above address for profile addresses
  • 144d0509 - turn off autocomplete also for billing address input/edit
  • 9ae5b32c - use new list of countries and adapt backend and frontend to it
  • 80c727ab - simple backend address validation
  • cd4172a1 - simple frontend address validation
  • 97282f58 - remove comment
  • 90483c4a - add customer class and endpoint
  • 0e32aa4a - add helper to transform snake case to camel case
  • 9fd16242 - use customer endpoint for profile actions
  • 07d30ae9 - use snake case
  • 212aaccf - use snake case
  • e46045cc - snake case - camel case transformations
  • f4e07f3d - apply snake case change
  • 64501f2c - fix personal info validation
  • a379748f - fix typo
  • 84aaabf9 - fix company info update
  • fe5ff05d - add tests for profile endpoints

Compare with previous version

added 36 commits <ul><li>1d7059d8...7c2a77b7 - 3 commits from branch <code>master</code></li><li>105df060 - add user controller</li><li>dcf2b76f - add user info to JWT token response</li><li>b35c2961 - use custom user endpoint for validation and JWT auth for login</li><li>3816eae6 - update and read customer phone number, company name and VAT number</li><li>783765a1 - add list of available countries</li><li>935f83a3 - add tests for rest-user-api</li><li>6f7e554a - user profile edit actions</li><li>8d03601f - improve frontend code</li><li>65b19acd - create user class and make use of it</li><li>7df7383e - add unit tests</li><li>9bd5e512 - change property name to comply with frontend</li><li>4280c66d - keep old variable name</li><li>6c115663 - Enable address changes in cart module</li><li>430169de - add aditional fields to profile address on frontend</li><li>238010ba - add first name, last name and email fields to profile address on backend</li><li>33f337cd - change property name to comply with frontend</li><li>d32bdfba - display name, last name and email above address for profile addresses</li><li>144d0509 - turn off autocomplete also for billing address input/edit</li><li>9ae5b32c - use new list of countries and adapt backend and frontend to it</li><li>80c727ab - simple backend address validation</li><li>cd4172a1 - simple frontend address validation</li><li>97282f58 - remove comment</li><li>90483c4a - add customer class and endpoint</li><li>0e32aa4a - add helper to transform snake case to camel case</li><li>9fd16242 - use customer endpoint for profile actions</li><li>07d30ae9 - use snake case</li><li>212aaccf - use snake case</li><li>e46045cc - snake case - camel case transformations</li><li>f4e07f3d - apply snake case change</li><li>64501f2c - fix personal info validation</li><li>a379748f - fix typo</li><li>84aaabf9 - fix company info update</li><li>fe5ff05d - add tests for profile endpoints</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=23506604&start_sha=1d7059d80d2fd4ff044860a271ea47aa0d5d969a)
bilal.catic commented 2018-09-20 13:24:20 +02:00 (Migrated from gitlab.com)

I tried with DELETE but in that case params are empty, and I don't know why. Based on this (https://developer.wordpress.org/rest-api/requests/#body-params) it should behave same as with PUT/POST but it's not working

I tried with DELETE but in that case params are empty, and I don't know why. Based on this (https://developer.wordpress.org/rest-api/requests/#body-params) it should behave same as with PUT/POST but it's not working
akrdzic commented 2018-09-20 13:44:25 +02:00 (Migrated from gitlab.com)

You should just send address_id as part of request

register_rest_route( self::$namespace, 'customer/(?P<id>\d+)/profile-addresses/(?P<address_id>\d+)', array(
			'methods' => 'DELETE',
			'callback' => array(__CLASS__, 'delete_customer_profile_address'),
			'permission_callback' => 'is_user_logged_in'
		) );
You should just send address_id as part of request ``` register_rest_route( self::$namespace, 'customer/(?P<id>\d+)/profile-addresses/(?P<address_id>\d+)', array( 'methods' => 'DELETE', 'callback' => array(__CLASS__, 'delete_customer_profile_address'), 'permission_callback' => 'is_user_logged_in' ) ); ```
akrdzic commented 2018-09-20 13:53:55 +02:00 (Migrated from gitlab.com)

Same here, use DELETE

Same here, use DELETE
bilal.catic commented 2018-09-20 14:10:09 +02:00 (Migrated from gitlab.com)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=23571796&start_sha=fe5ff05d7382aa239682c28d449f41a28dff3668#e59c48a1e80f738f2a843df919dd6e55dd35d95f_26_25)
bilal.catic commented 2018-09-20 14:10:10 +02:00 (Migrated from gitlab.com)

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=23571796&start_sha=fe5ff05d7382aa239682c28d449f41a28dff3668#e59c48a1e80f738f2a843df919dd6e55dd35d95f_37_37)
bilal.catic commented 2018-09-20 14:10:10 +02:00 (Migrated from gitlab.com)

added 41 commits

  • fe5ff05d...cf92f627 - 6 commits from branch master
  • f63e1185 - add user controller
  • 9da31990 - add user info to JWT token response
  • bc61e2e7 - use custom user endpoint for validation and JWT auth for login
  • 4ce7b86e - update and read customer phone number, company name and VAT number
  • b3cff5d0 - add list of available countries
  • b974eab2 - add tests for rest-user-api
  • a79ef104 - user profile edit actions
  • aae23e4e - improve frontend code
  • d26569a8 - create user class and make use of it
  • e6e487f3 - add unit tests
  • 39cb851a - change property name to comply with frontend
  • 8a9af7ed - keep old variable name
  • a901da55 - Enable address changes in cart module
  • b98f3c97 - add aditional fields to profile address on frontend
  • 84916a01 - add first name, last name and email fields to profile address on backend
  • 90402d3e - change property name to comply with frontend
  • c322c8ac - display name, last name and email above address for profile addresses
  • 5d91576f - turn off autocomplete also for billing address input/edit
  • b93aed10 - use new list of countries and adapt backend and frontend to it
  • 82e4579e - simple backend address validation
  • 32379f7f - simple frontend address validation
  • d36398f2 - remove comment
  • af2da3ee - add customer class and endpoint
  • 31115b7c - add helper to transform snake case to camel case
  • 498f5526 - use customer endpoint for profile actions
  • 522417ca - use snake case
  • 0787cf83 - use snake case
  • 39315880 - snake case - camel case transformations
  • fa2b6919 - apply snake case change
  • c6378802 - fix personal info validation
  • 3fa75daa - fix typo
  • 4159f128 - fix company info update
  • 5da2353d - add tests for profile endpoints
  • 41e92e23 - use DELETE instead of POST for delete action
  • cbf1de34 - modify test to use DELTE instead of POST

Compare with previous version

added 41 commits <ul><li>fe5ff05d...cf92f627 - 6 commits from branch <code>master</code></li><li>f63e1185 - add user controller</li><li>9da31990 - add user info to JWT token response</li><li>bc61e2e7 - use custom user endpoint for validation and JWT auth for login</li><li>4ce7b86e - update and read customer phone number, company name and VAT number</li><li>b3cff5d0 - add list of available countries</li><li>b974eab2 - add tests for rest-user-api</li><li>a79ef104 - user profile edit actions</li><li>aae23e4e - improve frontend code</li><li>d26569a8 - create user class and make use of it</li><li>e6e487f3 - add unit tests</li><li>39cb851a - change property name to comply with frontend</li><li>8a9af7ed - keep old variable name</li><li>a901da55 - Enable address changes in cart module</li><li>b98f3c97 - add aditional fields to profile address on frontend</li><li>84916a01 - add first name, last name and email fields to profile address on backend</li><li>90402d3e - change property name to comply with frontend</li><li>c322c8ac - display name, last name and email above address for profile addresses</li><li>5d91576f - turn off autocomplete also for billing address input/edit</li><li>b93aed10 - use new list of countries and adapt backend and frontend to it</li><li>82e4579e - simple backend address validation</li><li>32379f7f - simple frontend address validation</li><li>d36398f2 - remove comment</li><li>af2da3ee - add customer class and endpoint</li><li>31115b7c - add helper to transform snake case to camel case</li><li>498f5526 - use customer endpoint for profile actions</li><li>522417ca - use snake case</li><li>0787cf83 - use snake case</li><li>39315880 - snake case - camel case transformations</li><li>fa2b6919 - apply snake case change</li><li>c6378802 - fix personal info validation</li><li>3fa75daa - fix typo</li><li>4159f128 - fix company info update</li><li>5da2353d - add tests for profile endpoints</li><li>41e92e23 - use DELETE instead of POST for delete action</li><li>cbf1de34 - modify test to use DELTE instead of POST</li></ul> [Compare with previous version](https://gitlab.com/saburly/wiaas/new-wiaas/merge_requests/20/diffs?diff_id=23571796&start_sha=fe5ff05d7382aa239682c28d449f41a28dff3668)
akrdzic commented 2018-09-20 14:27:03 +02:00 (Migrated from gitlab.com)

merged

merged
akrdzic commented 2018-09-20 14:27:03 +02:00 (Migrated from gitlab.com)

mentioned in commit d8c38ec089

mentioned in commit d8c38ec0890e86400edd3f6da849e809efb84788
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: senaduka/old-new-wiaas#20