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
e74df4c3
Commit
e74df4c3
authored
Sep 11, 2020
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select todo count with js-todos-count everywhere
parent
22daea99
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
app/assets/javascripts/alert_management/components/sidebar/sidebar_todo.vue
...ipts/alert_management/components/sidebar/sidebar_todo.vue
+1
-1
app/assets/javascripts/header.js
app/assets/javascripts/header.js
+1
-1
spec/frontend/header_spec.js
spec/frontend/header_spec.js
+1
-1
No files found.
app/assets/javascripts/alert_management/components/sidebar/sidebar_todo.vue
View file @
e74df4c3
...
@@ -52,7 +52,7 @@ export default {
...
@@ -52,7 +52,7 @@ export default {
},
},
methods
:
{
methods
:
{
updateToDoCount
(
add
)
{
updateToDoCount
(
add
)
{
const
oldCount
=
parseInt
(
document
.
querySelector
(
'
.todos-count
'
).
innerText
,
10
);
const
oldCount
=
parseInt
(
document
.
querySelector
(
'
.
js-
todos-count
'
).
innerText
,
10
);
const
count
=
add
?
oldCount
+
1
:
oldCount
-
1
;
const
count
=
add
?
oldCount
+
1
:
oldCount
-
1
;
const
headerTodoEvent
=
new
CustomEvent
(
'
todo:toggle
'
,
{
const
headerTodoEvent
=
new
CustomEvent
(
'
todo:toggle
'
,
{
detail
:
{
detail
:
{
...
...
app/assets/javascripts/header.js
View file @
e74df4c3
...
@@ -14,7 +14,7 @@ import Tracking from '~/tracking';
...
@@ -14,7 +14,7 @@ import Tracking from '~/tracking';
export
default
function
initTodoToggle
()
{
export
default
function
initTodoToggle
()
{
$
(
document
).
on
(
'
todo:toggle
'
,
(
e
,
count
)
=>
{
$
(
document
).
on
(
'
todo:toggle
'
,
(
e
,
count
)
=>
{
const
updatedCount
=
count
||
e
?.
detail
?.
count
||
0
;
const
updatedCount
=
count
||
e
?.
detail
?.
count
||
0
;
const
$todoPendingCount
=
$
(
'
.todos-count
'
);
const
$todoPendingCount
=
$
(
'
.
js-
todos-count
'
);
$todoPendingCount
.
text
(
highCountTrim
(
updatedCount
));
$todoPendingCount
.
text
(
highCountTrim
(
updatedCount
));
$todoPendingCount
.
toggleClass
(
'
hidden
'
,
updatedCount
===
0
);
$todoPendingCount
.
toggleClass
(
'
hidden
'
,
updatedCount
===
0
);
...
...
spec/frontend/header_spec.js
View file @
e74df4c3
...
@@ -4,7 +4,7 @@ import initTodoToggle, { initNavUserDropdownTracking } from '~/header';
...
@@ -4,7 +4,7 @@ import initTodoToggle, { initNavUserDropdownTracking } from '~/header';
describe
(
'
Header
'
,
()
=>
{
describe
(
'
Header
'
,
()
=>
{
describe
(
'
Todos notification
'
,
()
=>
{
describe
(
'
Todos notification
'
,
()
=>
{
const
todosPendingCount
=
'
.todos-count
'
;
const
todosPendingCount
=
'
.
js-
todos-count
'
;
const
fixtureTemplate
=
'
issues/open-issue.html
'
;
const
fixtureTemplate
=
'
issues/open-issue.html
'
;
function
isTodosCountHidden
()
{
function
isTodosCountHidden
()
{
...
...
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