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
040a77af
Commit
040a77af
authored
Sep 28, 2017
by
Bryce Johnson
Committed by
Phil Hughes
Sep 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only show 'Turn on Service Desk' when permissions are present.
parent
5566debe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
15 deletions
+31
-15
changelogs/unreleased-ee/service-desk-permissions.yml
changelogs/unreleased-ee/service-desk-permissions.yml
+5
-0
ee/app/views/projects/issues/_service_desk_info_content.html.haml
...iews/projects/issues/_service_desk_info_content.html.haml
+2
-1
spec/ee/spec/features/issues/service_desk_spec.rb
spec/ee/spec/features/issues/service_desk_spec.rb
+24
-14
No files found.
changelogs/unreleased-ee/service-desk-permissions.yml
0 → 100644
View file @
040a77af
---
title
:
Only show Turn on Service Desk button when user has permissions.
merge_request
:
author
:
type
:
fixed
ee/app/views/projects/issues/_service_desk_info_content.html.haml
View file @
040a77af
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
-
callout_selector
=
is_empty_state
?
'empty-state'
:
'non-empty-state media'
-
callout_selector
=
is_empty_state
?
'empty-state'
:
'non-empty-state media'
-
svg_path
=
!
is_empty_state
?
'shared/empty_states/icons/service_desk_callout.svg'
:
'shared/empty_states/icons/service_desk_empty_state.svg'
-
svg_path
=
!
is_empty_state
?
'shared/empty_states/icons/service_desk_callout.svg'
:
'shared/empty_states/icons/service_desk_empty_state.svg'
-
can_edit_project_settings
=
can?
(
current_user
,
:admin_project
,
@project
)
%div
{
class:
"#{callout_selector}"
}
%div
{
class:
"#{callout_selector}"
}
.service-desk-graphic
.service-desk-graphic
...
@@ -19,6 +20,6 @@
...
@@ -19,6 +20,6 @@
%span
Those emails automatically become issues (with the comments becoming the email conversation) listed here.
%span
Those emails automatically become issues (with the comments becoming the email conversation) listed here.
=
link_to
'Read more'
,
help_page_path
(
'user/project/service_desk'
)
=
link_to
'Read more'
,
help_page_path
(
'user/project/service_desk'
)
-
if
!
service_desk_enabled
-
if
can_edit_project_settings
&&
!
service_desk_enabled
.turn-on-btn-container
.turn-on-btn-container
=
link_to
"Turn on Service Desk"
,
edit_project_path
(
@project
),
class:
'btn btn-new btn-inverted'
=
link_to
"Turn on Service Desk"
,
edit_project_path
(
@project
),
class:
'btn btn-new btn-inverted'
spec/ee/spec/features/issues/service_desk_spec.rb
View file @
040a77af
...
@@ -31,6 +31,7 @@ describe 'Service Desk Issue Tracker', js: true do
...
@@ -31,6 +31,7 @@ describe 'Service Desk Issue Tracker', js: true do
let
(
:project_without_service_desk
)
{
create
(
:project
,
:private
,
service_desk_enabled:
false
)
}
let
(
:project_without_service_desk
)
{
create
(
:project
,
:private
,
service_desk_enabled:
false
)
}
describe
'service desk info content'
do
describe
'service desk info content'
do
context
'when user has permissions to edit project settings'
do
before
do
before
do
project_without_service_desk
.
add_master
(
user
)
project_without_service_desk
.
add_master
(
user
)
visit
service_desk_project_issues_path
(
project_without_service_desk
)
visit
service_desk_project_issues_path
(
project_without_service_desk
)
...
@@ -48,12 +49,21 @@ describe 'Service Desk Issue Tracker', js: true do
...
@@ -48,12 +49,21 @@ describe 'Service Desk Issue Tracker', js: true do
expect
(
page
).
to
have_link
(
'Turn on Service Desk'
)
expect
(
page
).
to
have_link
(
'Turn on Service Desk'
)
end
end
end
end
end
context
'when service desk has been activated
'
do
context
'when user does not have permission to edit project settings
'
do
before
do
before
do
project_without_service_desk
.
add_guest
(
user
)
visit
service_desk_project_issues_path
(
project_without_service_desk
)
end
end
it
'does not show a button configure service desk'
do
expect
(
page
).
not_to
have_link
(
'Turn on Service Desk'
)
end
end
end
end
context
'when service desk has been activated'
do
context
'when there are no issues'
do
context
'when there are no issues'
do
describe
'service desk info content'
do
describe
'service desk info content'
do
before
do
before
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