Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f13098af
Commit
f13098af
authored
Jan 21, 2020
by
Takuya Noguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve message UI on Microsoft Teams notification
Signed-off-by:
Takuya Noguchi
<
takninnovationresearch@gmail.com
>
parent
fe5227b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
changelogs/unreleased/198009-ms-teams-notification-message-improved.yml
...eleased/198009-ms-teams-notification-message-improved.yml
+5
-0
lib/microsoft_teams/notifier.rb
lib/microsoft_teams/notifier.rb
+1
-4
spec/lib/microsoft_teams/notifier_spec.rb
spec/lib/microsoft_teams/notifier_spec.rb
+12
-8
No files found.
changelogs/unreleased/198009-ms-teams-notification-message-improved.yml
0 → 100644
View file @
f13098af
---
title
:
Improve message UI on Microsoft Teams notification
merge_request
:
23385
author
:
Takuya Noguchi
type
:
fixed
lib/microsoft_teams/notifier.rb
View file @
f13098af
...
...
@@ -36,10 +36,7 @@ module MicrosoftTeams
attachments
=
options
[
:attachments
]
unless
attachments
.
blank?
result
[
'sections'
]
<<
{
'title'
=>
'Details'
,
'facts'
=>
[{
'name'
=>
'Attachments'
,
'value'
=>
attachments
}]
}
result
[
'sections'
]
<<
{
text:
attachments
}
end
result
.
to_json
...
...
spec/lib/microsoft_teams/notifier_spec.rb
View file @
f13098af
...
...
@@ -17,7 +17,7 @@ describe MicrosoftTeams::Notifier do
text:
'[#1 Awesome issue](http://localhost/namespace2/gitlabhq/issues/1)'
,
image:
'http://someimage.com'
},
attachments:
'please fix'
attachments:
"[GitLab](https://gitlab.com)
\n\n
- _Ruby_
\n
- **Go**
\n
"
}
end
...
...
@@ -31,13 +31,7 @@ describe MicrosoftTeams::Notifier do
'activityImage'
=>
'http://someimage.com'
},
{
'title'
=>
'Details'
,
'facts'
=>
[
{
'name'
=>
'Attachments'
,
'value'
=>
'please fix'
}
]
text:
"[GitLab](https://gitlab.com)
\n\n
- _Ruby_
\n
- **Go**
\n
"
}
],
'title'
=>
'JohnDoe4/project2'
,
...
...
@@ -54,4 +48,14 @@ describe MicrosoftTeams::Notifier do
expect
(
subject
.
ping
(
options
)).
to
be
true
end
end
describe
'#body'
do
it
'returns Markdown-based body when HTML was passed'
do
expect
(
subject
.
send
(
:body
,
options
)).
to
eq
(
body
.
to_json
)
end
it
'fails when empty Hash was passed'
do
expect
{
subject
.
send
(
:body
,
{})
}.
to
raise_error
(
ArgumentError
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment