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