BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
39fa8355
Unverified
Commit
39fa8355
authored
Feb 02, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed unhandled promise rejection
parent
10cc5d1a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
right_sidebar.js
app/assets/javascripts/right_sidebar.js
+2
-2
right_sidebar_spec.js
spec/javascripts/right_sidebar_spec.js
+1
-2
No files found.
app/assets/javascripts/right_sidebar.js
View file @
39fa8355
...
...
@@ -75,12 +75,12 @@ Sidebar.prototype.toggleTodo = function(e) {
$
(
'.js-issuable-todo'
).
disable
().
addClass
(
'is-loading'
);
return
axios
[
ajaxType
](
url
,
{
axios
[
ajaxType
](
url
,
{
issuable_id
:
$this
.
data
(
'issuable-id'
),
issuable_type
:
$this
.
data
(
'issuable-type'
),
}).
then
(({
data
})
=>
{
this
.
todoUpdateDone
(
data
);
});
})
.
catch
(()
=>
flash
(
`There was an error
${
ajaxType
===
'post'
?
'adding a'
:
'deleting the'
}
todo.`
))
;
};
Sidebar
.
prototype
.
todoUpdateDone
=
function
(
data
)
{
...
...
spec/javascripts/right_sidebar_spec.js
View file @
39fa8355
...
...
@@ -74,8 +74,7 @@ import Sidebar from '~/right_sidebar';
it
(
'should broadcast todo:toggle event when add todo clicked'
,
function
(
done
)
{
var
todos
=
getJSONFixture
(
'todos/todos.json'
);
spyOn
(
axios
,
'get'
).
and
.
callThrough
();
mock
.
onAny
(
`
${
gl
.
TEST_HOST
}
/frontend-fixtures/issues-project/todos`
).
reply
(
200
,
todos
);
mock
.
onPost
(
/
(
.*
)\/
todos$/
).
reply
(
200
,
todos
);
var
todoToggleSpy
=
spyOnEvent
(
document
,
'todo:toggle'
);
...
...
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