keep branch being merged, MR title and MR reference in merge commit message when using description
This commit is contained in:
parent
00a842eacc
commit
1a72dc2486
1 changed files with 8 additions and 2 deletions
|
@ -27,15 +27,21 @@
|
||||||
$('.use-description-link').on('click', function(e) {
|
$('.use-description-link').on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
var message = "Merge branch '#{j @merge_request.source_branch}' into '#{j @merge_request.target_branch}'\n\n"
|
||||||
|
message = message + "#{j @merge_request.title}\n\n"
|
||||||
|
message = message + "#{j local_assigns[:description]}\n\n";
|
||||||
|
message = message + "See merge request #{j @merge_request.to_reference}"
|
||||||
|
|
||||||
|
|
||||||
$('.use-description-hint').hide();
|
$('.use-description-hint').hide();
|
||||||
$('.use-default-message-hint').show();
|
$('.use-default-message-hint').show();
|
||||||
$('.js-commit-message').val("#{escape_javascript local_assigns[:description]}");
|
$('.js-commit-message').val(message)
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.use-default-message-link').on('click', function(e) {
|
$('.use-default-message-link').on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
var defaultMessage = "#{escape_javascript (params[:commit_message] || local_assigns[:text] || local_assigns[:placeholder])}";
|
var defaultMessage = "#{j (params[:commit_message] || local_assigns[:text] || local_assigns[:placeholder])}";
|
||||||
|
|
||||||
$('.use-description-hint').show();
|
$('.use-description-hint').show();
|
||||||
$('.use-default-message-hint').hide();
|
$('.use-default-message-hint').hide();
|
||||||
|
|
Loading…
Reference in a new issue