Skip to content

Commit

Permalink
Merge pull request #2056 from phillxnet/2054_changelog_fails_on_versi…
Browse files Browse the repository at this point in the history
…on_lines

changelog fails on version lines. Fixes #2054
  • Loading branch information
phillxnet authored Sep 22, 2019
2 parents b671cff + 08a9d19 commit 281bd29
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 18 deletions.
48 changes: 30 additions & 18 deletions src/rockstor/storageadmin/static/storageadmin/js/views/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,28 +239,40 @@ VersionView = RockstorLayoutView.extend({
var contributors = [];

for (var i = 0; i < logArray.length; i++) {
var hashIndex = logArray[i].indexOf('#');
var atRateIndex = logArray[i].indexOf('@');
issues[i] = logArray[i].substring(hashIndex + 1, atRateIndex - 1);
var namesNum = logArray[i].indexOf('@') + 1;
changeDescription[i] = logArray[i].substring(0, hashIndex - 1);
nextString[i] = logArray[i].substring(namesNum, logArray[i].length);
contributors[i] = nextString[i].split(' @');
if (logArray[i] == '' || logArray[i].substring(0, 1) == '*') {
// Preserve empty lines and package version entries 'as is'
// and Bold for section emphasis.
changeDescription[i] = logArray[i]
} else {
var hashIndex = logArray[i].indexOf('#');
var atRateIndex = logArray[i].indexOf('@');
issues[i] = logArray[i].substring(hashIndex + 1, atRateIndex - 1);
var namesNum = logArray[i].indexOf('@') + 1;
changeDescription[i] = logArray[i].substring(0, hashIndex - 1);
nextString[i] = logArray[i].substring(namesNum, logArray[i].length);
contributors[i] = nextString[i].split(' @');
}
}
for (var k = 0; k < changeDescription.length; k++) {
var cl = changeDescription[k];
cl += '<a href="https://github.com/rockstor/rockstor-core/issues/';
cl += issues[k];
cl += '" target="_blank"> #';
cl += issues[k];
cl += '</a>';

for (var j = 0; j < contributors[k].length; j++) {
cl += '<a href="https://github.com/';
cl += contributors[k][j];
cl += '" target="_blank"> @';
cl += contributors[k][j];
// Don't process package version lines for issue and contributor
if (cl == '' || cl.substring(0, 1) == '*') {
cl = '<strong>' + cl + '</strong>'
} else {
cl += '<a href="https://github.com/rockstor/rockstor-core/issues/';
cl += issues[k];
cl += '" target="_blank"> #';
cl += issues[k];
cl += '</a>';
if (typeof contributors[k] !== 'undefined') {
for (var j = 0; j < contributors[k].length; j++) {
cl += '<a href="https://github.com/';
cl += contributors[k][j];
cl += '" target="_blank"> @';
cl += contributors[k][j];
cl += '</a>';
}
}
}
changeLogArray.push(new Handlebars.SafeString(cl));
}
Expand Down
1 change: 1 addition & 0 deletions src/rockstor/system/pkg_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ def update_check(subscription=None):
if (len(l.strip()) == 0):
log = False
if (re.match('\* ', l) is not None):
updates.append(l)
log = True
if (new_version is None):
new_version = version
Expand Down

0 comments on commit 281bd29

Please sign in to comment.