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
60499082
Commit
60499082
authored
Nov 08, 2021
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate todo tabs to GlTabs
Update To-Do list page to use GlTab helpers, conforming to Pajamas.
parent
c7e9fbd3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
20 deletions
+14
-20
app/assets/javascripts/pages/dashboard/todos/index/todos.js
app/assets/javascripts/pages/dashboard/todos/index/todos.js
+4
-4
app/helpers/tab_helper.rb
app/helpers/tab_helper.rb
+1
-1
app/views/dashboard/todos/index.html.haml
app/views/dashboard/todos/index.html.haml
+7
-13
spec/frontend/pages/dashboard/todos/index/todos_spec.js
spec/frontend/pages/dashboard/todos/index/todos_spec.js
+2
-2
No files found.
app/assets/javascripts/pages/dashboard/todos/index/todos.js
View file @
60499082
/* eslint-disable class-methods-use-this
, no-unneeded-ternary
*/
/* eslint-disable class-methods-use-this */
import
$
from
'
jquery
'
;
import
{
getGroups
}
from
'
~/api/groups_api
'
;
...
...
@@ -78,7 +78,7 @@ export default class Todos {
initDeprecatedJQueryDropdown
(
$dropdown
,
{
fieldName
,
selectable
:
true
,
filterable
:
searchFields
?
true
:
false
,
filterable
:
Boolean
(
searchFields
)
,
search
:
{
fields
:
searchFields
},
data
:
$dropdown
.
data
(
'
data
'
),
clicked
:
()
=>
{
...
...
@@ -172,8 +172,8 @@ export default class Todos {
updateBadges
(
data
)
{
$
(
document
).
trigger
(
'
todo:toggle
'
,
data
.
count
);
document
.
querySelector
(
'
.todos-pending .badge
'
).
innerHTML
=
addDelimiter
(
data
.
count
);
document
.
querySelector
(
'
.todos-done .badge
'
).
innerHTML
=
addDelimiter
(
data
.
done_count
);
document
.
querySelector
(
'
.
js-
todos-pending .badge
'
).
innerHTML
=
addDelimiter
(
data
.
count
);
document
.
querySelector
(
'
.
js-
todos-done .badge
'
).
innerHTML
=
addDelimiter
(
data
.
done_count
);
}
goToTodoUrl
(
e
)
{
...
...
app/helpers/tab_helper.rb
View file @
60499082
...
...
@@ -216,4 +216,4 @@ def gl_tab_counter_badge(count)
count
,
class:
'badge badge-muted badge-pill gl-badge sm gl-tab-counter-badge'
)
end
\ No newline at end of file
end
app/views/dashboard/todos/index.html.haml
View file @
60499082
...
...
@@ -10,19 +10,13 @@
-
if
current_user
.
todos
.
any?
.top-area
%ul
.nav-links.mobile-separator.nav.nav-tabs
%li
.todos-pending
{
class:
active_when
(
params
[
:state
].
blank?
||
params
[
:state
]
==
'pending'
)
}
>
=
link_to
todos_filter_path
(
state:
'pending'
)
do
%span
To Do
%span
.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
=
number_with_delimiter
(
todos_pending_count
)
%li
.todos-done
{
class:
active_when
(
params
[
:state
]
==
'done'
)
}
>
=
link_to
todos_filter_path
(
state:
'done'
)
do
%span
Done
%span
.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm
=
number_with_delimiter
(
todos_done_count
)
=
gl_tabs_nav
({
class:
'gl-flex-grow-1 gl-border-0'
})
do
=
gl_tab_link_to
todos_filter_path
(
state:
'pending'
),
item_active:
params
[
:state
].
blank?
||
params
[
:state
]
==
'pending'
,
class:
"js-todos-pending"
do
=
_
(
"To Do"
)
=
gl_tab_counter_badge
number_with_delimiter
(
todos_pending_count
)
=
gl_tab_link_to
todos_filter_path
(
state:
'done'
),
item_active:
params
[
:state
]
==
'done'
,
class:
"js-todos-done"
do
=
_
(
"Done"
)
=
gl_tab_counter_badge
number_with_delimiter
(
todos_done_count
)
.nav-controls
-
if
@allowed_todos
.
any?
(
&
:pending?
)
...
...
spec/frontend/pages/dashboard/todos/index/todos_spec.js
View file @
60499082
...
...
@@ -94,13 +94,13 @@ describe('Todos', () => {
});
it
(
'
updates pending text
'
,
()
=>
{
expect
(
document
.
querySelector
(
'
.todos-pending .badge
'
).
innerHTML
).
toEqual
(
expect
(
document
.
querySelector
(
'
.
js-
todos-pending .badge
'
).
innerHTML
).
toEqual
(
addDelimiter
(
TEST_COUNT_BIG
),
);
});
it
(
'
updates done text
'
,
()
=>
{
expect
(
document
.
querySelector
(
'
.todos-done .badge
'
).
innerHTML
).
toEqual
(
expect
(
document
.
querySelector
(
'
.
js-
todos-done .badge
'
).
innerHTML
).
toEqual
(
addDelimiter
(
TEST_DONE_COUNT_BIG
),
);
});
...
...
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