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
Show 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 */
/* eslint-disable no-param-reassign, comma-dangle */
import
axios
from
'
../lib/utils/axios_utils
'
;
((
global
)
=>
{
((
global
)
=>
{
global
.
mergeConflicts
=
global
.
mergeConflicts
||
{};
global
.
mergeConflicts
=
global
.
mergeConflicts
||
{};
...
@@ -10,20 +11,11 @@
...
@@ -10,20 +11,11 @@
}
}
fetchConflictsData
()
{
fetchConflictsData
()
{
return
$
.
ajax
({
return
axios
.
get
(
this
.
conflictsPath
);
dataType
:
'
json
'
,
url
:
this
.
conflictsPath
});
}
}
submitResolveConflicts
(
data
)
{
submitResolveConflicts
(
data
)
{
return
$
.
ajax
({
return
axios
.
post
(
this
.
resolveConflictsPath
,
data
);
url
:
this
.
resolveConflictsPath
,
data
:
JSON
.
stringify
(
data
),
contentType
:
'
application/json
'
,
dataType
:
'
json
'
,
method
:
'
POST
'
});
}
}
}
}
...
...
app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js
View file @
8750507b
...
@@ -38,24 +38,22 @@ $(() => {
...
@@ -38,24 +38,22 @@ $(() => {
showDiffViewTypeSwitcher
()
{
return
mergeConflictsStore
.
fileTextTypePresent
();
}
showDiffViewTypeSwitcher
()
{
return
mergeConflictsStore
.
fileTextTypePresent
();
}
},
},
created
()
{
created
()
{
mergeConflictsService
mergeConflictsService
.
fetchConflictsData
()
.
fetchConflictsData
()
.
then
(({
data
})
=>
{
.
done
((
data
)
=>
{
if
(
data
.
type
===
'
error
'
)
{
if
(
data
.
type
===
'
error
'
)
{
mergeConflictsStore
.
setFailedRequest
(
data
.
message
);
mergeConflictsStore
.
setFailedRequest
(
data
.
message
);
}
else
{
}
else
{
mergeConflictsStore
.
setConflictsData
(
data
);
mergeConflictsStore
.
setConflictsData
(
data
);
}
}
})
.
error
(()
=>
{
mergeConflictsStore
.
setFailedRequest
();
})
.
always
(()
=>
{
mergeConflictsStore
.
setLoadingState
(
false
);
mergeConflictsStore
.
setLoadingState
(
false
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
syntaxHighlight
(
$
(
'
.js-syntax-highlight
'
));
syntaxHighlight
(
$
(
'
.js-syntax-highlight
'
));
});
});
})
.
catch
(()
=>
{
mergeConflictsStore
.
setFailedRequest
();
});
});
},
},
methods
:
{
methods
:
{
...
@@ -82,10 +80,10 @@ $(() => {
...
@@ -82,10 +80,10 @@ $(() => {
mergeConflictsService
mergeConflictsService
.
submitResolveConflicts
(
mergeConflictsStore
.
getCommitData
())
.
submitResolveConflicts
(
mergeConflictsStore
.
getCommitData
())
.
done
((
data
)
=>
{
.
then
(({
data
}
)
=>
{
window
.
location
.
href
=
data
.
redirect_to
;
window
.
location
.
href
=
data
.
redirect_to
;
})
})
.
error
(()
=>
{
.
catch
(()
=>
{
mergeConflictsStore
.
setSubmitState
(
false
);
mergeConflictsStore
.
setSubmitState
(
false
);
new
Flash
(
'
Failed to save merge conflicts resolutions. Please try again!
'
);
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