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

[GH-400] Display proper message for access request todo #404

Merged
merged 2 commits into from
Nov 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion server/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

chimeraGitLabAppIdentifier = "plugin-gitlab"

NotificationActionNameMemberAccessRequest = "member_access_requested"

invalidTokenError = "401 {error: invalid_token}" //#nosec G101 -- False positive
)

Expand Down Expand Up @@ -606,7 +608,14 @@
continue
}
notificationCount++
notificationContent += fmt.Sprintf("* %v : [%v](%v)\n", n.ActionName, n.Target.Title, n.TargetURL)

switch n.ActionName {

Check warning on line 612 in server/plugin.go

View check run for this annotation

Codecov / codecov/patch

server/plugin.go#L611-L612

Added lines #L611 - L612 were not covered by tests
// Handle special cases where the provided "Title" value is blank
case NotificationActionNameMemberAccessRequest:
notificationContent += fmt.Sprintf("* %v : [%v](%v) has requested access to [%v](%v)\n", n.ActionName, n.Author.Name, n.Author.WebURL, n.Body, n.TargetURL)
default:
notificationContent += fmt.Sprintf("* %v : [%v](%v)\n", n.ActionName, n.Target.Title, n.TargetURL)

Check warning on line 617 in server/plugin.go

View check run for this annotation

Codecov / codecov/patch

server/plugin.go#L614-L617

Added lines #L614 - L617 were not covered by tests
}
}

if notificationCount == 0 {
Expand Down
Loading