luvi c1d250fcbc [FIX] web, *: show a dismiss button in the PWA notification
*: mail

This commit fixes the behavior of the notification to install the PWA.
The initial spec was not completely achieved, since the 'Dismiss' button,
using the fa-close icon was not present. See task-3275275.

Now, the button is present, and it can hide the notification and the user don't
need to interact with the installation prompt to dismiss it.

The fix also fixes the behavior of the notification when being used in
an incognito tab. The installPrompt service assumed the PWA could be
installed, since window.BeforeInstallPromptEvent is defined. But in an
incognito scenario, the event was never actually triggered, since the
feature is disabled by the browser.

This could finally create a UX issue if the app had been installed, and the
localStorage cleaned. The notification would appear, but wouldn't do anything
when clicking on the Install button since the event is no longer triggered by
the browser. Now, we rely on the trigger of the event exclusively, except on
Safari, where we rely on the installationState and the standalone display-mode.

Now, the service only set its state when the event has effectivelly been
triggered and the native prompt can be called. Since the UI relies on the
state from the service, the notification is no longer shown.

Tests have been adapted, to dispatch a custom event, allowing the service to be
initialized as if it was in a situation where the PWA can be installed effectively.
A new test have been added to verify the interaction with the close icon.

closes odoo/odoo#149961

Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2024-01-19 01:36:10 +00:00
2023-11-02 21:02:44 +00:00
2024-01-16 09:55:28 +00:00
2024-01-16 22:40:02 +00:00
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%