summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-11-14 20:47:13 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2016-11-14 20:47:13 +0000
commitf4710ee83cea4c8a6b3d37f19d798757bf30ab4c (patch)
treeaf1b79d6ab7ffddb0bd08a9006e3c097e3d24bac
parentc04e3af4844f040767fa99202f96d202d0f5ee2a (diff)
parent5ab8536f4663a831bbe2e3acb6fd485a7d68c39f (diff)
downloadgitlab-ce-f4710ee83cea4c8a6b3d37f19d798757bf30ab4c.tar.gz
Merge branch 'issue-13823' into 'master'
Issue #13823: random message when all Todos are Done ## What does this MR do? Shows a random message every time the To Do list is empty: https://gitlab.com/gitlab-org/gitlab-ce/issues/13823 ## Are there points in the code the reviewer needs to double check? It's my first contribution to GitLab so I might need some help: - I'm loading a yaml file in the controller. I'm not sure where would be the best place to put it. - I'm also having the error below running the tests but it doesn't seem related to my changes. I think I might have some issue with my config. Could you double check if the tests pass for you? /home/pep/.rvm/gems/ruby-2.3.1/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call': No route matches [GET] "/autocomplete/users/sjobs@apple.com.json" (ActionController::RoutingError) ## Why was this MR needed? https://gitlab.com/gitlab-org/gitlab-ce/issues/13823 ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/13823 See merge request !6818
-rw-r--r--app/views/dashboard/todos/index.html.haml2
-rw-r--r--changelogs/unreleased/issue-13823.yml4
-rw-r--r--config/initializers/1_settings.rb1
-rw-r--r--config/no_todos_messages.yml13
-rw-r--r--spec/features/todos/todos_spec.rb6
5 files changed, 22 insertions, 4 deletions
diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml
index 5b2465e25ee..472d698486b 100644
--- a/app/views/dashboard/todos/index.html.haml
+++ b/app/views/dashboard/todos/index.html.haml
@@ -84,7 +84,7 @@
= render "shared/empty_states/todos_all_done.svg"
- if todos_filter_empty?
%h4.text-center
- Good job! Looks like you don't have any todos left.
+ = Gitlab.config.gitlab.no_todos_messages.sample
%p.text-center
Are you looking for things to do? Take a look at
= succeed "," do
diff --git a/changelogs/unreleased/issue-13823.yml b/changelogs/unreleased/issue-13823.yml
new file mode 100644
index 00000000000..c1b5760f7df
--- /dev/null
+++ b/changelogs/unreleased/issue-13823.yml
@@ -0,0 +1,4 @@
+---
+title: Show random messages when the To Do list is empty
+merge_request: 6818
+author: Josep Llaneras
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 9fec2ad6bf7..9ddd1554811 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -215,6 +215,7 @@ Settings.gitlab.default_projects_features['visibility_level'] = Settings.send(
Settings.gitlab['domain_whitelist'] ||= []
Settings.gitlab['import_sources'] ||= %w[github bitbucket gitlab google_code fogbugz git gitlab_project]
Settings.gitlab['trusted_proxies'] ||= []
+Settings.gitlab['no_todos_messages'] ||= YAML.load_file(Rails.root.join('config', 'no_todos_messages.yml'))
#
# CI
diff --git a/config/no_todos_messages.yml b/config/no_todos_messages.yml
new file mode 100644
index 00000000000..8372fb4ebe9
--- /dev/null
+++ b/config/no_todos_messages.yml
@@ -0,0 +1,13 @@
+# When the Todos list on the user's dashboard becomes empty, one of the messages below shows up randomly.
+#
+# If you come up with a fun one, please feel free to contribute it to GitLab!
+# https://about.gitlab.com/contributing/
+
+---
+- Good job! Looks like you don't have any todos left.
+- Coffee really tastes better without any todos left.
+- Isn't an empty To Do list beautiful?
+- Time for a rewarding coffee break
+- Give yourself a pat on the back!
+- High five!
+- Hence forth you shall be known as 'Todo Destroyer' \ No newline at end of file
diff --git a/spec/features/todos/todos_spec.rb b/spec/features/todos/todos_spec.rb
index 3ae83ac082d..88eabea7e3a 100644
--- a/spec/features/todos/todos_spec.rb
+++ b/spec/features/todos/todos_spec.rb
@@ -44,7 +44,7 @@ describe 'Dashboard Todos', feature: true do
end
it 'shows "All done" message' do
- expect(page).to have_content("Good job! Looks like you don't have any todos left.")
+ expect(page).to have_selector('.todos-all-done', count: 1)
end
end
@@ -64,7 +64,7 @@ describe 'Dashboard Todos', feature: true do
end
it 'shows "All done" message' do
- expect(page).to have_content("Good job! Looks like you don't have any todos left.")
+ expect(page).to have_selector('.todos-all-done', count: 1)
end
end
end
@@ -152,7 +152,7 @@ describe 'Dashboard Todos', feature: true do
within('.todos-pending-count') { expect(page).to have_content '0' }
expect(page).to have_content 'To do 0'
expect(page).to have_content 'Done 0'
- expect(page).to have_content "Good job! Looks like you don't have any todos left."
+ expect(page).to have_selector('.todos-all-done', count: 1)
end
end
end