Make entire todo row clickable
This commit is contained in:
parent
673bb9ef1e
commit
51031a68f7
|
@ -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')
|
||||
|
|
|
@ -13,6 +13,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
.todo {
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.todo-item {
|
||||
.todo-title {
|
||||
@include str-truncated(calc(100% - 174px));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
%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:''
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue