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

Implement cart information providing in BO order creation page - part 1 #15814

Merged
merged 24 commits into from Oct 9, 2019

Conversation

@zuk3975
Copy link
Contributor

zuk3975 commented Oct 3, 2019

Questions Answers
Branch? develop
Description? Implement endpoints for ajax calls of BO order creation for following actions: getCustomerCarts, getCustomerOrders, createEmptyCustomerCart, GetCartInformation, EditCartAddress, duplicateOrderCart. Introduces JsFosRoutingBundle. Renders vouchers, carts, orders list. TODO's: CartInformationHandler still needs to implement shipping and summary information; Handle the Cart (searching, adding, deleting, modifying product quantity, render products list), Handle vouchers search action, add missing actions (delete voucher, carts/orders/customer details, addNew address/customer/voucher and finally to create the order
Type? refacto
Category? BO
BC breaks? no
Deprecations? yes/no
Fixed ticket? part of #13890
How to test?

This change is Reviewable

@zuk3975 zuk3975 requested a review from PrestaShop/prestashop-core-developers as a code owner Oct 3, 2019
@sarjon sarjon requested a review from matks Oct 4, 2019
zuk3975 added 2 commits Oct 4, 2019
@matks matks added the migration label Oct 4, 2019
@sarjon sarjon removed the request for review from matks Oct 4, 2019
@@ -0,0 +1 @@
/var/www/html/prestashop/vendor/csa/guzzle-bundle/src/Resources/public

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Oct 5, 2019

Contributor

What are these files ? 🤔

This comment has been minimized.

Copy link
@zuk3975

zuk3975 Oct 7, 2019

Author Contributor

Im not sure, it was generated with fosjsrouting after command bin/console assets:install

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Oct 7, 2019

Contributor

Must be removed because depending on your environment.

* If password confirmation input is provided, can validate if entered password is matching confirmation.
*/

import Routing from '../../../../../vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.min';

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Oct 5, 2019

Contributor

Please use: https://www.npmjs.com/package/fos-routing instead. Separate php dependecies from npm dependencies

/**
* Renders Delivery & Invoice addresses select
*/
export default class AddressesRenderer {

This comment has been minimized.

Copy link
@matks

matks Oct 7, 2019

Contributor

This one is very readable 👍nice !

*
* @return JsonResponse
*/
public function getCustomerCartsAction(Request $request)

This comment has been minimized.

Copy link
@matks

matks Oct 7, 2019

Contributor

If we get a lot of these controller actions, we might create a dedicated Controller. Maybe something like CustomerAjaxController. Or rename existing controller to CustomerPageController and have a UtilsCustomerController.

Names are not very good 😅but you get the idea I think

@zuk3975 zuk3975 force-pushed the zuk3975:m/orders/create-cart branch from 86a99a3 to c037c20 Oct 7, 2019
zuk3975 added 2 commits Oct 8, 2019
*/
export default class Router {
constructor() {
this.router = Routing;

This comment has been minimized.

Copy link
@PierreRambaud

PierreRambaud Oct 8, 2019

Contributor

Useless to have this.router since Routing is global.

@zuk3975 zuk3975 changed the title [WIP] Implement cart info providing and dynamic content in BO order create page [WIP] Implement cart information providing in BO order creation page Oct 8, 2019
zuk3975 added 2 commits Oct 8, 2019
@zuk3975 zuk3975 force-pushed the zuk3975:m/orders/create-cart branch from f623925 to 1da0e2e Oct 8, 2019
@@ -704,6 +706,38 @@ public function exportAction(CustomerFilters $filters)
->setFileName('customer_' . date('Y-m-d_His') . '.csv');
}
/**
* @AdminSecurity("is_granted(['read'], request.get('_legacy_controller'))")

This comment has been minimized.

Copy link
@matks

matks Oct 8, 2019

Contributor

We'll have to check what happens if you have the rights to Order page but no rights to Customer page. Best behavior would be a nice error message 🤔 .

However, to be logical we should secure this action with "you need EITHER the customer READ rights or the order READ rights"

}
/**
* @AdminSecurity("is_granted(['read'], request.get('_legacy_controller'))")

This comment has been minimized.

Copy link
@matks

matks Oct 8, 2019

Contributor

Same

@zuk3975 zuk3975 force-pushed the zuk3975:m/orders/create-cart branch from d06d731 to 0d29ce9 Oct 9, 2019
@zuk3975 zuk3975 force-pushed the zuk3975:m/orders/create-cart branch from 0d29ce9 to 3910b24 Oct 9, 2019
@matks
matks approved these changes Oct 9, 2019
@matks matks changed the title [WIP] Implement cart information providing in BO order creation page Implement cart information providing in BO order creation page - part 1 Oct 9, 2019
@matks

This comment has been minimized.

Copy link
Contributor

matks commented Oct 9, 2019

This PR is being merged in order to ease the collaboration on this topic. QA and UX validation will happen on deliverable PRs to come later following this one.

@matks matks added this to the 1.7.7.0 milestone Oct 9, 2019
@matks matks merged commit 992f212 into PrestaShop:develop Oct 9, 2019
2 checks passed
2 checks passed
PrettyCI Code formatting
Details
Travis CI - Pull Request Build Passed
Details
@ArtekArtek

This comment has been minimized.

@matks matks referenced this pull request Oct 30, 2019
6 of 33 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.