Commit 2bc956cf authored by Phil Hughes's avatar Phil Hughes

Fixed merge request environment not displaying

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/27080
parent 70a17615
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
// ci_status_url - String, URL to use to check CI status // ci_status_url - String, URL to use to check CI status
// //
this.opts = opts; this.opts = opts;
this.$widgetBody = $('.mr-widget-body');
$('#modal_merge_info').modal({ $('#modal_merge_info').modal({
show: false show: false
}); });
...@@ -106,7 +105,7 @@ ...@@ -106,7 +105,7 @@
urlSuffix = deleteSourceBranch ? '?deleted_source_branch=true' : ''; urlSuffix = deleteSourceBranch ? '?deleted_source_branch=true' : '';
return window.location.href = window.location.pathname + urlSuffix; return window.location.href = window.location.pathname + urlSuffix;
} else if (data.merge_error) { } else if (data.merge_error) {
return _this.$widgetBody.html("<h4>" + data.merge_error + "</h4>"); return $('.mr-widget-body').html("<h4>" + data.merge_error + "</h4>");
} else { } else {
callback = function() { callback = function() {
return merge_request_widget.mergeInProgress(deleteSourceBranch); return merge_request_widget.mergeInProgress(deleteSourceBranch);
...@@ -226,7 +225,7 @@ ...@@ -226,7 +225,7 @@
environment.ci_success_icon = this.$ciSuccessIcon; environment.ci_success_icon = this.$ciSuccessIcon;
const templateString = _.unescape($template[0].outerHTML); const templateString = _.unescape($template[0].outerHTML);
const template = _.template(templateString)(environment); const template = _.template(templateString)(environment);
this.$widgetBody.before(template); $('.mr-widget-body').before(template);
} }
}; };
......
---
title: Fixed merge request environment link not displaying
merge_request:
author:
require 'spec_helper'
feature 'Merge request environments', :feature, :js do
include WaitForAjax
it 'shows environments link' do
project = create(:project)
merge_request = create(:merge_request, source_project: project)
environment = create(:environment, project: project)
create(:deployment, environment: environment, ref: 'feature', sha: merge_request.diff_head_sha)
login_as :admin
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
wait_for_ajax
page.within('.mr-widget-heading') do
expect(page).to have_content("Deployed to #{environment.name}")
expect(find('.js-environment-link')[:href]).to include(environment.formatted_external_url)
end
end
end
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