flow icon indicating copy to clipboard operation
flow copied to clipboard

feat: Extend WebPushMessage with the custom settings

Open mshabarov opened this issue 1 year ago • 2 comments

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.

mshabarov avatar Oct 22 '24 12:10 mshabarov

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.

github-actions[bot] avatar Oct 22 '24 12:10 github-actions[bot]

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.

mshabarov avatar Oct 29 '24 09:10 mshabarov

Tested with CRM tutorial in this branch https://github.com/vaadin/flow-crm-tutorial/tree/web-push-options. Screenshot 2024-11-05 at 15 47 58 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.

mshabarov avatar Nov 05 '24 13:11 mshabarov

This ticket/PR has been released with Vaadin 24.6.0.alpha4 and is also targeting the upcoming stable 24.6.0 version.

vaadin-bot avatar Nov 20 '24 14:11 vaadin-bot