feat: Extend WebPushMessage with the custom settings
Description
Adds an API to set custom options as described in https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification#parameters
Fixes https://github.com/vaadin/flow/issues/20285
Type of change
- [ ] Bugfix
- [x] Feature
Checklist
- [x] I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
- [x] I have added a description following the guideline.
- [x] The issue is created in the corresponding repository and I have referenced it.
- [ ] I have added tests to ensure my change is effective and works as intended.
- [ ] New and existing tests are passing locally with my change.
- [ ] I have performed self-review and corrected misspellings.
Additional for Feature type of change
- [ ] Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.
Test Results
1 142 files ±0 1 142 suites ±0 1h 25m 8s ⏱️ - 1m 6s 7 477 tests ±0 7 427 ✅ ±0 50 💤 ±0 0 ❌ ±0 7 817 runs +8 7 759 ✅ +9 58 💤 - 1 0 ❌ ±0
Results for commit 7ce6796b. ± Comparison against base commit 9378d463.
:recycle: This comment has been updated with latest results.
To note: I'm working on figuring out how can we provide an API for adding action listener, else than asking to extend the service worker (sw.js).
Also this needs some testing on mobile.
UPD: I don't think we need to make a Java API for actions. Let's rely on the need of changing sw.ts for custom actions.
Tested with CRM tutorial in this branch https://github.com/vaadin/flow-crm-tutorial/tree/web-push-options.
this image doesn't show it, but the actions should also be available as well as notification image, if you expand.
When "Open Dashboard" is clicked, the CRM Dashboard should be opened in a new window or focus an existing browser tab.
Quality Gate passed
Issues
91 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
This ticket/PR has been released with Vaadin 24.6.0.alpha4 and is also targeting the upcoming stable 24.6.0 version.