Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
9c7a4fba4f9c
Commit
513151a5
authored
Oct 04, 2018
by
Marcos Barrera
Committed by
Phil Hughes
Oct 04, 2018
Browse files
Resolve "Error while updating todo status: the button is stuck in the loading state"
parent
4eccbed463c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/pages/dashboard/todos/index/todos.js
View file @
9c7a4fba
...
...
@@ -79,10 +79,13 @@ export default class Todos {
.
then
(({
data
})
=>
{
this
.
updateRowState
(
target
);
this
.
updateBadges
(
data
);
}).
catch
(()
=>
flash
(
__
(
'
Error updating todo status.
'
)));
}).
catch
(()
=>
{
this
.
updateRowState
(
target
,
true
);
return
flash
(
__
(
'
Error updating todo status.
'
));
});
}
updateRowState
(
target
)
{
updateRowState
(
target
,
isInactive
=
false
)
{
const
row
=
target
.
closest
(
'
li
'
);
const
restoreBtn
=
row
.
querySelector
(
'
.js-undo-todo
'
);
const
doneBtn
=
row
.
querySelector
(
'
.js-done-todo
'
);
...
...
@@ -91,7 +94,10 @@ export default class Todos {
target
.
removeAttribute
(
'
disabled
'
);
target
.
classList
.
remove
(
'
disabled
'
);
if
(
target
===
doneBtn
)
{
if
(
isInactive
===
true
)
{
restoreBtn
.
classList
.
add
(
'
hidden
'
);
doneBtn
.
classList
.
remove
(
'
hidden
'
);
}
else
if
(
target
===
doneBtn
)
{
row
.
classList
.
add
(
'
done-reversible
'
);
restoreBtn
.
classList
.
remove
(
'
hidden
'
);
}
else
if
(
target
===
restoreBtn
)
{
...
...
changelogs/unreleased/48222-fix-todos-status-button.yml
0 → 100644
View file @
9c7a4fba
---
title
:
Fix the state of the Done button when there is an error in the GitLab Todos
section
merge_request
:
author
:
marcos8896
type
:
fixed
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