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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
41f7cee9
Commit
41f7cee9
authored
Aug 08, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show loading button while Ajax request is in progress.
parent
b79378ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
18 deletions
+35
-18
app/assets/javascripts/merge_conflict_data_provider.js.es6
app/assets/javascripts/merge_conflict_data_provider.js.es6
+4
-2
app/assets/javascripts/merge_conflict_resolver.js.es6
app/assets/javascripts/merge_conflict_resolver.js.es6
+21
-12
app/assets/stylesheets/pages/merge_conflicts.scss
app/assets/stylesheets/pages/merge_conflicts.scss
+4
-0
app/views/projects/merge_requests/conflicts.html.haml
app/views/projects/merge_requests/conflicts.html.haml
+6
-4
No files found.
app/assets/javascripts/merge_conflict_data_provider.js.es6
View file @
41f7cee9
...
@@ -11,6 +11,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
...
@@ -11,6 +11,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
hasError : false,
hasError : false,
isParallel : diffViewType === 'parallel',
isParallel : diffViewType === 'parallel',
diffViewType : diffViewType,
diffViewType : diffViewType,
isSubmitting : false,
conflictsData : {},
conflictsData : {},
resolutionData : {}
resolutionData : {}
}
}
...
@@ -18,7 +19,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
...
@@ -18,7 +19,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
decorateData(vueInstance, data) {
decorateData(vueInstance, data) {
this.vueInstance
= vueInstance;
this.vueInstance = vueInstance;
if (data.type === 'error') {
if (data.type === 'error') {
vueInstance.hasError = true;
vueInstance.hasError = true;
...
@@ -34,6 +35,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
...
@@ -34,6 +35,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
}
}
vueInstance.conflictsData = data;
vueInstance.conflictsData = data;
vueInstance.isSubmitting = false;
}
}
...
@@ -233,7 +235,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
...
@@ -233,7 +235,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
isAllResolved() {
isAllResolved() {
return this.getConflictsCount() === this.getResolvedCount();
return
!this.vueInstance.isSubmitting &&
this.getConflictsCount() === this.getResolvedCount();
}
}
...
...
app/assets/javascripts/merge_conflict_resolver.js.es6
View file @
41f7cee9
...
@@ -31,6 +31,17 @@ window.MergeConflictResolver = class MergeConflictResolver {
...
@@ -31,6 +31,17 @@ window.MergeConflictResolver = class MergeConflictResolver {
}
}
setComputedProperties() {
const dp = this.dataProvider;
return {
conflictsCount() { return dp.getConflictsCount() },
resolvedCount() { return dp.getResolvedCount() },
allResolved() { return dp.isAllResolved() }
}
}
fetchData() {
fetchData() {
const dp = this.dataProvider;
const dp = this.dataProvider;
...
@@ -47,21 +58,19 @@ window.MergeConflictResolver = class MergeConflictResolver {
...
@@ -47,21 +58,19 @@ window.MergeConflictResolver = class MergeConflictResolver {
}
}
setComputedProperties() {
const dp = this.dataProvider;
return {
conflictsCount() { return dp.getConflictsCount() },
resolvedCount() { return dp.getResolvedCount() },
allResolved() { return dp.isAllResolved() }
}
}
commit() {
commit() {
this.vue.isSubmitting = true;
$.post('./resolve_conflicts', this.dataProvider.getCommitData())
$.post('./resolve_conflicts', this.dataProvider.getCommitData())
.then( (data) => {
.done( (data) => {
window.location.href = data.redirect_to
window.location.href = data.redirect_to;
})
.error(() => {
new Flash('Something went wrong!');
})
})
.always(() => {
this.vue.isSubmitting = false;
});
}
}
}
}
app/assets/stylesheets/pages/merge_conflicts.scss
View file @
41f7cee9
...
@@ -137,4 +137,8 @@ $unselected_line: #f8f8f8;
...
@@ -137,4 +137,8 @@ $unselected_line: #f8f8f8;
outline
:
none
;
outline
:
none
;
}
}
}
}
.btn-success
.fa-spinner
{
color
:
#FFF
;
}
}
}
app/views/projects/merge_requests/conflicts.html.haml
View file @
41f7cee9
...
@@ -126,8 +126,10 @@
...
@@ -126,8 +126,10 @@
%textarea
.form-control.js-commit-message
{
":disabled"
=>
"!allResolved"
,
"v-model"
=>
"conflictsData.commitMessage"
}
%textarea
.form-control.js-commit-message
{
":disabled"
=>
"!allResolved"
,
"v-model"
=>
"conflictsData.commitMessage"
}
{{{conflictsData.commitMessage}}}
{{{conflictsData.commitMessage}}}
%button
{
type:
'button'
,
class:
'btn btn-success js-submit-button'
,
":disabled"
=>
"!allResolved"
,
"@click"
=>
"commit()"
}
%button
{
type:
"button"
,
class:
"btn btn-success js-submit-button"
,
":disabled"
=>
"!allResolved"
,
"@click"
=>
"commit()"
}
Commit conflict resolution
%span
Commit conflict resolution
%a
.fa.fa-spin.fa-spinner
{
":class"
=>
"{'hidden': !isSubmitting}"
}
/ %button{type: 'button', class: 'btn btn-cancel'}
/ FIXME: Hardcoded path
/ Cancel
%a
.btn.btn-cancel
{
"href"
=>
"diffs"
}
Cancel
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