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
Boxiang Sun
gitlab-ce
Commits
51031a68
Commit
51031a68
authored
Mar 30, 2016
by
Annabel Dunstone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make entire todo row clickable
parent
673bb9ef
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
1 deletion
+25
-1
app/assets/javascripts/todos.js.coffee
app/assets/javascripts/todos.js.coffee
+5
-0
app/assets/stylesheets/pages/todos.scss
app/assets/stylesheets/pages/todos.scss
+6
-0
app/views/dashboard/todos/_todo.html.haml
app/views/dashboard/todos/_todo.html.haml
+1
-1
features/dashboard/todos.feature
features/dashboard/todos.feature
+5
-0
features/steps/dashboard/todos.rb
features/steps/dashboard/todos.rb
+8
-0
No files found.
app/assets/javascripts/todos.js.coffee
View file @
51031a68
...
...
@@ -10,6 +10,7 @@ class @Todos
initBtnListeners
:
->
$
(
'.done-todo'
).
on
(
'click'
,
@
doneClicked
)
$
(
'.js-todos-mark-all'
).
on
(
'click'
,
@
allDoneClicked
)
$
(
'.todo'
).
on
(
'click'
,
@
goToTodoUrl
)
doneClicked
:
(
e
)
=>
e
.
preventDefault
()
...
...
@@ -54,3 +55,7 @@ class @Todos
updateBadges
:
(
data
)
->
$
(
'.todos-pending .badge, .todos-pending-count'
).
text
data
.
count
$
(
'.todos-done .badge'
).
text
data
.
done_count
goToTodoUrl
:
(
e
)
->
$this
=
$
(
e
.
currentTarget
)
window
.
location
.
href
=
$this
.
data
(
'url'
)
app/assets/stylesheets/pages/todos.scss
View file @
51031a68
...
...
@@ -13,6 +13,12 @@
}
}
.todo
{
&
:hover
{
cursor
:
pointer
;
}
}
.todo-item
{
.todo-title
{
@include
str-truncated
(
calc
(
100%
-
174px
));
...
...
app/views/dashboard/todos/_todo.html.haml
View file @
51031a68
%li
{
class:
"todo todo-#{todo.done? ? 'done' : 'pending'}"
,
id:
dom_id
(
todo
)
}
%li
{
class:
"todo todo-#{todo.done? ? 'done' : 'pending'}"
,
id:
dom_id
(
todo
)
,
data
:{
url:
todo_target_path
(
todo
)}
}
.todo-item.todo-block
=
image_tag
avatar_icon
(
todo
.
author_email
,
40
),
class:
'avatar s40'
,
alt
:''
...
...
features/dashboard/todos.feature
View file @
51031a68
...
...
@@ -36,3 +36,8 @@ Feature: Dashboard Todos
Scenario
:
I
filter by action
Given
I filter by
"Mentioned"
Then
I should not see todos related to
"Assignments"
in the list
@javascript
Scenario
:
I
click on a todo row
Given
I click on the todo
Then
I should be directed to the corresponding page
features/steps/dashboard/todos.rb
View file @
51031a68
...
...
@@ -88,6 +88,14 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
should_not_see_todo
"John Doe assigned you issue #
#{
issue
.
iid
}
"
end
step
'I click on the todo'
do
execute_script
(
"$('.todo:nth-child(1)').click()"
)
end
step
'I should be directed to the corresponding page'
do
page
.
should
have_css
(
'.identifier'
,
text:
'Merge Request !1'
)
end
def
should_see_todo
(
position
,
title
,
body
,
pending
=
true
)
page
.
within
(
".todo:nth-child(
#{
position
}
)"
)
do
expect
(
page
).
to
have_content
title
...
...
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