pull-requests: make auto generated title for pull requests show also source Ref type .eg. branch feature1, instead of just name of the branch.

This commit is contained in:
Marcin Kuzminski 2020-07-09 11:14:21 +02:00
parent 217cb4defc
commit 7f1d96cb47
3 changed files with 8 additions and 6 deletions

View file

@ -70,7 +70,7 @@ replacing '-' and '_' into spaces
* @param limit
* @returns {*[]}
*/
var getTitleAndDescription = function(sourceRef, elements, limit) {
var getTitleAndDescription = function(sourceRefType, sourceRef, elements, limit) {
var title = '';
var desc = '';
@ -85,7 +85,9 @@ var getTitleAndDescription = function(sourceRef, elements, limit) {
}
else {
// use reference name
title = sourceRef.replace(/-/g, ' ').replace(/_/g, ' ').capitalizeFirstLetter();
var normalizedRef = sourceRef.replace(/-/g, ' ').replace(/_/g, ' ').capitalizeFirstLetter()
var refType = sourceRefType;
title = 'Changes from {0}: {1}'.format(refType, normalizedRef);
}
return [title, desc]

View file

@ -508,7 +508,7 @@
## create action
<li>
<a href="#create-actions" onclick="return false;" class="menulink childs">
<i class="tooltip icon-plus-circled" title="${_('Create')}"></i>
<i class="icon-plus-circled"></i>
</a>
<div class="action-menu submenu">

View file

@ -250,9 +250,9 @@
var added = data['stats'][0]
var deleted = data['stats'][1]
var commonAncestorId = data['ancestor'];
var prTitleAndDesc = getTitleAndDescription(
sourceRef()[1], commitElements, 5);
var _sourceRefType = sourceRef()[0];
var _sourceRefName = sourceRef()[1];
var prTitleAndDesc = getTitleAndDescription(_sourceRefType, _sourceRefName, commitElements, 5);
var title = prTitleAndDesc[0];
var proposedDescription = prTitleAndDesc[1];