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
94048497
Commit
94048497
authored
Sep 28, 2018
by
Chantal Rollison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show promotion for epics on issues
parent
4cd853e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
33 deletions
+64
-33
ee/app/helpers/license_helper.rb
ee/app/helpers/license_helper.rb
+4
-0
ee/app/views/shared/promotions/_promote_epics.html.haml
ee/app/views/shared/promotions/_promote_epics.html.haml
+1
-1
ee/changelogs/unreleased/ccr-7743_issue_sidebar.yml
ee/changelogs/unreleased/ccr-7743_issue_sidebar.yml
+5
-0
ee/spec/features/promotion_spec.rb
ee/spec/features/promotion_spec.rb
+54
-32
No files found.
ee/app/helpers/license_helper.rb
View file @
94048497
...
...
@@ -108,5 +108,9 @@ module LicenseHelper
!
Gitlab
::
CurrentSettings
.
should_check_namespace_plan?
&&
show_promotions?
&&
show_callout?
(
'promote_advanced_search_dismissed'
)
&&
!
License
.
feature_available?
(
:elastic_search
)
end
def
promote_feature?
(
feature_name
)
!
@project
&
.
group
&
.
feature_available?
(
feature_name
)
&&
show_promotions?
&&
show_callout?
(
feature_name
)
end
extend
self
end
ee/app/views/shared/promotions/_promote_epics.html.haml
View file @
94048497
-
promotion_feature
=
'promote_epics_sidebar_dismissed'
-
if
!
@project
.
feature_available?
(
:epics
)
&&
show_promotions?
&&
show_callout?
(
promotion_feature
)
-
if
promote_feature?
(
:epic
)
.block.js-epics-sidebar-callout.promotion-issue-sidebar
{
data:
{
uid:
promotion_feature
}
}
.sidebar-collapsed-icon
{
data:
{
toggle:
"dropdown"
,
target:
".js-epics-sidebar-callout"
}
}
%span
{
data:
{
toggle:
"tooltip"
,
placement:
"left"
,
container:
"body"
},
title:
_
(
'Epic'
)
}
...
...
ee/changelogs/unreleased/ccr-7743_issue_sidebar.yml
0 → 100644
View file @
94048497
---
title
:
Show promotion for epics on issues
merge_request
:
7602
author
:
type
:
fixed
ee/spec/features/promotion_spec.rb
View file @
94048497
...
...
@@ -236,53 +236,71 @@ describe 'Promotions', :js do
end
describe
'for epics in issues sidebar'
,
:js
do
before
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
nil
)
stub_application_setting
(
check_namespace_plan:
false
)
shared_examples
'Epics promotion'
do
it
'should appear on the page'
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
project
.
add_maintainer
(
user
)
sign_in
(
user
)
end
click_epic_link
it
'should appear on the page'
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
expect
(
find
(
'.promotion-issue-sidebar-message'
)).
to
have_content
'Epics let you manage your portfolio of projects more efficiently'
end
find
(
'.js-epics-sidebar-callout .btn-link'
).
click
it
'should be removed after dismissal'
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
expect
(
find
(
'.promotion-issue-sidebar-message'
)).
to
have_content
'Epics let you manage your portfolio of projects more efficiently'
end
click_epic_link
find
(
'.js-epics-sidebar-callout .js-close-callout'
).
click
it
'should be removed after dismissal'
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
expect
(
page
).
not_to
have_selector
(
'.promotion-issue-sidebar-message'
)
end
it
'should not appear on page after dismissal and reload'
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
find
(
'.js-epics-sidebar-callout .btn-link'
).
click
find
(
'.js-epics-sidebar-callout .js-close-callout'
).
click
click_epic_link
find
(
'.js-epics-sidebar-callout .js-close-callout'
).
click
visit
project_issue_path
(
project
,
issue
)
expect
(
page
).
not_to
have_selector
(
'.js-epics-sidebar-callout'
)
expect
(
page
).
not_to
have_selector
(
'.promotion-issue-sidebar-message'
)
end
it
'should close dialog when clicking on X, but not dismiss it'
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
click_epic_link
find
(
'.js-epics-sidebar-callout .dropdown-menu-close'
).
click
expect
(
page
).
to
have_selector
(
'.js-epics-sidebar-callout'
)
expect
(
page
).
to
have_selector
(
'.promotion-issue-sidebar-message'
,
visible:
false
)
end
end
it
'should not appear on page after dismissal and reload'
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
context
'gitlab.com'
do
before
do
stub_application_setting
(
check_namespace_plan:
true
)
allow
(
Gitlab
).
to
receive
(
:com?
)
{
true
}
find
(
'.js-epics-sidebar-callout .btn-link'
).
click
find
(
'.js-epics-sidebar-callout .js-close-callout'
).
click
visit
project_issue_path
(
project
,
issue
)
project
.
add_maintainer
(
user
)
sign_in
(
user
)
end
expect
(
page
).
not_to
have_selector
(
'.js-epics-sidebar-callout'
)
it_behaves_like
'Epics promotion'
end
it
'should close dialog when clicking on X, but not dismiss it'
do
visit
project_issue_path
(
project
,
issue
)
wait_for_requests
context
'self hosted'
do
before
do
allow
(
License
).
to
receive
(
:current
).
and_return
(
nil
)
stub_application_setting
(
check_namespace_plan:
false
)
find
(
'.js-epics-sidebar-callout .btn-link'
).
click
find
(
'.js-epics-sidebar-callout .dropdown-menu-close'
).
click
project
.
add_maintainer
(
user
)
sign_in
(
user
)
end
expect
(
page
).
to
have_selector
(
'.js-epics-sidebar-callout'
)
expect
(
page
).
to
have_selector
(
'.promotion-issue-sidebar-message'
,
visible:
false
)
it_behaves_like
'Epics promotion'
end
end
...
...
@@ -439,4 +457,8 @@ describe 'Promotions', :js do
expect
(
page
).
not_to
have_selector
(
'#promote_advanced_search'
)
end
end
def
click_epic_link
find
(
'.js-epics-sidebar-callout .btn-link'
).
click
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