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
bc309027
Commit
bc309027
authored
Dec 22, 2021
by
Martin Wortschack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Todos: Replaces badge selector with a js- prefixed class
parent
dc0c0860
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
app/assets/javascripts/pages/dashboard/todos/index/todos.js
app/assets/javascripts/pages/dashboard/todos/index/todos.js
+6
-2
app/views/dashboard/todos/index.html.haml
app/views/dashboard/todos/index.html.haml
+2
-2
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 @
bc309027
...
...
@@ -172,8 +172,12 @@ export default class Todos {
updateBadges
(
data
)
{
$
(
document
).
trigger
(
'
todo:toggle
'
,
data
.
count
);
document
.
querySelector
(
'
.js-todos-pending .badge
'
).
innerHTML
=
addDelimiter
(
data
.
count
);
document
.
querySelector
(
'
.js-todos-done .badge
'
).
innerHTML
=
addDelimiter
(
data
.
done_count
);
document
.
querySelector
(
'
.js-todos-pending .js-todos-badge
'
).
innerHTML
=
addDelimiter
(
data
.
count
,
);
document
.
querySelector
(
'
.js-todos-done .js-todos-badge
'
).
innerHTML
=
addDelimiter
(
data
.
done_count
,
);
}
goToTodoUrl
(
e
)
{
...
...
app/views/dashboard/todos/index.html.haml
View file @
bc309027
...
...
@@ -13,10 +13,10 @@
=
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_counter_badge
(
number_with_delimiter
(
todos_pending_count
),
{
class:
'js-todos-badge'
}
)
=
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
)
=
gl_tab_counter_badge
(
number_with_delimiter
(
todos_done_count
),
{
class:
'js-todos-badge'
}
)
.nav-controls
-
if
@allowed_todos
.
any?
(
&
:pending?
)
...
...
spec/frontend/pages/dashboard/todos/index/todos_spec.js
View file @
bc309027
...
...
@@ -94,13 +94,13 @@ describe('Todos', () => {
});
it
(
'
updates pending text
'
,
()
=>
{
expect
(
document
.
querySelector
(
'
.js-todos-pending .badge
'
).
innerHTML
).
toEqual
(
expect
(
document
.
querySelector
(
'
.js-todos-pending .
js-todos-
badge
'
).
innerHTML
).
toEqual
(
addDelimiter
(
TEST_COUNT_BIG
),
);
});
it
(
'
updates done text
'
,
()
=>
{
expect
(
document
.
querySelector
(
'
.js-todos-done .badge
'
).
innerHTML
).
toEqual
(
expect
(
document
.
querySelector
(
'
.js-todos-done .
js-todos-
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