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

✨ User Notifications (⚠️ devops) 🚨 #3937

Merged
merged 91 commits into from
Mar 10, 2023

Conversation

odeimaiz
Copy link
Member

@odeimaiz odeimaiz commented Mar 2, 2023

What do these changes do?

This PR brings the first iteration of the User Notifications. In this PR 3 notification categories are implemented:

  • new_organization
  • study_shared
  • template_shared

The way it works is as follows:

  • When one of the actions above happens while using the frontend, this POSTs a notification
  • The notification is stored in the Redis DB under the receiver's user id branch,
  • When the receiver user logs in, the last 10 notifications are provided and there are listed under the Notification Bell in the Navigation Bar
  • The Notification Bell icon will filled if there are any unread notifications, unfilled if they are all read
  • The Notification Bell will also show a number (>0) of unread notifications
  • When the user taps on Notification, the Notification will be PATCHed to mark it as read. The tap action will also...:
    • new_organization: ...open the organization details in the Preferences Window
    • study_shared/template_shared: ...open the More Options view of the resource

Some examples of notifications:

[
  {"id": "123", "user_id": "1", "category": "new_organization", "actionable_path": "organization/40", "title": "New organization", "text": "You're now member of a new Organization", "date": "2023-02-23T16:23:13.122Z", "read": True},
  {"id": "456", "user_id": "1", "category": "study_shared", "actionable_path": "study/27edd65c-b360-11ed-93d7-02420a000014", "title": "Study shared", "text": "A study was shared with you", "date": "2023-02-23T16:25:13.122Z", "read": False},
  {"id": "789", "user_id": "1", "category": "template_shared", "actionable_path": "template/f60477b6-a07e-11ed-8d29-02420a00002d", "title": "Template shared", "text": "A template was shared with you", "date": "2023-02-23T16:28:13.122Z", "read": False}
]

Post notification:
PostNotifications

Get and Patch notification:
GetNotifications

Related issue/s

related to #1122

related to ITISFoundation/osparc-issues#751
related to ITISFoundation/osparc-issues#873
closes ITISFoundation/osparc-issues#900

How to test

Checklist

@odeimaiz odeimaiz self-assigned this Mar 2, 2023
@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

Merging #3937 (7ce8a29) into master (cf72d69) will increase coverage by 0.0%.
The diff coverage is 27.7%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3937   +/-   ##
======================================
  Coverage    85.0%   85.0%           
======================================
  Files         935     935           
  Lines       40257   40311   +54     
  Branches      848     848           
======================================
+ Hits        34226   34282   +56     
+ Misses       5808    5806    -2     
  Partials      223     223           
Flag Coverage Δ
integrationtests 66.5% <30.0%> (+0.4%) ⬆️
unittests 82.2% <27.7%> (-0.1%) ⬇️

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

Impacted Files Coverage Δ
...ges/settings-library/src/settings_library/redis.py 0.0% <0.0%> (ø)
...er/src/simcore_service_webserver/users_handlers.py 66.6% <27.6%> (-28.7%) ⬇️
.../web/server/src/simcore_service_webserver/redis.py 93.1% <50.0%> (-1.6%) ⬇️
...r/src/simcore_service_webserver/redis_constants.py 100.0% <100.0%> (ø)

... and 10 files with indirect coverage changes

@odeimaiz odeimaiz changed the title WIP: Notifications WIP: User Notifications Mar 2, 2023
@odeimaiz
Copy link
Member Author

odeimaiz commented Mar 8, 2023

some suggestions

@sanderegg Merci!

@odeimaiz odeimaiz requested a review from GitHK March 10, 2023 09:32
@sonarcloud
Copy link

sonarcloud bot commented Mar 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codeclimate
Copy link

codeclimate bot commented Mar 10, 2023

Code Climate has analyzed commit 7ce8a29 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

👍 Thanks. I will follow up with a PR that cleans it a bit more and adds some tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:frontend issue affecting the front-end (area group) a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sharing: user will not get notified (more details)
6 participants