expand tags in csv (#8258)

Fixes: #8256
This commit is contained in:
dahn 2023-12-09 07:03:55 +01:00 committed by GitHub
parent fc44df7c95
commit ea569ffaad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -334,7 +334,17 @@ export default {
result += columnDelimiter
}
result += typeof item[key] === 'string' && item[key].includes(columnDelimiter) ? `"${item[key]}"` : item[key]
if (key === 'tags') {
var tags = '"'
if (item[key].length > 0) {
item[key].forEach(tag => {
tags += '(' + tag.key + ',' + tag.value + ')'
})
}
result += tags + '"'
} else {
result += typeof item[key] === 'string' && item[key].includes(columnDelimiter) ? `"${item[key]}"` : item[key]
}
ctr++
})
result += lineDelimiter