Set flash message after conflict is resolved

This commit is contained in:
Sean McGivern 2016-08-04 14:56:54 +01:00 committed by Fatih Acet
parent 46f8e6421a
commit f322c30274
3 changed files with 12 additions and 3 deletions

View file

@ -59,8 +59,8 @@ window.MergeConflictResolver = class MergeConflictResolver {
commit() {
$.post('./resolve_conflicts', this.dataProvider.getCommitData())
.always( (data) => {
console.log(data)
.then( (data) => {
window.location.href = data.redirect_to
})
}

View file

@ -151,7 +151,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
begin
MergeRequests::ResolveService.new(project, current_user, params).execute(@merge_request)
head :ok
flash[:conflicts_message] = 'Merge conflicts resolved.'
flash.keep
render json: { redirect_to: namespace_project_merge_request_url(@project.namespace, @project, @merge_request) }
rescue Gitlab::Conflict::File::MissingResolution => e
render status: :bad_request, json: { message: e.message }
end

View file

@ -42,3 +42,9 @@
.ci_widget.ci-error{style: "display:none"}
= icon("times-circle")
Could not connect to the CI server. Please check your settings and try again.
- if flash[:conflicts_message]
.mr-widget-heading
.ci_widget
= ci_icon_for_status('success')
= flash[:conflicts_message]