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

Notification message should be saved in Object format #2038

Closed
Silver-IT opened this issue Jun 4, 2024 · 1 comment · Fixed by #2046
Closed

Notification message should be saved in Object format #2038

Silver-IT opened this issue Jun 4, 2024 · 1 comment · Fixed by #2046
Assignees

Comments

@Silver-IT
Copy link
Member

Problem

Since the notification messages are simple string, they can't be reactive to the user's profile changes.
As I mentioned here, many different names could be used for one user.

Example case

The group has a new member. Say hi to alexjin!
Alex Jin proposed to add a member to the group. Vote now!
Alex created a proposal. Vote now!
SilverIT  proposed to change the group voting system. Vote now!

Solution

Save the notification message in an Object format, and render them inside NotificationList.vue.

@Silver-IT Silver-IT self-assigned this Jun 10, 2024
@Silver-IT
Copy link
Member Author

While investigating the Notification body, I've found another issue. The body should be Object, not string, to make it reactive to the language config changes.

export type Notification = {
  // Indicates which user avatar icon to display alongside the notification.
  +avatarUserID: string;
  +body: string;
  // If present, indicates in which group's notification list to display the notification.
  +groupID?: string;
  +icon: string;
  +level: NotificationLevel;
  +linkTo: string;
  read: boolean;
  // When the corresponding event happened.
  +timestamp: number;
  +type: string;
  // Other properties might be defined according to the notification's type.
  ...
}

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 a pull request may close this issue.

1 participant