Tuesday, June 25, 2024
2 changes · saas-17.2
Enhancements to existing features
Website visitors can now switch event pages between list and grid layouts when both options are enabled. Their choice is remembered during the session, and the list layout has been simplified to make event browsing quicker and cleaner.
Original PR description
[TASK](https://www.odoo.com/web#id=3869970&cids=1&menu_id=6478&action=4043&model=project.task&view_type=form) This commit adds a switcher to the event list view to allow the user to switch between a…
[TASK](https://www.odoo.com/web#id=3869970&cids=1&menu_id=6478&action=4043&model=project.task&view_type=form) This commit adds a switcher to the event list view to allow the user to switch between a list and a grid view of the events. The switcher is only displayed if both grid and list views are enabled in the web editor. Each time the user switches between the views, the preference is sent to the controller and saved in the session as a 'layout_mode' setting. If no preference is set, the default view is the first view enabled of this list : grid, list. This commit also changes the style and layout of the list view to make it more compact and simple. As we want the switcher to be quick, it is not possible to reload the page when the user switches between the views. Instead, we use some javascript to toggle or replace some CSS. Note that as the grid and list view are really different, it was too complicated to switch views by using the same html elements. I have decided to load both views in the DOM and to hide the one that is not displayed.
Resolved issues and error corrections
Search filters in list and kanban views now remain in place when users open a record and return using the browser back button. This prevents users from losing their current view context and having to reapply filters.
Original PR description
[FIX] web: use back button don't break filters in search view Open a kanban view or a list view; Enter a filter in the search view; Open a record; Go back to the multi-record view using the browser (back button). Before this commit, the previously entered filter is not there anymore. Now, the filter stays. To achieve this, before leaving the multi-record view, the global state is saved on the history state. To be able to push a key (the global state) on the state to be saved on the history and not shown in the browser, a new way to add a key/value to the state, but omit it on the URL was developed. Also, a way to push the state synchronous was added.