summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-02-22 10:10:15 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-02-22 10:10:15 +0000
commit065a52c8144e621f699762b0206a14a010897254 (patch)
treec4a913299a1aa74f0cc2576af25a67a7d927cb55
parenta7a0873829ffbb9e69effd5803792cb2614d3581 (diff)
parent6f5b3dc7a08340b022070907b9e3a3fd031504bb (diff)
downloadgitlab-ce-065a52c8144e621f699762b0206a14a010897254.tar.gz
Merge branch '28462-fix-delimiter-removes-issue-in-todo-counter' into 'master'
fixes delimiter removes when todo marked as done Closes #28462 See merge request !9435
-rw-r--r--app/controllers/dashboard/todos_controller.rb6
-rw-r--r--changelogs/unreleased/28462-fix-delimiter-removes-issue-in-todo-counter.yml4
-rw-r--r--spec/controllers/dashboard/todos_controller_spec.rb2
3 files changed, 9 insertions, 3 deletions
diff --git a/app/controllers/dashboard/todos_controller.rb b/app/controllers/dashboard/todos_controller.rb
index ee2358b986d..5848ca62777 100644
--- a/app/controllers/dashboard/todos_controller.rb
+++ b/app/controllers/dashboard/todos_controller.rb
@@ -1,4 +1,6 @@
class Dashboard::TodosController < Dashboard::ApplicationController
+ include ActionView::Helpers::NumberHelper
+
before_action :find_todos, only: [:index, :destroy_all]
def index
@@ -48,8 +50,8 @@ class Dashboard::TodosController < Dashboard::ApplicationController
def todos_counts
{
- count: current_user.todos_pending_count,
- done_count: current_user.todos_done_count
+ count: number_with_delimiter(current_user.todos_pending_count),
+ done_count: number_with_delimiter(current_user.todos_done_count)
}
end
end
diff --git a/changelogs/unreleased/28462-fix-delimiter-removes-issue-in-todo-counter.yml b/changelogs/unreleased/28462-fix-delimiter-removes-issue-in-todo-counter.yml
new file mode 100644
index 00000000000..80995d75c23
--- /dev/null
+++ b/changelogs/unreleased/28462-fix-delimiter-removes-issue-in-todo-counter.yml
@@ -0,0 +1,4 @@
+---
+title: Fixes delimiter removes when todo marked as done
+merge_request: 9435
+author:
diff --git a/spec/controllers/dashboard/todos_controller_spec.rb b/spec/controllers/dashboard/todos_controller_spec.rb
index 0a3ac9f9512..7072bd5e87c 100644
--- a/spec/controllers/dashboard/todos_controller_spec.rb
+++ b/spec/controllers/dashboard/todos_controller_spec.rb
@@ -46,7 +46,7 @@ describe Dashboard::TodosController do
expect(todo.reload).to be_pending
expect(response).to have_http_status(200)
- expect(json_response).to eq({ "count" => 1, "done_count" => 0 })
+ expect(json_response).to eq({ "count" => "1", "done_count" => "0" })
end
end
end