[FIX] lunch: make it work on mobile
This module didn't worked on mobile: user cannot select the products or see their cart. This commit reworks the LunchKanbanWidget template and introduces a dedicated template for mobile. This template introduces a button at the bottom of the screen to toggle the "cart" widget on mobile (hiding it by default). It tries to make the best use of the existing Bootstrap classes allowing to have a more responsive layout and reducing the custom CSS required by this module (both in desktop and in mobile). This commit adds a decent JS tests-suite (mobile & desktop) to this module as the existing one left substential parts of the UI untested (opening wizard when clicking on a kanban record, cart's lines content, clear cart button, widget structure and content based on the state...). Those tests are also less based on DOM nodes order/tag names and use instead dedicated classnames. It also modifies the LunchKanbanRecord click handling to had a dedicated event handler instead of overriding the default _onGlobalClick() and make it more testable. Task ID: 1945032
Showing
- addons/lunch/static/src/js/lunch_kanban_controller.js 19 additions, 14 deletionsaddons/lunch/static/src/js/lunch_kanban_controller.js
- addons/lunch/static/src/js/lunch_kanban_mobile.js 74 additions, 0 deletionsaddons/lunch/static/src/js/lunch_kanban_mobile.js
- addons/lunch/static/src/js/lunch_kanban_record.js 30 additions, 16 deletionsaddons/lunch/static/src/js/lunch_kanban_record.js
- addons/lunch/static/src/js/lunch_kanban_view.js 0 additions, 7 deletionsaddons/lunch/static/src/js/lunch_kanban_view.js
- addons/lunch/static/src/scss/lunch_kanban.scss 30 additions, 33 deletionsaddons/lunch/static/src/scss/lunch_kanban.scss
- addons/lunch/static/src/xml/lunch_kanban.xml 82 additions, 64 deletionsaddons/lunch/static/src/xml/lunch_kanban.xml
- addons/lunch/static/tests/lunch_kanban_mobile_tests.js 208 additions, 0 deletionsaddons/lunch/static/tests/lunch_kanban_mobile_tests.js
- addons/lunch/static/tests/lunch_kanban_tests.js 821 additions, 0 deletionsaddons/lunch/static/tests/lunch_kanban_tests.js
- addons/lunch/static/tests/lunch_test_utils.js 58 additions, 0 deletionsaddons/lunch/static/tests/lunch_test_utils.js
- addons/lunch/static/tests/test_lunch_kanban.js 0 additions, 259 deletionsaddons/lunch/static/tests/test_lunch_kanban.js
- addons/lunch/views/lunch_templates.xml 11 additions, 2 deletionsaddons/lunch/views/lunch_templates.xml
- addons/web/static/src/scss/search_view_mobile.scss 1 addition, 2 deletionsaddons/web/static/src/scss/search_view_mobile.scss
Loading
Please register or sign in to comment