Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Notification
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
apis
Notification
Merge requests
!6
Product/970 extend notification channel
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Product/970 extend notification channel
Product/970-extendNotificationChannel
into
Sprint/2020-18
Overview
0
Commits
3
Pipelines
1
Changes
5
Merged
Marcel Nellesen
requested to merge
Product/970-extendNotificationChannel
into
Sprint/2020-18
4 years ago
Overview
0
Commits
3
Pipelines
1
Changes
5
Expand
coscine/issues#970
0
0
Merge request reports
Compare
Sprint/2020-18
Sprint/2020-18 (base)
and
latest version
latest version
6d8df6a4
3 commits,
4 years ago
5 files
+
141
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
src/NotificationBus/Controller/NotificationBusController.cs
+
20
−
1
Options
@@ -8,6 +8,7 @@ using Coscine.NotificationConfiguration;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json.Linq
;
using
Stubble.Core.Builders
;
using
System
;
using
System.Collections.Generic
;
using
System.Reflection
;
@@ -111,7 +112,25 @@ namespace Coscine.Api.NotificationBus.Controllers
{
language
=
_languageModel
.
GetById
(
new
Guid
(
user
.
LanguageId
.
ToString
())).
Abbreviation
;
}
return
(
JObject
)(
action
.
Template
[
channelName
][
language
]);
var
template
=
(
JObject
)(
action
.
Template
[
channelName
][
language
]);
var
stubble
=
new
StubbleBuilder
().
Build
();
var
dict
=
new
Dictionary
<
string
,
object
>();
if
(
requestArgs
[
"placeholder"
]
!=
null
)
{
dict
=
((
JObject
)(
requestArgs
[
"placeholder"
])).
ToObject
<
Dictionary
<
string
,
object
>>();
}
dict
.
Add
(
"_targetUserName"
,
user
.
DisplayName
);
dict
.
Add
(
"_projectName"
,
project
.
DisplayName
);
foreach
(
JProperty
property
in
template
.
Properties
())
{
template
[
property
.
Name
]
=
stubble
.
Render
(
template
[
property
.
Name
].
ToString
(),
dict
);
}
return
template
;
}
private
List
<
User
>
GetUsers
(
List
<
string
>
userIds
)
Loading