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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
47881254
Commit
47881254
authored
May 12, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved json parsing out of service
[ci skip]
parent
3d553954
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
app/assets/javascripts/issue_show/components/app.vue
app/assets/javascripts/issue_show/components/app.vue
+1
-0
app/assets/javascripts/issue_show/services/index.js
app/assets/javascripts/issue_show/services/index.js
+2
-4
spec/javascripts/issue_show/components/app_spec.js
spec/javascripts/issue_show/components/app_spec.js
+6
-2
No files found.
app/assets/javascripts/issue_show/components/app.vue
View file @
47881254
...
@@ -77,6 +77,7 @@ export default {
...
@@ -77,6 +77,7 @@ export default {
},
},
deleteIssuable
()
{
deleteIssuable
()
{
this
.
service
.
deleteIssuable
()
this
.
service
.
deleteIssuable
()
.
then
(
res
=>
res
.
json
())
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
// Stop the poll so we don't get 404's with the issue not existing
// Stop the poll so we don't get 404's with the issue not existing
this
.
poll
.
stop
();
this
.
poll
.
stop
();
...
...
app/assets/javascripts/issue_show/services/index.js
View file @
47881254
...
@@ -20,12 +20,10 @@ export default class Service {
...
@@ -20,12 +20,10 @@ export default class Service {
}
}
deleteIssuable
()
{
deleteIssuable
()
{
return
this
.
resource
.
delete
()
return
this
.
resource
.
delete
();
.
then
(
res
=>
res
.
json
());
}
}
updateIssuable
(
data
)
{
updateIssuable
(
data
)
{
return
this
.
resource
.
update
(
data
)
return
this
.
resource
.
update
(
data
);
.
then
(
res
=>
res
.
json
());
}
}
}
}
spec/javascripts/issue_show/components/app_spec.js
View file @
47881254
...
@@ -134,7 +134,9 @@ describe('Issuable output', () => {
...
@@ -134,7 +134,9 @@ describe('Issuable output', () => {
spyOn
(
gl
.
utils
,
'
visitUrl
'
);
spyOn
(
gl
.
utils
,
'
visitUrl
'
);
spyOn
(
vm
.
service
,
'
deleteIssuable
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
)
=>
{
spyOn
(
vm
.
service
,
'
deleteIssuable
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
)
=>
{
resolve
({
resolve
({
path
:
'
/test
'
,
json
()
{
return
{
path
:
'
/test
'
};
},
});
});
}));
}));
...
@@ -154,7 +156,9 @@ describe('Issuable output', () => {
...
@@ -154,7 +156,9 @@ describe('Issuable output', () => {
spyOn
(
vm
.
poll
,
'
stop
'
);
spyOn
(
vm
.
poll
,
'
stop
'
);
spyOn
(
vm
.
service
,
'
deleteIssuable
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
)
=>
{
spyOn
(
vm
.
service
,
'
deleteIssuable
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
)
=>
{
resolve
({
resolve
({
path
:
'
/test
'
,
json
()
{
return
{
path
:
'
/test
'
};
},
});
});
}));
}));
...
...
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