Commit 8b6a075e authored by Fatih Acet's avatar Fatih Acet

Implement commit in merge conflicts UI.

parent c2295fbd
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment