Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0803a350
Commit
0803a350
authored
Oct 12, 2016
by
Josep Llaneras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #13823: random message when all Todos are Done
parent
0e1e4288
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
4 deletions
+37
-4
CHANGELOG.md
CHANGELOG.md
+1
-0
app/controllers/dashboard/todos_controller.rb
app/controllers/dashboard/todos_controller.rb
+4
-0
app/helpers/todos_helper.rb
app/helpers/todos_helper.rb
+11
-0
app/views/dashboard/todos/index.html.haml
app/views/dashboard/todos/index.html.haml
+1
-1
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-0
config/no_todos_messages.yml
config/no_todos_messages.yml
+16
-0
spec/features/todos/todos_spec.rb
spec/features/todos/todos_spec.rb
+3
-3
No files found.
CHANGELOG.md
View file @
0803a350
...
...
@@ -55,6 +55,7 @@ entry.
-
Remove 'Edit' button from wiki edit view !7143 (Hiroyuki Sato)
-
Cleaned up global namespace JS !19661 (Jose Ivan Vargas)
-
Refactor Jira service to use jira-ruby gem
-
Show random messages when the To Do list is empty. !13823 (jllaneras)
-
Improved todos empty state
-
Add hover to trash icon in notes !7008 (blackst0ne)
-
Hides project activity tabs when features are disabled
...
...
app/controllers/dashboard/todos_controller.rb
View file @
0803a350
...
...
@@ -4,6 +4,10 @@ class Dashboard::TodosController < Dashboard::ApplicationController
def
index
@sort
=
params
[
:sort
]
@todos
=
@todos
.
page
(
params
[
:page
])
if
@todos
.
empty?
&&
current_user
.
todos
.
any?
@no_todos_message
=
Gitlab
.
config
.
gitlab
.
no_todos_messages
.
sample
end
end
def
destroy
...
...
app/helpers/todos_helper.rb
View file @
0803a350
...
...
@@ -138,9 +138,20 @@ module TodosHelper
end
end
def
no_todos_message
message
,
author
=
@no_todos_message
.
values_at
(
'message'
,
'author'
)
if
author
message
+=
" -- "
+
author
end
message
end
private
def
show_todo_state?
(
todo
)
(
todo
.
target
.
is_a?
(
MergeRequest
)
||
todo
.
target
.
is_a?
(
Issue
))
&&
[
'closed'
,
'merged'
].
include?
(
todo
.
target
.
state
)
end
end
app/views/dashboard/todos/index.html.haml
View file @
0803a350
...
...
@@ -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.
=
no_todos_message
%p
.text-center
Are you looking for things to do? Take a look at
=
succeed
","
do
...
...
config/initializers/1_settings.rb
View file @
0803a350
...
...
@@ -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
...
...
config/no_todos_messages.yml
0 → 100644
View file @
0803a350
# When the Todos list on the user's dashboard is 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/
---
-
message
:
"
Good
job!
Looks
like
you
don't
have
any
todos
left."
-
message
:
"
You're
all
done!"
-
message
:
"
Coffee
really
tastes
better
without
any
todos
left."
author
:
"
Josep
Llaneras"
-
message
:
"
Isn't
an
empty
To
Do
list
beautiful?"
author
:
"
Josep
Llaneras"
spec/features/todos/todos_spec.rb
View file @
0803a350
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment