👌 IMPROVE: correctly display all keys in summary (like account/s etc)

Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
pull/625/head
Jonas Sulzer 2019-07-11 19:04:26 +02:00 zatwierdzone przez Cyrille Bollu
rodzic a727183fe2
commit 24a2e12b17
1 zmienionych plików z 10 dodań i 1 usunięć
src/components

Wyświetl plik

@ -62,7 +62,16 @@ export default {
let summary = this.item.summary
for (var key in this.item.details) {
let keyword = '{' + key + '}'
summary = summary.replace(keyword, JSON.stringify(this.item.details[key]))
if (typeof this.item.details[key] !== 'string' && this.item.details[key].length > 1) {
let concatination = ''
for (var stringkey in this.item.details[key]) {
concatination += this.item.details[key][stringkey] + ', '
}
concatination = concatination.substring(0, concatination.length - 2)
summary = summary.replace(keyword, concatination)
} else {
summary = summary.replace(keyword, this.item.details[key])
}
}
return summary
}