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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
441501e4
Commit
441501e4
authored
Jan 10, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Present TODO's list without grouping by project
parent
aeb9db67
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
33 deletions
+38
-33
app/models/commit.rb
app/models/commit.rb
+2
-2
app/models/todo.rb
app/models/todo.rb
+2
-2
app/views/dashboard/todos/index.html.haml
app/views/dashboard/todos/index.html.haml
+2
-6
features/steps/dashboard/todos.rb
features/steps/dashboard/todos.rb
+27
-18
spec/features/todos/todos_spec.rb
spec/features/todos/todos_spec.rb
+1
-1
spec/models/todo_spec.rb
spec/models/todo_spec.rb
+4
-4
No files found.
app/models/commit.rb
View file @
441501e4
...
...
@@ -100,8 +100,8 @@ class Commit
commit_reference
(
from_project
,
id
,
full:
full
)
end
def
reference_link_text
(
from_project
=
nil
)
commit_reference
(
from_project
,
short_id
)
def
reference_link_text
(
from_project
=
nil
,
full:
false
)
commit_reference
(
from_project
,
short_id
,
full:
full
)
end
def
diff_line_count
...
...
app/models/todo.rb
View file @
441501e4
...
...
@@ -103,9 +103,9 @@ class Todo < ActiveRecord::Base
def
target_reference
if
for_commit?
target
.
short_id
target
.
reference_link_text
(
full:
true
)
else
target
.
to_reference
target
.
to_reference
(
full:
true
)
end
end
...
...
app/views/dashboard/todos/index.html.haml
View file @
441501e4
...
...
@@ -70,15 +70,11 @@
.prepend-top-default
-
if
@todos
.
any?
.js-todos-options
{
data:
{
per_page:
@todos
.
limit_value
,
current_page:
@todos
.
current_page
,
total_pages:
@todos
.
total_pages
}
}
-
@todos
.
group_by
(
&
:project
).
each
do
|
group
|
.panel.panel-default.panel-small
-
project
=
group
[
0
]
.panel-heading
=
link_to
project
.
name_with_namespace
,
namespace_project_path
(
project
.
namespace
,
project
)
%ul
.content-list.todos-list
=
render
group
[
1
]
=
render
@todos
=
paginate
@todos
,
theme:
"gitlab"
-
elsif
current_user
.
todos
.
any?
.todos-all-done
=
render
"shared/empty_states/todos_all_done.svg"
...
...
features/steps/dashboard/todos.rb
View file @
441501e4
...
...
@@ -25,15 +25,18 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
end
step
'I should see todos assigned to me'
do
merge_request_reference
=
merge_request
.
to_reference
(
full:
true
)
issue_reference
=
issue
.
to_reference
(
full:
true
)
page
.
within
(
'.todos-pending-count'
)
{
expect
(
page
).
to
have_content
'4'
}
expect
(
page
).
to
have_content
'To do 4'
expect
(
page
).
to
have_content
'Done 0'
expect
(
page
).
to
have_link
project
.
name_with_namespace
should_see_todo
(
1
,
"John Doe assigned you merge request
#{
merge_request
.
to
_reference
}
"
,
merge_request
.
title
)
should_see_todo
(
2
,
"John Doe mentioned you on issue
#{
issue
.
to
_reference
}
"
,
"
#{
current_user
.
to_reference
}
Wdyt?"
)
should_see_todo
(
3
,
"John Doe assigned you issue
#{
issue
.
to
_reference
}
"
,
issue
.
title
)
should_see_todo
(
4
,
"Mary Jane mentioned you on issue
#{
issue
.
to
_reference
}
"
,
issue
.
title
)
should_see_todo
(
1
,
"John Doe assigned you merge request
#{
merge_request_reference
}
"
,
merge_request
.
title
)
should_see_todo
(
2
,
"John Doe mentioned you on issue
#{
issue_reference
}
"
,
"
#{
current_user
.
to_reference
}
Wdyt?"
)
should_see_todo
(
3
,
"John Doe assigned you issue
#{
issue_reference
}
"
,
issue
.
title
)
should_see_todo
(
4
,
"Mary Jane mentioned you on issue
#{
issue_reference
}
"
,
issue
.
title
)
end
step
'I mark the todo as done'
do
...
...
@@ -44,10 +47,13 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
page
.
within
(
'.todos-pending-count'
)
{
expect
(
page
).
to
have_content
'3'
}
expect
(
page
).
to
have_content
'To do 3'
expect
(
page
).
to
have_content
'Done 1'
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
(
full:
true
)
}
"
end
step
'I mark all todos as done'
do
merge_request_reference
=
merge_request
.
to_reference
(
full:
true
)
issue_reference
=
issue
.
to_reference
(
full:
true
)
click_link
'Mark all as done'
page
.
within
(
'.todos-pending-count'
)
{
expect
(
page
).
to
have_content
'0'
}
...
...
@@ -55,27 +61,30 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
expect
(
page
).
to
have_content
'Done 4'
expect
(
page
).
to
have_content
"You're all done!"
expect
(
'.prepend-top-default'
).
not_to
have_link
project
.
name_with_namespace
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to
_reference
}
"
should_not_see_todo
"John Doe mentioned you on issue
#{
issue
.
to
_reference
}
"
should_not_see_todo
"John Doe assigned you issue
#{
issue
.
to
_reference
}
"
should_not_see_todo
"Mary Jane mentioned you on issue
#{
issue
.
to
_reference
}
"
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request_reference
}
"
should_not_see_todo
"John Doe mentioned you on issue
#{
issue_reference
}
"
should_not_see_todo
"John Doe assigned you issue
#{
issue_reference
}
"
should_not_see_todo
"Mary Jane mentioned you on issue
#{
issue_reference
}
"
end
step
'I should see the todo marked as done'
do
click_link
'Done 1'
expect
(
page
).
to
have_link
project
.
name_with_namespace
should_see_todo
(
1
,
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
,
merge_request
.
title
,
false
)
should_see_todo
(
1
,
"John Doe assigned you merge request
#{
merge_request
.
to_reference
(
full:
true
)
}
"
,
merge_request
.
title
,
false
)
end
step
'I should see all todos marked as done'
do
merge_request_reference
=
merge_request
.
to_reference
(
full:
true
)
issue_reference
=
issue
.
to_reference
(
full:
true
)
click_link
'Done 4'
expect
(
page
).
to
have_link
project
.
name_with_namespace
should_see_todo
(
1
,
"John Doe assigned you merge request
#{
merge_request
.
to
_reference
}
"
,
merge_request
.
title
,
false
)
should_see_todo
(
2
,
"John Doe mentioned you on issue
#{
issue
.
to
_reference
}
"
,
"
#{
current_user
.
to_reference
}
Wdyt?"
,
false
)
should_see_todo
(
3
,
"John Doe assigned you issue
#{
issue
.
to
_reference
}
"
,
issue
.
title
,
false
)
should_see_todo
(
4
,
"Mary Jane mentioned you on issue
#{
issue
.
to
_reference
}
"
,
issue
.
title
,
false
)
should_see_todo
(
1
,
"John Doe assigned you merge request
#{
merge_request_reference
}
"
,
merge_request
.
title
,
false
)
should_see_todo
(
2
,
"John Doe mentioned you on issue
#{
issue_reference
}
"
,
"
#{
current_user
.
to_reference
}
Wdyt?"
,
false
)
should_see_todo
(
3
,
"John Doe assigned you issue
#{
issue_reference
}
"
,
issue
.
title
,
false
)
should_see_todo
(
4
,
"Mary Jane mentioned you on issue
#{
issue_reference
}
"
,
issue
.
title
,
false
)
end
step
'I filter by "Enterprise"'
do
...
...
@@ -111,16 +120,16 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
end
step
'I should not see todos related to "Mary Jane" in the list'
do
should_not_see_todo
"Mary Jane mentioned you on issue
#{
issue
.
to_reference
}
"
should_not_see_todo
"Mary Jane mentioned you on issue
#{
issue
.
to_reference
(
full:
true
)
}
"
end
step
'I should not see todos related to "Merge Requests" in the list'
do
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
(
full:
true
)
}
"
end
step
'I should not see todos related to "Assignments" in the list'
do
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
}
"
should_not_see_todo
"John Doe assigned you issue
#{
issue
.
to_reference
}
"
should_not_see_todo
"John Doe assigned you merge request
#{
merge_request
.
to_reference
(
full:
true
)
}
"
should_not_see_todo
"John Doe assigned you issue
#{
issue
.
to_reference
(
full:
true
)
}
"
end
step
'I click on the todo'
do
...
...
spec/features/todos/todos_spec.rb
View file @
441501e4
...
...
@@ -171,7 +171,7 @@ describe 'Dashboard Todos', feature: true do
it
'links to the pipelines for the merge request'
do
href
=
pipelines_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
todo
.
target
)
expect
(
page
).
to
have_link
"merge request
#{
todo
.
target
.
to_reference
}
"
,
href
expect
(
page
).
to
have_link
"merge request
#{
todo
.
target
.
to_reference
(
full:
true
)
}
"
,
href
end
end
end
...
...
spec/models/todo_spec.rb
View file @
441501e4
...
...
@@ -109,7 +109,7 @@ describe Todo, models: true do
end
describe
'#target_reference'
do
it
'returns
the short commit id for commits
'
do
it
'returns
commit full reference with short id
'
do
project
=
create
(
:project
,
:repository
)
commit
=
project
.
commit
...
...
@@ -117,12 +117,12 @@ describe Todo, models: true do
subject
.
target_type
=
'Commit'
subject
.
commit_id
=
commit
.
id
expect
(
subject
.
target_reference
).
to
eq
commit
.
short_id
expect
(
subject
.
target_reference
).
to
eq
commit
.
reference_link_text
(
full:
true
)
end
it
'returns reference for issuables'
do
it
'returns
full
reference for issuables'
do
subject
.
target
=
issue
expect
(
subject
.
target_reference
).
to
eq
issue
.
to_reference
expect
(
subject
.
target_reference
).
to
eq
issue
.
to_reference
(
full:
true
)
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