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

Implementation of notifications #172

Open
9 of 15 tasks
JonasMuehlmann opened this issue Jun 17, 2021 · 1 comment · Fixed by #210
Open
9 of 15 tasks

Implementation of notifications #172

JonasMuehlmann opened this issue Jun 17, 2021 · 1 comment · Fixed by #210
Assignees
Labels
Backend implemented discussion Requires opinions of team members effort: high When you have a free weekend... feature New feature frontend has_dependency Requires other issues to be closed priority: high Defining feature or very useful... status: in development

Comments

@JonasMuehlmann
Copy link
Owner

JonasMuehlmann commented Jun 17, 2021

Concept:

  • Save unread notifications in Database
  • Users can customize their notification settings to:
    • Mute specific notification events (What happened?)
    • Mute specific notification sources (Where did it happen?)
    • Mute specific notification senders (Who triggered the event?)
  • The notification type can be represented as an enum
  • The content can be stored in the JSON format and parsed depending on the type
CREATE TABLE NotificationType(
ID int IDENTITY(1,1) PRIMARY KEY,
Type NVARCHAR(30) NOT NULL
);

CREATE TABLE Notifications(
ID int IDENTITY(1,1) PRIMARY KEY,
RecipientId NVARCHAR(64)  COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL FOREIGN KEY REFERENCES Users(UserId),
Message NVARCHAR(200) NOT NULL,
CreationTime date NOT NULL,
);

Create Table NotificationMutes(
	Id Int IDENTITY(1,1),
	NotificationType NVARCHAR(64),
	NotificationSourceType NVARCHAR(64) ,
	NotificationSourceValue NVARCHAR(64),
	UserId NVARCHAR(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL FOREIGN KEY REFERENCES Users(UserId),
      SenderId NVARCHAR(64) COLLATE SQL_Latin1_General_CP1_CI_AS FOREIGN KEY REFERENCES Users(UserId)
);

ALTER TABLE Mentions Add mentionerId NVARCHAR(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL FOREIGN KEY REFERENCES users(userId);


INSERT INTO NotificationType VALUES('UserMentioned');
INSERT INTO NotificationType VALUES('MessageInSubscribedChannel');
INSERT INTO NotificationType VALUES('MessageInSubscribedTeam');
INSERT INTO NotificationType VALUES('MessageInPrivateChat');
INSERT INTO NotificationType VALUES('InvitedToTeam');
INSERT INTO NotificationType VALUES('RemovedFromTeam');
INSERT INTO NotificationType VALUES('ReactionToMessage');
INSERT INTO NotificationType VALUES('MessageDeleted');

Backend tasks:

  • Create NotificationService
    • Send notification
    • Retrieve notification
    • Mark notification as read
  • Create Notification Model
  • Adjust DB
  • Notification message builders
  • muting functionality
  • testing

Frontend tasks:

  • Notification view
  • Navigation to event source (e.g. team)
  • Notification settings view
  • Notification constructors
  • Check for user being offline or in the wrong view
  • Integrate notification sending with SignalR events

Notes for frontend implementation:

  • I recommend having a function like void AddNotification(Notification notification) that calls an internal T BuildNotificationMessage(JObject message) method which looks up the appropriate parser in A Dictionary<NotificationType, Func<NotificationType, T>> and returns a notification message.
  • Where T = An UI element for the notification
@JonasMuehlmann JonasMuehlmann added feature New feature status: not started discussion Requires opinions of team members frontend backend priority: high Defining feature or very useful... effort: high When you have a free weekend... labels Jun 17, 2021
@JonasMuehlmann JonasMuehlmann added this to the Optional features milestone Jun 17, 2021
@JonasMuehlmann JonasMuehlmann linked a pull request Jun 29, 2021 that will close this issue
6 tasks
@JonasMuehlmann JonasMuehlmann added has_dependency Requires other issues to be closed status: in development and removed status: not started labels Jul 6, 2021
@JayKim94
Copy link
Collaborator

Partially implemented (new team invited, message while absent) by #323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend implemented discussion Requires opinions of team members effort: high When you have a free weekend... feature New feature frontend has_dependency Requires other issues to be closed priority: high Defining feature or very useful... status: in development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants