-
- Downloads
[FIX] website: properly warn users of Google API errors
Before this commit, when adding a google map snippet in the DOM, the user was asked for its API key if not already configured, thanks to an user-friendly dialog. However, in the case it was misconfigured (while the editor dialog prevents some misconfiguration, configuration via the backend allow any random key to be given), the UX was terrible: the google map is simply removed without any notification. Misconfiguration can be: - Invalid API key - "Maps JavaScript API", "Places API" or "Maps Static API" not enabled - Billing not enabled Now notifications/messages warn about those things and reopens the key configuration dialog, which contains links to the gmap API documentation and now more information. Hopefully, this can be improved even further later. Indeed, this is still not perfect as there is no reliable way to understand google responses. E.g. even with the three mentioned API and billing enabled, sometimes the google map API still returns errors indicating "not enabled APIs" but it cannot be reproduced reliably. During my test it was systematic for 15min at some point but now there is none, ever. Like if there was a delay after enabling an API on the google console before it stops sending errors... although the API works immediately. Notice that in 15.0, this snippet is shown in debug mode only and we encourage users to use the new "Map" snippet which does not require any configuration. opw-2976261 Part-of: odoo/odoo#105072
Showing
- addons/website/i18n/website.pot 60 additions, 0 deletionsaddons/website/i18n/website.pot
- addons/website/static/src/js/editor/snippets.editor.js 64 additions, 38 deletionsaddons/website/static/src/js/editor/snippets.editor.js
- addons/website/static/src/js/editor/snippets.options.js 82 additions, 17 deletionsaddons/website/static/src/js/editor/snippets.options.js
- addons/website/static/src/xml/website.editor.xml 19 additions, 0 deletionsaddons/website/static/src/xml/website.editor.xml
Loading