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:
parent
74190bb456
commit
8ca5fbd37c
@ -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!',
|
||||
|
@ -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 => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user