Bauke/tildes-issue-log
Bauke
/
tildes-issue-log
Archived
1
Fork 0

Add label sorting alphabetically

This commit is contained in:
Bauke 2018-06-24 23:52:55 +02:00
parent dd50451ae4
commit aa1159888f
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 10 additions and 4 deletions

14
main.js
View File

@ -199,9 +199,12 @@ function createStatistics() {
} }
} }
statistics += 'Total amount of labels assigned to currently open issues:\n' let labelsOrdered = {}
Object.keys(labels).sort().forEach(label => labelsOrdered[label] = labels[label])
for (const label in labels) { statistics += 'Total amount of labels assigned to currently open issues:\n\n'
for (const label in labelsOrdered) {
statistics += `* [${label}](https://gitlab.com/tildes/tildes/issues?state=opened&label_name%5B%5D=${label.replace(' ', '+')}): ${labels[label]} times.\n` statistics += `* [${label}](https://gitlab.com/tildes/tildes/issues?state=opened&label_name%5B%5D=${label.replace(' ', '+')}): ${labels[label]} times.\n`
} }
@ -214,9 +217,12 @@ function createStatistics() {
} }
} }
statistics += '\nTotal amount of labels assigned to closed issues:\n' labelsOrdered = {}
Object.keys(labels).sort().forEach(label => labelsOrdered[label] = labels[label])
for (const label in labels) { statistics += '\nTotal amount of labels assigned to closed issues:\n\n'
for (const label in labelsOrdered) {
statistics += `* [${label}](https://gitlab.com/tildes/tildes/issues?state=closed&label_name%5B%5D=${label.replace(' ', '+')}): ${labels[label]} times.\n` statistics += `* [${label}](https://gitlab.com/tildes/tildes/issues?state=closed&label_name%5B%5D=${label.replace(' ', '+')}): ${labels[label]} times.\n`
} }