Friday, June 12, 2020
2 changes · master
Resolved issues and error corrections
This update aligns several Enterprise app tests and the IoT integration with recent frontend framework changes. It helps keep screens and automated checks reliable after the underlying setup process for frontend services was updated.
Original PR description
This PR is the counterpart of odoo/odoo#52097. Task 2274713
This fix ensures the Odoo web client properly signals when it is ready, so dependent interface elements such as chat windows and dialogs can appear as expected. It addresses a startup timing issue that could leave parts of the user interface unavailable after opening the system.
Original PR description
When the web client is completely ready, it triggers an event "web_client_ready" on the bus Some Mail OWL components rely on that mechanism to be mounted i.e. DialogManager and ChatWindowManager When…
When the web client is completely ready, it triggers an event "web_client_ready" on the bus Some Mail OWL components rely on that mechanism to be mounted i.e. DialogManager and ChatWindowManager When eveluating the action to display at startup, the webclient mechanism implies that we push the location hash each time a relevant data is availaible e.g. menu_id etc... Now, before this commit, since the hashchange handler was bound before that evaluation it was actually triggered each time the JQuery bbq pushed a url state (this is in the API) doc: http://benalman.com/code/projects/jquery-bbq/docs/files/jquery-ba-bbq-js.html#jQuery.bbq.pushState This undercutted the initial loading promise chain to finish and the event "web_client_ready" was never triggered preventing everything that relied on it to be mounted The DialogManager and ChatWindowManager were never available After this commit, the webclient is artificially finalized, with the help of a new custom event "webclient_finalize". So the event web_client_ready is trigger signalling to everyone it is in the dom A lot of bug persist though, the start() of webClient sometimes returns a rejected promise It is worth noting that the hashchange mechanism is largely outdated and will change in a more reliable way in the near future with the conversion of the webClient to OWL the drop of JQuery BBQ and the direct reliance on window.history.pushState doc: https://developer.mozilla.org/en-US/docs/Web/API/History/pushState#:~:text=The%20state%20object%20is%20a,the%20history%20entry's%20state%20object. and on the window's "popstate" event doc: https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event