Add label sorting alphabetically
This commit is contained in:
parent
dd50451ae4
commit
aa1159888f
14
main.js
14
main.js
|
@ -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`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue