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

Add notification when user team invite is created #4183

Merged
merged 17 commits into from
Jul 30, 2024

Conversation

knolleary
Copy link
Member

@knolleary knolleary commented Jul 16, 2024

Part of #4165

This is the 2rd of three PRs to introduce the new notifications system

  1. Initial user notification backend #4164
  2. Add notification when user team invite is created #4183 (THIS PR)
  3. Rewire frontend notifications to backend notifications API #4254

Description

Adds a notification when a user is invited to a team.

The notification has type team-invite

The data of the notification contains the following data:

{
    invite: {
        id: invite.hashid
    },
    team: {
        id: team.hashid,
        name: team.name
    },
    invitor: {
        username: username
    },
    role
}

The notification includes a reference property to identify the invitation it is associated with. That allows us to clear the notification when the invite is accepted/rejected etc

Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.13%. Comparing base (6c9da2e) to head (b616d07).

Files Patch % Lines
forge/db/controllers/Invitation.js 84.61% 2 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           4158-notification-backend    #4183      +/-   ##
=============================================================
+ Coverage                      77.91%   78.13%   +0.22%     
=============================================================
  Files                            292      292              
  Lines                          13389    13403      +14     
  Branches                        2996     3000       +4     
=============================================================
+ Hits                           10432    10473      +41     
+ Misses                          2957     2930      -27     
Flag Coverage Δ
backend 78.13% <87.50%> (+0.22%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joepavitt
Copy link
Contributor

invitor: {
username: username
},

typo? inviter surely?

@knolleary
Copy link
Member Author

typo? inviter surely?

Yes and no. The original Invitations table has invitor (sic), as does the external api - so I've gone for consistency here. It's technically a valid spelling, albeit not common.

Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

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

tested on pre-staging - all good.
code review/coverage +1

Rewire frontend notifications to backend notifications API
@knolleary knolleary merged commit 1b8a0f2 into 4158-notification-backend Jul 30, 2024
13 checks passed
@knolleary knolleary deleted the 4165-team-invite-notification branch July 30, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants