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
4855f95f
Commit
4855f95f
authored
Nov 24, 2020
by
Lee Tickett
Committed by
Kerri Miller
Nov 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add service_desk_reply_to to issues list and header
parent
603f057a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
49 additions
and
10 deletions
+49
-10
app/assets/javascripts/issues_list/components/issuable.vue
app/assets/javascripts/issues_list/components/issuable.vue
+10
-3
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+4
-0
app/views/projects/issues/_issue.html.haml
app/views/projects/issues/_issue.html.haml
+4
-2
changelogs/unreleased/226991-annotate-external-issue-authorship.yml
.../unreleased/226991-annotate-external-issue-authorship.yml
+5
-0
doc/api/issues.md
doc/api/issues.md
+1
-0
doc/user/project/img/service_desk_issue_tracker.png
doc/user/project/img/service_desk_issue_tracker.png
+0
-0
lib/api/entities/issue.rb
lib/api/entities/issue.rb
+1
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/features/issues/service_desk_spec.rb
spec/features/issues/service_desk_spec.rb
+21
-5
No files found.
app/assets/javascripts/issues_list/components/issuable.vue
View file @
4855f95f
...
@@ -35,6 +35,7 @@ export default {
...
@@ -35,6 +35,7 @@ export default {
i18n
:
{
i18n
:
{
openedAgo
:
__
(
'
opened %{timeAgoString} by %{user}
'
),
openedAgo
:
__
(
'
opened %{timeAgoString} by %{user}
'
),
openedAgoJira
:
__
(
'
opened %{timeAgoString} by %{user} in Jira
'
),
openedAgoJira
:
__
(
'
opened %{timeAgoString} by %{user} in Jira
'
),
openedAgoServiceDesk
:
__
(
'
opened %{timeAgoString} by %{email} via %{user}
'
),
},
},
inject
:
[
'
scopedLabelsAvailable
'
],
inject
:
[
'
scopedLabelsAvailable
'
],
components
:
{
components
:
{
...
@@ -206,6 +207,11 @@ export default {
...
@@ -206,6 +207,11 @@ export default {
healthStatus
()
{
healthStatus
()
{
return
convertToCamelCase
(
this
.
issuable
.
health_status
);
return
convertToCamelCase
(
this
.
issuable
.
health_status
);
},
},
openedMessage
()
{
if
(
this
.
isJiraIssue
)
return
this
.
$options
.
i18n
.
openedAgoJira
;
if
(
this
.
issuable
.
service_desk_reply_to
)
return
this
.
$options
.
i18n
.
openedAgoServiceDesk
;
return
this
.
$options
.
i18n
.
openedAgo
;
},
},
},
mounted
()
{
mounted
()
{
// TODO: Refactor user popover to use its own component instead of
// TODO: Refactor user popover to use its own component instead of
...
@@ -311,9 +317,7 @@ export default {
...
@@ -311,9 +317,7 @@ export default {
<span
data-testid=
"openedByMessage"
class=
"gl-display-none d-sm-inline-block gl-mr-4"
>
<span
data-testid=
"openedByMessage"
class=
"gl-display-none d-sm-inline-block gl-mr-4"
>
·
·
<gl-sprintf
<gl-sprintf
:message=
"openedMessage"
>
:message=
"isJiraIssue ? $options.i18n.openedAgoJira : $options.i18n.openedAgo"
>
<template
#timeAgoString
>
<template
#timeAgoString
>
<span>
{{
issuableCreatedAt
}}
</span>
<span>
{{
issuableCreatedAt
}}
</span>
</
template
>
</
template
>
...
@@ -326,6 +330,9 @@ export default {
...
@@ -326,6 +330,9 @@ export default {
>
{{
issuableAuthor
.
name
}}
</gl-link
>
{{
issuableAuthor
.
name
}}
</gl-link
>
>
</
template
>
</
template
>
<
template
#email
>
<span>
{{
issuable
.
service_desk_reply_to
}}
</span>
</
template
>
</gl-sprintf>
</gl-sprintf>
</span>
</span>
...
...
app/helpers/issuables_helper.rb
View file @
4855f95f
...
@@ -189,6 +189,10 @@ module IssuablesHelper
...
@@ -189,6 +189,10 @@ module IssuablesHelper
output
=
[]
output
=
[]
output
<<
"Opened
#{
time_ago_with_tooltip
(
issuable
.
created_at
)
}
by "
.
html_safe
output
<<
"Opened
#{
time_ago_with_tooltip
(
issuable
.
created_at
)
}
by "
.
html_safe
if
issuable
.
is_a?
(
Issue
)
&&
issuable
.
service_desk_reply_to
output
<<
"
#{
html_escape
(
issuable
.
service_desk_reply_to
)
}
via "
end
output
<<
content_tag
(
:strong
)
do
output
<<
content_tag
(
:strong
)
do
author_output
=
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
mobile_classes:
"d-none d-sm-inline"
)
author_output
=
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
mobile_classes:
"d-none d-sm-inline"
)
author_output
<<
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
by_username:
true
,
avatar:
false
,
mobile_classes:
"d-inline d-sm-none"
)
author_output
<<
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
by_username:
true
,
avatar:
false
,
mobile_classes:
"d-inline d-sm-none"
)
...
...
app/views/projects/issues/_issue.html.haml
View file @
4855f95f
...
@@ -22,8 +22,10 @@
...
@@ -22,8 +22,10 @@
#{
issuable_reference
(
issue
)
}
#{
issuable_reference
(
issue
)
}
%span
.issuable-authored.d-none.d-sm-inline-block
%span
.issuable-authored.d-none.d-sm-inline-block
·
·
opened
#{
time_ago_with_tooltip
(
issue
.
created_at
,
placement:
'bottom'
)
}
opened
#{
time_ago_with_tooltip
(
issue
.
created_at
,
placement:
'bottom'
)
}
by
by
#{
link_to_member
(
@project
,
issue
.
author
,
avatar:
false
)
}
-
if
issue
.
service_desk_reply_to
#{
issue
.
service_desk_reply_to
}
via
#{
link_to_member
(
@project
,
issue
.
author
,
avatar:
false
)
}
=
render_if_exists
'shared/issuable/gitlab_team_member_badge'
,
{
author:
issue
.
author
}
=
render_if_exists
'shared/issuable/gitlab_team_member_badge'
,
{
author:
issue
.
author
}
-
if
issue
.
milestone
-
if
issue
.
milestone
%span
.issuable-milestone.d-none.d-sm-inline-block
%span
.issuable-milestone.d-none.d-sm-inline-block
...
...
changelogs/unreleased/226991-annotate-external-issue-authorship.yml
0 → 100644
View file @
4855f95f
---
title
:
Add `service_desk_reply_to` to issues list and header
merge_request
:
48089
author
:
Lee Tickett
type
:
added
doc/api/issues.md
View file @
4855f95f
...
@@ -678,6 +678,7 @@ Example response:
...
@@ -678,6 +678,7 @@ Example response:
},
},
"subscribed"
:
true
,
"subscribed"
:
true
,
"moved_to_id"
:
null
,
"moved_to_id"
:
null
,
"service_desk_reply_to"
:
"service.desk@gitlab.com"
,
"epic_iid"
:
null
,
"epic_iid"
:
null
,
"epic"
:
null
"epic"
:
null
}
}
...
...
doc/user/project/img/service_desk_issue_tracker.png
View replaced file @
603f057a
View file @
4855f95f
59.4 KB
|
W:
|
H:
44.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
lib/api/entities/issue.rb
View file @
4855f95f
...
@@ -43,6 +43,7 @@ module API
...
@@ -43,6 +43,7 @@ module API
end
end
expose
:moved_to_id
expose
:moved_to_id
expose
:service_desk_reply_to
end
end
end
end
end
end
...
...
locale/gitlab.pot
View file @
4855f95f
...
@@ -32862,6 +32862,9 @@ msgstr ""
...
@@ -32862,6 +32862,9 @@ msgstr ""
msgid "open issue"
msgid "open issue"
msgstr ""
msgstr ""
msgid "opened %{timeAgoString} by %{email} via %{user}"
msgstr ""
msgid "opened %{timeAgoString} by %{user}"
msgid "opened %{timeAgoString} by %{user}"
msgstr ""
msgstr ""
...
...
spec/features/issues/service_desk_spec.rb
View file @
4855f95f
...
@@ -4,7 +4,9 @@ require 'spec_helper'
...
@@ -4,7 +4,9 @@ require 'spec_helper'
RSpec
.
describe
'Service Desk Issue Tracker'
,
:js
do
RSpec
.
describe
'Service Desk Issue Tracker'
,
:js
do
let
(
:project
)
{
create
(
:project
,
:private
,
service_desk_enabled:
true
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
service_desk_enabled:
true
)
}
let
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:support_bot
)
{
User
.
support_bot
}
before
do
before
do
# The following two conditions equate to Gitlab::ServiceDesk.supported == true
# The following two conditions equate to Gitlab::ServiceDesk.supported == true
...
@@ -27,6 +29,16 @@ RSpec.describe 'Service Desk Issue Tracker', :js do
...
@@ -27,6 +29,16 @@ RSpec.describe 'Service Desk Issue Tracker', :js do
end
end
end
end
context
'issue page'
do
let
(
:service_desk_issue
)
{
create
(
:issue
,
project:
project
,
author:
support_bot
,
service_desk_reply_to:
'service.desk@example.com'
)
}
it
'shows service_desk_reply_to in issue header'
do
visit
project_issue_path
(
project
,
service_desk_issue
)
expect
(
page
).
to
have_text
(
'by service.desk@example.com via GitLab Support Bot'
)
end
end
describe
'issues list'
do
describe
'issues list'
do
context
'when service desk is supported'
do
context
'when service desk is supported'
do
context
'when there are no issues'
do
context
'when there are no issues'
do
...
@@ -66,10 +78,10 @@ RSpec.describe 'Service Desk Issue Tracker', :js do
...
@@ -66,10 +78,10 @@ RSpec.describe 'Service Desk Issue Tracker', :js do
end
end
context
'when there are issues'
do
context
'when there are issues'
do
let
(
:support_bot
)
{
User
.
support_bot
}
let
_it_be
(
:project
)
{
create
(
:project
,
:private
,
service_desk_enabled:
true
)
}
let
(
:other_user
)
{
create
(
:user
)
}
let
_it_be
(
:other_user
)
{
create
(
:user
)
}
let
!
(
:service_desk_issue
)
{
create
(
:issue
,
project:
project
,
author:
support_bot
)
}
let
_it_be
(
:service_desk_issue
)
{
create
(
:issue
,
project:
project
,
author:
support_bot
,
service_desk_reply_to:
'service.desk@example.com'
)
}
let
!
(
:other_user_issue
)
{
create
(
:issue
,
project:
project
,
author:
other_user
)
}
let
_it_be
(
:other_user_issue
)
{
create
(
:issue
,
project:
project
,
author:
other_user
)
}
describe
'service desk info content'
do
describe
'service desk info content'
do
before
do
before
do
...
@@ -94,6 +106,10 @@ RSpec.describe 'Service Desk Issue Tracker', :js do
...
@@ -94,6 +106,10 @@ RSpec.describe 'Service Desk Issue Tracker', :js do
it
'only displays issues created by support bot'
do
it
'only displays issues created by support bot'
do
expect
(
page
).
to
have_selector
(
'.issues-list .issue'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.issues-list .issue'
,
count:
1
)
end
end
it
'shows service_desk_reply_to in issues list'
do
expect
(
page
).
to
have_text
(
'by service.desk@example.com via GitLab Support Bot'
)
end
end
end
describe
'search box'
do
describe
'search box'
do
...
...
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