Merge pull request #2527 from nextcloud/fix/export-without-owner

skip participant on error
This commit is contained in:
René Gieling 2022-08-03 23:35:13 +02:00 коммит произвёл GitHub
Родитель 037f2b35b1 559d5d6312
Коммит fb55da69e3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 19 добавлений и 13 удалений

Просмотреть файл

@ -12,6 +12,8 @@ All notable changes to this project will be documented in this file.
### Fix
- Unsubscribing from a public was not possible
- Use display name for avatar of the current public user instead of user id
- Fix export, if owner did not vote in the poll
## [3.7.0] - 2022-06-24
### New
- User setting for conflict check (hours before and after an option to search for conflicts)

Просмотреть файл

@ -176,21 +176,25 @@ export default {
addVotesArray(style) {
this.participants.forEach((participant) => {
const votesLine = [participant.displayName]
if (this.isOwner) {
votesLine.push(this.emailAddresses.find((item) => item.displayName === participant.displayName).emailAddress)
}
this.options.list.forEach((option, i) => {
if (style === 'symbols') {
votesLine.push(this.getVote({ userId: participant.userId, option }).answerSymbol ?? '❌')
} else if (style === 'raw') {
votesLine.push(this.getVote({ userId: participant.userId, option }).answer)
} else {
votesLine.push(this.getVote({ userId: participant.userId, option }).answerTranslated ?? t('polls', 'No'))
try {
if (this.isOwner) {
votesLine.push(this.emailAddresses.find((item) => item.displayName === participant.displayName).emailAddress)
}
})
this.sheetData.push(votesLine)
this.options.list.forEach((option, i) => {
if (style === 'symbols') {
votesLine.push(this.getVote({ userId: participant.userId, option }).answerSymbol ?? '❌')
} else if (style === 'raw') {
votesLine.push(this.getVote({ userId: participant.userId, option }).answer)
} else {
votesLine.push(this.getVote({ userId: participant.userId, option }).answerTranslated ?? t('polls', 'No'))
}
})
this.sheetData.push(votesLine)
} catch (e) {
// just skip this participant
}
})
const workSheet = xlsxUtils.aoa_to_sheet(this.sheetData)