[IMP] Web et al.: unique main ControlPanel
A unique main ControlPanel is instantiated by the ActionManager and it is updated each time the state changes (i.e. when an action is performed on the ActionManager or when switch_mode() is called on the ViewManager). Introduction of State classes to facilitate the way of restoring previously rendered states in ControlPanel. The notion of widgets previously used in the ActionManager is now encapsulated in the notion of states. The search() function has been moved from ControlPanel to ViewManager as it makes more sense like this. The ViewManager doesn't have the reference to the ControlPanel but rather communicate with it through a dedicated bus. Some refactoring has been done on the ControlPanel as well so that it doesn't need to know the ActionManager and the current Action anymore (it communicates with the AM with events, and it updates itself using information passed in arguments). Improves the way the ViewManager requests the ControlPanel to instantiate a SearchView, and how it waits for this SearchView to be corretly loaded. Move back the views logic to the ViewManager which directly asks the ControlPanel to render the buttons and switch-buttons areas with the views passed in arguments. Removes option replace_breadcrumb in push_state() of ActionManager as it is not used. Side changes: * Account: account_widget.js: Adapt code to retrieve the current state of the ActionManager. Required due to the introduction of State classes that encapsulate the notions of widgets and inner_widget in the ActionManager. * Board: dashboard.js: Some refactoring to adapt the code according to the new Widgets structure. Several dependencies (e.g. searchview, action) were unnecessary. Do not append the "add to dashboard" option to the Favorite menu if there is no ViewManager available (e.g. in Messaging) instead of hidding it with a CSS rule, as a ViewManager required to retrieve the active_view. * Google_spreadsheet: search.js: Change the way to retrieve the list_view_id s.t. it does not rely on parent of the SearchView anymore. * Web: search.js: Change the way to retrieve the title in search.js for Favorites s.t. it does not rely on the parent of the SearchView anymore. Doing so, the ControlPanel does not need the title attribute anymore.
Showing
- addons/account/static/src/js/widgets.js 5 additions, 5 deletionsaddons/account/static/src/js/widgets.js
- addons/board/static/src/js/dashboard.js 28 additions, 26 deletionsaddons/board/static/src/js/dashboard.js
- addons/google_spreadsheet/static/src/js/search.js 11 additions, 4 deletionsaddons/google_spreadsheet/static/src/js/search.js
- addons/mail/static/src/css/mail.css 20 additions, 4 deletionsaddons/mail/static/src/css/mail.css
- addons/mail/static/src/xml/mail.xml 13 additions, 11 deletionsaddons/mail/static/src/xml/mail.xml
- addons/web/static/src/css/base.css 45 additions, 33 deletionsaddons/web/static/src/css/base.css
- addons/web/static/src/css/base.sass 41 additions, 35 deletionsaddons/web/static/src/css/base.sass
- addons/web/static/src/js/action_manager.js 205 additions, 84 deletionsaddons/web/static/src/js/action_manager.js
- addons/web/static/src/js/control_panel.js 148 additions, 113 deletionsaddons/web/static/src/js/control_panel.js
- addons/web/static/src/js/view_manager.js 103 additions, 41 deletionsaddons/web/static/src/js/view_manager.js
- addons/web/static/src/js/views/search_menus.js 1 addition, 1 deletionaddons/web/static/src/js/views/search_menus.js
- addons/web/static/src/js/views/search_view.js 4 additions, 0 deletionsaddons/web/static/src/js/views/search_view.js
- addons/web/static/src/xml/base.xml 31 additions, 29 deletionsaddons/web/static/src/xml/base.xml
Loading
Please register or sign in to comment