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
bdbded58
Commit
bdbded58
authored
Sep 18, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
80f61b40
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
3 deletions
+38
-3
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+9
-0
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+2
-2
changelogs/unreleased/bw-show-closed-move.yml
changelogs/unreleased/bw-show-closed-move.yml
+5
-0
spec/views/projects/issues/show.html.haml_spec.rb
spec/views/projects/issues/show.html.haml_spec.rb
+22
-1
No files found.
app/helpers/issues_helper.rb
View file @
bdbded58
...
...
@@ -64,6 +64,15 @@ module IssuesHelper
end
end
def
issue_status_visibility
(
issue
,
status_box
:)
case
status_box
when
:open
'hidden'
if
issue
.
closed?
when
:closed
'hidden'
unless
issue
.
closed?
end
end
def
issue_button_visibility
(
issue
,
closed
)
return
'hidden'
if
issue_button_hidden?
(
issue
,
closed
)
end
...
...
app/views/projects/issues/show.html.haml
View file @
bdbded58
...
...
@@ -12,11 +12,11 @@
.detail-page-header
.detail-page-header-body
.issuable-status-box.status-box.status-box-issue-closed
{
class:
issue_
button_visibility
(
@issue
,
false
)
}
.issuable-status-box.status-box.status-box-issue-closed
{
class:
issue_
status_visibility
(
@issue
,
status_box: :closed
)
}
=
sprite_icon
(
'mobile-issue-close'
,
size:
16
,
css_class:
'd-block d-sm-none'
)
.d-none.d-sm-block
=
issue_closed_text
(
@issue
,
current_user
)
.issuable-status-box.status-box.status-box-open
{
class:
issue_
button_visibility
(
@issue
,
true
)
}
.issuable-status-box.status-box.status-box-open
{
class:
issue_
status_visibility
(
@issue
,
status_box: :open
)
}
=
sprite_icon
(
'issue-open-m'
,
size:
16
,
css_class:
'd-block d-sm-none'
)
%span
.d-none.d-sm-block
Open
...
...
changelogs/unreleased/bw-show-closed-move.yml
0 → 100644
View file @
bdbded58
---
title
:
Allow close status to be shown on locked issues
merge_request
:
16685
author
:
type
:
fixed
spec/views/projects/issues/show.html.haml_spec.rb
View file @
bdbded58
...
...
@@ -40,6 +40,13 @@ describe 'projects/issues/show' do
expect
(
rendered
).
to
have_selector
(
'.status-box-issue-closed:not(.hidden)'
,
text:
'Closed (moved)'
)
end
it
'shows "Closed (moved)" if an issue has been moved and discussion is locked'
do
allow
(
issue
).
to
receive
(
:discussion_locked
).
and_return
(
true
)
render
expect
(
rendered
).
to
have_selector
(
'.status-box-issue-closed:not(.hidden)'
,
text:
'Closed (moved)'
)
end
it
'links "moved" to the new issue the original issue was moved to'
do
render
...
...
@@ -95,12 +102,19 @@ describe 'projects/issues/show' do
expect
(
rendered
).
to
have_selector
(
'.status-box-issue-closed:not(.hidden)'
,
text:
'Closed'
)
end
it
'shows "Closed" if discussion is locked'
do
allow
(
issue
).
to
receive
(
:discussion_locked
).
and_return
(
true
)
render
expect
(
rendered
).
to
have_selector
(
'.status-box-issue-closed:not(.hidden)'
,
text:
'Closed'
)
end
end
context
'when the issue is open'
do
before
do
allow
(
issue
).
to
receive
(
:closed?
).
and_return
(
false
)
allow
(
issue
).
to
receive
(
:dis
s
cussion_locked
).
and_return
(
false
)
allow
(
issue
).
to
receive
(
:discussion_locked
).
and_return
(
false
)
end
it
'shows "Open" if an issue has been moved'
do
...
...
@@ -108,5 +122,12 @@ describe 'projects/issues/show' do
expect
(
rendered
).
to
have_selector
(
'.status-box-open:not(.hidden)'
,
text:
'Open'
)
end
it
'shows "Open" if discussion is locked'
do
allow
(
issue
).
to
receive
(
:discussion_locked
).
and_return
(
true
)
render
expect
(
rendered
).
to
have_selector
(
'.status-box-open:not(.hidden)'
,
text:
'Open'
)
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