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
5564090d
Commit
5564090d
authored
Jan 24, 2020
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix task lists on closed merge request pages
by checking correct class name
parent
defea506
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
8 deletions
+30
-8
app/assets/javascripts/merge_request.js
app/assets/javascripts/merge_request.js
+1
-1
changelogs/unreleased/bw-merge-request-permission.yml
changelogs/unreleased/bw-merge-request-permission.yml
+5
-0
spec/features/task_lists_spec.rb
spec/features/task_lists_spec.rb
+24
-7
No files found.
app/assets/javascripts/merge_request.js
View file @
5564090d
...
...
@@ -24,7 +24,7 @@ function MergeRequest(opts) {
this
.
initCommitMessageListeners
();
this
.
closeReopenReportToggle
=
IssuablesHelper
.
initCloseReopenReport
();
if
(
$
(
'
a.btn-close
'
).
length
)
{
if
(
$
(
'
.description.js-task-list-container
'
).
length
)
{
this
.
taskList
=
new
TaskList
({
dataType
:
'
merge_request
'
,
fieldName
:
'
description
'
,
...
...
changelogs/unreleased/bw-merge-request-permission.yml
0 → 100644
View file @
5564090d
---
title
:
Task lists work correctly again on closed MRs
merge_request
:
23714
author
:
type
:
fixed
spec/features/task_lists_spec.rb
View file @
5564090d
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
'Task Lists'
do
include
Warden
::
Test
::
Helpers
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:
public
,
:
repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
...
...
@@ -122,6 +122,7 @@ describe 'Task Lists' do
it
'provides a summary on Issues#index'
do
visit
project_issues_path
(
project
)
expect
(
page
).
to
have_content
(
"2 of 6 tasks completed"
)
end
end
...
...
@@ -191,6 +192,7 @@ describe 'Task Lists' do
it
'is only editable by author'
,
:js
do
visit_issue
(
project
,
issue
)
expect
(
page
).
to
have_selector
(
'.js-task-list-container'
)
gitlab_sign_out
...
...
@@ -237,10 +239,7 @@ describe 'Task Lists' do
visit
project_merge_request_path
(
project
,
merge
)
end
describe
'multiple tasks'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let!
(
:merge
)
{
create
(
:merge_request
,
:simple
,
description:
markdown
,
author:
user
,
source_project:
project
)
}
shared_examples
'multiple tasks'
do
it
'renders for description'
do
visit_merge_request
(
project
,
merge
)
...
...
@@ -261,23 +260,40 @@ describe 'Task Lists' do
expect
(
page
).
to
have_selector
(
'a.btn-close'
)
end
it
'is only editable by author'
do
it
'is only editable by author'
,
:js
do
visit_merge_request
(
project
,
merge
)
expect
(
page
).
to
have_selector
(
'.js-task-list-container'
)
expect
(
page
).
to
have_selector
(
'li.task-list-item.enabled'
,
count:
6
)
logout
(
:user
)
login_as
(
user2
)
visit
current_path
expect
(
page
).
not_to
have_selector
(
'.js-task-list-container'
)
expect
(
page
).
to
have_selector
(
'li.task-list-item.enabled'
,
count:
0
)
expect
(
page
).
to
have_selector
(
'li.task-list-item input[disabled]'
,
count:
6
)
end
end
context
'when merge request is open'
do
let!
(
:merge
)
{
create
(
:merge_request
,
:simple
,
description:
markdown
,
author:
user
,
source_project:
project
)
}
it_behaves_like
'multiple tasks'
it
'provides a summary on MergeRequests#index'
do
visit
project_merge_requests_path
(
project
)
expect
(
page
).
to
have_content
(
"2 of 6 tasks completed"
)
end
end
context
'when merge request is closed'
do
let!
(
:merge
)
{
create
(
:merge_request
,
:closed
,
:simple
,
description:
markdown
,
author:
user
,
source_project:
project
)
}
it_behaves_like
'multiple tasks'
end
describe
'single incomplete task'
do
let!
(
:merge
)
{
create
(
:merge_request
,
:simple
,
description:
singleIncompleteMarkdown
,
author:
user
,
source_project:
project
)
}
...
...
@@ -291,6 +307,7 @@ describe 'Task Lists' do
it
'provides a summary on MergeRequests#index'
do
visit
project_merge_requests_path
(
project
)
expect
(
page
).
to
have_content
(
"0 of 1 task completed"
)
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