Skip to content

[Feature Request] Notifications on mentions #1694

@golanglemonade

Description

@golanglemonade

Describe how the feature might make your life easier or solve a problem

I want to be alerted when my name is mentioned in a comment, internal policy, procedure, risk, or task so I know about it.

Describe the solution you'd like to see with any relevant context

We want to parse the next of the corresponding text field for data that looks like:

<div data-slate-node=\"element\" data-slate-inline=\"true\" data-slate-void=\"true\" data-slate-key=\"01KBR2E182QTFQ27TS4B87G2MB\" data-slate-type=\"mention\" data-slate-value=\"Sarah Funkhouser\" data-slate-id=\"s-DpyYQ0Xk\" class=\"slate-mention inline-block rounded-md bg-muted px-1.5 py-0.5 align-baseline text-sm font-medium\" style=\"position:relative\">

data-slate-key -> user.ID
data-slate-value -> user.DisplayName

We only want to do this if that was added; I think you should be able to use the data-slate-id= and compare the old vs. new value for the field and see if it was there before and only add a notification when that id is new but we should test this.

Fields we want to look at:

comment.text
internalPolicy.Details
procedure.Details
risk.Details
task.Details

Notes:

  • Make a package for slate parsing and put it in pkg, its possible we might want to use this for other things
  • make a function to checkForMentions -> this should return a map[string]Mention{} where the key is the data-slate-id and Mention contains: userID, userDisplayName, objectType, objectID, objectName
  • make a function to checkForNewMentions that takes old text, new text, and list of slate ids -> returns only new ids
  • define the fields we are checking for in slack as const to make it easier to expand later + keep up with any breaking changes
  • We can then use this to parse events from these object types -> create notifications

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions