Commit 4d7c2014 authored by Douwe Maan's avatar Douwe Maan Committed by Fatih Acet

Don’t hardcode paths

parent add01596
...@@ -45,7 +45,7 @@ window.MergeConflictResolver = class MergeConflictResolver { ...@@ -45,7 +45,7 @@ window.MergeConflictResolver = class MergeConflictResolver {
fetchData() { fetchData() {
const dp = this.dataProvider; const dp = this.dataProvider;
$.get('./conflicts.json') $.get($('#conflicts').data('conflictsPath'))
.done((data) => { .done((data) => {
dp.decorateData(this.vue, data); dp.decorateData(this.vue, data);
}) })
...@@ -69,7 +69,7 @@ window.MergeConflictResolver = class MergeConflictResolver { ...@@ -69,7 +69,7 @@ window.MergeConflictResolver = class MergeConflictResolver {
commit() { commit() {
this.vue.isSubmitting = true; this.vue.isSubmitting = true;
$.post('./resolve_conflicts', this.dataProvider.getCommitData()) $.post($('#conflicts').data('resolveConflictsPath'), this.dataProvider.getCommitData())
.done((data) => { .done((data) => {
window.location.href = data.redirect_to; window.location.href = data.redirect_to;
}) })
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
= render 'shared/issuable/sidebar', issuable: @merge_request = render 'shared/issuable/sidebar', issuable: @merge_request
#conflicts{"v-cloak" => "true"} #conflicts{"v-cloak" => "true", data: { conflicts_path: conflicts_namespace_project_merge_request_path(@merge_request.project.namespace, @merge_request.project, @merge_request, format: :json),
resolve_conflicts_path: resolve_conflicts_namespace_project_merge_request_path(@merge_request.project.namespace, @merge_request.project, @merge_request) } }
.loading{"v-if" => "isLoading"} .loading{"v-if" => "isLoading"}
%i.fa.fa-spinner.fa-spin %i.fa.fa-spinner.fa-spin
......
...@@ -13,6 +13,4 @@ ...@@ -13,6 +13,4 @@
%span Commit conflict resolution %span Commit conflict resolution
%a.fa.fa-spin.fa-spinner{":class" => "{'hidden': !isSubmitting}"} %a.fa.fa-spin.fa-spinner{":class" => "{'hidden': !isSubmitting}"}
/ FIXME: Hardcoded path = link_to "Cancel", namespace_project_merge_request_path(@merge_request.project.namespace, @merge_request.project, @merge_request), class: "btn btn-cancel"
%a.btn.btn-cancel{"href" => "diffs"}
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