summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2016-08-30 14:20:31 -0500
committerClement Ho <ClemMakesApps@gmail.com>2016-08-31 10:27:04 -0500
commit632899826bbb4d50f8c003b2c1771fa17d89d022 (patch)
tree7a433055f3bfd8b751996c33ea0cf9a8d5269522
parent51087cfa1a6b0bb5a7abf35081ed3b669253eb4f (diff)
downloadgitlab-ce-632899826bbb4d50f8c003b2c1771fa17d89d022.tar.gz
Fix bug where pagination is still displayed despite all todos marked as done
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/javascripts/todos.js2
-rw-r--r--app/views/dashboard/todos/index.html.haml2
-rw-r--r--features/steps/dashboard/todos.rb1
-rw-r--r--spec/features/todos/todos_spec.rb14
5 files changed, 18 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 18efe057299..c1d989f1739 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -10,6 +10,7 @@ v 8.12.0 (unreleased)
- Reduce contributions calendar data payload (ClemMakesApps)
- Add `web_url` field to issue, merge request, and snippet API objects (Ben Boeckel)
- Set path for all JavaScript cookies to honor GitLab's subdirectory setting !5627 (Mike Greiling)
+ - Fix bug where pagination is still displayed despite all todos marked as done (ClemMakesApps)
- Shorten task status phrase (ClemMakesApps)
- Add hover color to emoji icon (ClemMakesApps)
- Fix branches page dropdown sort alignment (ClemMakesApps)
diff --git a/app/assets/javascripts/todos.js b/app/assets/javascripts/todos.js
index 6e677fa8cc6..06605320a35 100644
--- a/app/assets/javascripts/todos.js
+++ b/app/assets/javascripts/todos.js
@@ -66,7 +66,7 @@
success: (function(_this) {
return function(data) {
$this.remove();
- $('.js-todos-list').remove();
+ $('.prepend-top-default').html('<div class="nothing-here-block">You\'re all done!</div>');
return _this.updateBadges(data);
};
})(this)
diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml
index d320d3bcc1e..6bcc37042ea 100644
--- a/app/views/dashboard/todos/index.html.haml
+++ b/app/views/dashboard/todos/index.html.haml
@@ -66,7 +66,7 @@
- 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.js-todos-list
+ .panel.panel-default.panel-small
- project = group[0]
.panel-heading
= link_to project.name_with_namespace, namespace_project_path(project.namespace, project)
diff --git a/features/steps/dashboard/todos.rb b/features/steps/dashboard/todos.rb
index 60152d3da55..0607086c166 100644
--- a/features/steps/dashboard/todos.rb
+++ b/features/steps/dashboard/todos.rb
@@ -54,6 +54,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
page.within('.todos-pending-count') { expect(page).to have_content '0' }
expect(page).to have_content 'To do 0'
expect(page).to have_content 'Done 4'
+ expect(page).to have_content "You're all done!"
expect(page).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}"
diff --git a/spec/features/todos/todos_spec.rb b/spec/features/todos/todos_spec.rb
index 32544f3f538..fc555a74f30 100644
--- a/spec/features/todos/todos_spec.rb
+++ b/spec/features/todos/todos_spec.rb
@@ -118,6 +118,20 @@ describe 'Dashboard Todos', feature: true do
expect(page).to have_css("#todo_#{Todo.first.id}")
end
end
+
+ describe 'mark all as done', js: true do
+ before do
+ visit dashboard_todos_path
+ click_link('Mark all as done')
+ end
+
+ it 'shows "All done" message!' do
+ within('.todos-pending-count') { expect(page).to have_content '0' }
+ expect(page).to have_content 'To do 0'
+ expect(page).to have_content "You're all done!"
+ expect(page).not_to have_selector('.gl-pagination')
+ end
+ end
end
context 'User has a Todo in a project pending deletion' do