Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Extend WebPushMessage with the custom settings #20304

Merged
merged 7 commits into from
Nov 7, 2024

Conversation

mshabarov
Copy link
Contributor

@mshabarov mshabarov commented Oct 22, 2024

Description

Adds an API to set custom options as described in https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification#parameters

Fixes #20285

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • 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 mshabarov force-pushed the add-more-options-to-webpush branch from 30e4ad4 to 0fa84bf Compare October 22, 2024 12:36
Copy link

github-actions bot commented Oct 22, 2024

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 7ce6796. ± Comparison against base commit 9378d46.

♻️ This comment has been updated with latest results.

@mshabarov
Copy link
Contributor Author

mshabarov commented Oct 29, 2024

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.

@vaadin-bot vaadin-bot added +0.0.1 and removed +1.0.0 labels Nov 1, 2024
@mshabarov mshabarov marked this pull request as ready for review November 1, 2024 14:20
@mshabarov mshabarov marked this pull request as draft November 1, 2024 14:22
@mshabarov mshabarov marked this pull request as ready for review November 5, 2024 11:49
@mshabarov mshabarov requested a review from caalador November 5, 2024 13:25
@mshabarov
Copy link
Contributor Author

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.

Copy link

sonarqubecloud bot commented Nov 7, 2024

@caalador caalador enabled auto-merge (squash) November 7, 2024 08:26
@caalador caalador merged commit a1cbb0d into main Nov 7, 2024
24 of 26 checks passed
@caalador caalador deleted the add-more-options-to-webpush branch November 7, 2024 08:32
@vaadin-bot
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make WebPushMessage output customisable
4 participants