1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-26 18:48:15 +02:00

GH-4047 Handle all potential displayValue types (#4048)

* handle all potential displayValue types

* add logging the error
This commit is contained in:
Scott Bishel 2022-10-20 02:50:40 -06:00 committed by GitHub
parent 74190bb456
commit 8ca5fbd37c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import IconButton from '../../widgets/buttons/iconButton'
import OptionsIcon from '../../widgets/icons/options'
import Menu from '../../widgets/menu'
import MenuWrapper from '../../widgets/menuWrapper'
import {Utils} from '../../utils'
import ModalWrapper from '../modalWrapper'
import {sendFlashMessage} from '../flashMessages'
@ -84,6 +85,7 @@ function onExportCsvTrigger(board: Board, activeView: BoardView, cards: Card[],
})
sendFlashMessage({content: exportCompleteMessage, severity: 'normal'})
} catch (e) {
Utils.logError(`ExportCSV ERROR: ${e}`)
const exportFailedMessage = intl.formatMessage({
id: 'ViewHeader.export-failed',
defaultMessage: 'Export failed!',

View File

@ -58,7 +58,12 @@ export abstract class PropertyType {
exportValue = (value: string | string[] | undefined, card: Card, template: IPropertyTemplate, intl: IntlShape): string => {
const displayValue = this.displayValue(value, card, template, intl)
return `"${encodeText(displayValue as string)}"`
if (typeof displayValue === 'string') {
return `"${encodeText(displayValue)}"`
} else if (Array.isArray(displayValue)) {
return `"${encodeText((displayValue as string[]).join('|'))}"`
}
return ''
}
valueClassName = (readonly: boolean): string => {