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
Léo-Paul Géneau
gitlab-ce
Commits
8750507b
Commit
8750507b
authored
Jan 30, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert merge_conflict_service.js to axios
parent
05a3479c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
21 deletions
+11
-21
app/assets/javascripts/merge_conflicts/merge_conflict_service.js
...ets/javascripts/merge_conflicts/merge_conflict_service.js
+3
-11
app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
...ets/javascripts/merge_conflicts/merge_conflicts_bundle.js
+8
-10
No files found.
app/assets/javascripts/merge_conflicts/merge_conflict_service.js
View file @
8750507b
/* eslint-disable no-param-reassign, comma-dangle */
import
axios
from
'
../lib/utils/axios_utils
'
;
((
global
)
=>
{
global
.
mergeConflicts
=
global
.
mergeConflicts
||
{};
...
...
@@ -10,20 +11,11 @@
}
fetchConflictsData
()
{
return
$
.
ajax
({
dataType
:
'
json
'
,
url
:
this
.
conflictsPath
});
return
axios
.
get
(
this
.
conflictsPath
);
}
submitResolveConflicts
(
data
)
{
return
$
.
ajax
({
url
:
this
.
resolveConflictsPath
,
data
:
JSON
.
stringify
(
data
),
contentType
:
'
application/json
'
,
dataType
:
'
json
'
,
method
:
'
POST
'
});
return
axios
.
post
(
this
.
resolveConflictsPath
,
data
);
}
}
...
...
app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
View file @
8750507b
...
...
@@ -38,24 +38,22 @@ $(() => {
showDiffViewTypeSwitcher
()
{
return
mergeConflictsStore
.
fileTextTypePresent
();
}
},
created
()
{
mergeConflictsService
.
fetchConflictsData
()
.
done
((
data
)
=>
{
mergeConflictsService
.
fetchConflictsData
()
.
then
(({
data
})
=>
{
if
(
data
.
type
===
'
error
'
)
{
mergeConflictsStore
.
setFailedRequest
(
data
.
message
);
}
else
{
mergeConflictsStore
.
setConflictsData
(
data
);
}
})
.
error
(()
=>
{
mergeConflictsStore
.
setFailedRequest
();
})
.
always
(()
=>
{
mergeConflictsStore
.
setLoadingState
(
false
);
this
.
$nextTick
(()
=>
{
syntaxHighlight
(
$
(
'
.js-syntax-highlight
'
));
});
})
.
catch
(()
=>
{
mergeConflictsStore
.
setFailedRequest
();
});
},
methods
:
{
...
...
@@ -82,10 +80,10 @@ $(() => {
mergeConflictsService
.
submitResolveConflicts
(
mergeConflictsStore
.
getCommitData
())
.
done
((
data
)
=>
{
.
then
(({
data
}
)
=>
{
window
.
location
.
href
=
data
.
redirect_to
;
})
.
error
(()
=>
{
.
catch
(()
=>
{
mergeConflictsStore
.
setSubmitState
(
false
);
new
Flash
(
'
Failed to save merge conflicts resolutions. Please try again!
'
);
});
...
...
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