Implement commit in merge conflicts UI.
This commit is contained in:
parent
c2295fbdf8
commit
8b6a075e6f
4 changed files with 25 additions and 6 deletions
|
@ -26,7 +26,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
|
|||
}
|
||||
else {
|
||||
data.shortCommitSha = data.commit_sha.slice(0, 7);
|
||||
data.commitMesage = data.commit_message;
|
||||
data.commitMessage = data.commit_message;
|
||||
|
||||
this.setParallelLines(data);
|
||||
this.setInlineLines(data);
|
||||
|
@ -284,4 +284,12 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
|
|||
vueInstance.conflictsData.errorMessage = 'Something went wrong!';
|
||||
}
|
||||
|
||||
|
||||
getCommitData() {
|
||||
return {
|
||||
commitMessage: this.vueInstance.conflictsData.commitMessage,
|
||||
sections: this.vueInstance.resolutionData
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,9 @@ window.MergeConflictResolver = class MergeConflictResolver {
|
|||
},
|
||||
handleViewTypeChange(newType) {
|
||||
that.dataProvider.updateViewType(newType);
|
||||
},
|
||||
commit() {
|
||||
that.commit();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -54,4 +57,11 @@ window.MergeConflictResolver = class MergeConflictResolver {
|
|||
}
|
||||
}
|
||||
|
||||
commit() {
|
||||
$.post('./resolve_conflicts', this.dataProvider.getCommitData())
|
||||
.always( (data) => {
|
||||
console.log(data)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
if (action === 'show') {
|
||||
action = 'notes';
|
||||
}
|
||||
new_state = this._location.pathname.replace(/\/(commits|diffs|builds|conflicts)(\.html)?\/?$/, '');
|
||||
new_state = this._location.pathname.replace(/\/(commits|diffs|builds)(\.html)?\/?$/, '');
|
||||
if (action !== 'notes') {
|
||||
new_state += "/" + action;
|
||||
}
|
||||
|
|
|
@ -107,10 +107,11 @@
|
|||
|
||||
.commit-message-container.form-group
|
||||
.max-width-marker
|
||||
%textarea.form-control.js-commit-message{":disabled" => "!allResolved"} {{{conflictsData.commitMessage}}}
|
||||
%textarea.form-control.js-commit-message{":disabled" => "!allResolved", "v-model" => "conflictsData.commitMessage"}
|
||||
{{{conflictsData.commitMessage}}}
|
||||
|
||||
%button{type: 'button', class: 'btn btn-success js-submit-button', ":disabled" => "!allResolved"}
|
||||
%button{type: 'button', class: 'btn btn-success js-submit-button', ":disabled" => "!allResolved", "@click" => "commit()"}
|
||||
Commit conflict resolution
|
||||
|
||||
%button{type: 'button', class: 'btn btn-cancel'}
|
||||
Cancel
|
||||
/ %button{type: 'button', class: 'btn btn-cancel'}
|
||||
/ Cancel
|
||||
|
|
Loading…
Reference in a new issue