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
b12fcd0e
Commit
b12fcd0e
authored
Nov 10, 2021
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow reporters to see the service desk email address
Changelog: added
parent
ce274223
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
1 deletion
+97
-1
app/views/projects/issues/_service_desk_info_content.html.haml
...iews/projects/issues/_service_desk_info_content.html.haml
+2
-1
spec/views/projects/issues/_service_desk_info_content.html.haml_spec.rb
...jects/issues/_service_desk_info_content.html.haml_spec.rb
+95
-0
No files found.
app/views/projects/issues/_service_desk_info_content.html.haml
View file @
b12fcd0e
-
service_desk_enabled
=
@project
.
service_desk_enabled?
-
can_edit_project_settings
=
can?
(
current_user
,
:admin_project
,
@project
)
-
can_admin_issues
=
can?
(
current_user
,
:admin_issue
,
@project
)
-
title_text
=
s_
(
"ServiceDesk|Use Service Desk to connect with your users and offer customer support through email right inside GitLab"
)
.non-empty-state.media
...
...
@@ -10,7 +11,7 @@
.gl-mt-3.gl-ml-3
%h5
=
title_text
-
if
can_
edit_project_setting
s
&&
service_desk_enabled
-
if
can_
admin_issue
s
&&
service_desk_enabled
%p
=
s_
(
"ServiceDesk|Your users can send emails to this address:"
)
%code
=
@project
.
service_desk_address
...
...
spec/views/projects/issues/_service_desk_info_content.html.haml_spec.rb
0 → 100644
View file @
b12fcd0e
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'projects/issues/_service_desk_info_content'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:service_desk_address
)
{
'address@example.com'
}
before
do
assign
(
:project
,
project
)
allow
(
project
).
to
receive
(
:service_desk_address
).
and_return
(
service_desk_address
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
end
context
'when service desk is disabled'
do
before
do
allow
(
project
).
to
receive
(
:service_desk_enabled?
).
and_return
(
false
)
end
context
'when the logged user is at least maintainer'
do
before
do
project
.
add_maintainer
(
user
)
end
it
'shows the info including the project settings link'
,
:aggregate_failures
do
render
expect
(
rendered
).
to
have_text
(
'Use Service Desk'
)
expect
(
rendered
).
not_to
have_text
(
service_desk_address
)
expect
(
rendered
).
to
have_link
(
href:
"/
#{
project
.
full_path
}
/edit"
)
end
end
context
'when the logged user is at only a developer'
do
before
do
project
.
add_developer
(
user
)
end
it
'shows the info without the project settings link'
,
:aggregate_failures
do
render
expect
(
rendered
).
to
have_text
(
'Use Service Desk'
)
expect
(
rendered
).
not_to
have_text
(
service_desk_address
)
expect
(
rendered
).
not_to
have_link
(
href:
"/
#{
project
.
full_path
}
/edit"
)
end
end
end
context
'when service desk is enabled'
do
before
do
allow
(
project
).
to
receive
(
:service_desk_enabled?
).
and_return
(
true
)
end
context
'when the logged user is at least reporter'
do
before
do
project
.
add_reporter
(
user
)
end
it
'shows the info including the email address'
,
:aggregate_failures
do
render
expect
(
rendered
).
to
have_text
(
'Use Service Desk'
)
expect
(
rendered
).
to
have_text
(
service_desk_address
)
expect
(
rendered
).
not_to
have_link
(
href:
"/
#{
project
.
full_path
}
/edit"
)
end
end
context
'when the logged user is at only a guest'
do
before
do
project
.
add_guest
(
user
)
end
it
'shows the info without the email address'
,
:aggregate_failures
do
render
expect
(
rendered
).
to
have_text
(
'Use Service Desk'
)
expect
(
rendered
).
not_to
have_text
(
service_desk_address
)
expect
(
rendered
).
not_to
have_link
(
href:
"/
#{
project
.
full_path
}
/edit"
)
end
end
context
'when user is not logged in'
do
let
(
:user
)
{
nil
}
it
'shows the info without the email address'
,
:aggregate_failures
do
render
expect
(
rendered
).
to
have_text
(
'Use Service Desk'
)
expect
(
rendered
).
not_to
have_text
(
service_desk_address
)
expect
(
rendered
).
not_to
have_link
(
href:
"/
#{
project
.
full_path
}
/edit"
)
end
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