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: new @ng-web-apis/notification package (Notification API) #123

Merged
merged 9 commits into from
Oct 10, 2023

Conversation

nsbarsukov
Copy link
Member

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Other... Please describe:

Partially solves #96

@nsbarsukov nsbarsukov self-assigned this Sep 29, 2023
@github-actions
Copy link

github-actions bot commented Sep 29, 2023

Visit the preview URL for this PR (updated for commit f9958a5):

https://ng-web-apis-common--pr123-notification-api-bz7qli26.web.app

(expires Wed, 11 Oct 2023 13:12:19 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a9d81cd8541a1a45fa12e730c551222bb3d5ceb9

@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

Merging #123 (f9958a5) into main (8bc8eca) will decrease coverage by 0.36%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #123      +/-   ##
==========================================
- Coverage   89.29%   88.93%   -0.36%     
==========================================
  Files         201      194       -7     
  Lines        1186     1112      -74     
  Branches      128      119       -9     
==========================================
- Hits         1059      989      -70     
+ Misses        103      100       -3     
+ Partials       24       23       -1     
Flag Coverage Δ
audio 79.92% <ø> (ø)
canvas 95.97% <ø> (ø)
common 100.00% <ø> (ø)
geolocation 100.00% <ø> (ø)
intersection-observer 98.00% <ø> (ø)
midi 100.00% <ø> (ø)
mutation-observer 100.00% <ø> (ø)
payment-request 100.00% <ø> (ø)
permissions 78.78% <ø> (ø)
resize-observer 100.00% <ø> (ø)
speech 100.00% <ø> (ø)
storage 100.00% <ø> (ø)
summary 88.93% <ø> (-0.36%) ⬇️
universal 100.00% <ø> (ø)
view-transition ?
workers ?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

libs/notification/logo.svg Outdated Show resolved Hide resolved
libs/notification/package.json Outdated Show resolved Hide resolved
libs/notification/src/services/notification.service.ts Outdated Show resolved Hide resolved
}

/**
* TODO: replace deprecated callback with promise after Safari 15+ support
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Safari 16 supports Permissions API so I think we can just keep it here until 16 and drop this method completely after that.

libs/notification/src/tokens/support.ts Outdated Show resolved Hide resolved
@waterplea
Copy link
Collaborator

waterplea commented Sep 29, 2023

We need a demo example showing all the notification options:
https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification

I also wonder if it's possible to create a declarative directive, something like:

<notification *ngIf="open" (close)="open = false">
  Text content
  <button icon="src" (click)="onClick()">
    Action
  </button>
</notification>

Not sure about actual "tags" inside, but it would be nice to be able to listen to actions in the same manner we listen to clicks on buttons.

@waterplea
Copy link
Collaborator

There are examples with inline replies here, not mentioned on MDN:
https://web.dev/push-notifications-display-a-notification/

@nsbarsukov nsbarsukov force-pushed the notification-api branch 3 times, most recently from 6798568 to b90a2b5 Compare October 3, 2023 09:04
@nsbarsukov nsbarsukov changed the title [WIP] feat: new @ng-web-apis/notification package (Notification API) feat: new @ng-web-apis/notification package (Notification API) Oct 3, 2023
@nsbarsukov nsbarsukov marked this pull request as ready for review October 3, 2023 09:12
@github-actions github-actions bot added the ready to merge ready label Oct 10, 2023
@nsbarsukov nsbarsukov merged commit b2bdc30 into main Oct 10, 2023
26 checks passed
@nsbarsukov nsbarsukov deleted the notification-api branch October 10, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants