Merge pull request #5514 from vlastahajek/fix/reedit-issue

fix: Avoiding passing invalid number to Grid
pull/5516/head
Pavel Závora 2020-06-18 06:09:01 +02:00 committed by GitHub
commit 71b9d07f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -8,6 +8,7 @@
1. [#5503](https://github.com/influxdata/chronograf/pull/5503): Repair tick script editor scrolling on Firefox
1. [#5506](https://github.com/influxdata/chronograf/pull/5506): Parse flux CSV results in a way to support existing dockerized 1.8.0 InfluxDB
1. [#5492](https://github.com/influxdata/chronograf/pull/5492): Support `.Time.Unix` in alert message validation
1. [#5514](https://github.com/influxdata/chronograf/pull/5514): Error when viewing flux raw data after edit
1. [#5505](https://github.com/influxdata/chronograf/pull/5505): Repair management of kapacitor rules and tick scripts
### Features

View File

@ -69,7 +69,10 @@ class RawFluxDataTable extends PureComponent<Props, State> {
scrollTop: number
): JSX.Element {
const rowCount = data.length
const columnWidth = Math.max(MIN_COLUMN_WIDTH, width / maxColumnCount)
const columnWidth =
maxColumnCount > 0
? Math.max(MIN_COLUMN_WIDTH, width / maxColumnCount)
: MIN_COLUMN_WIDTH
const style = this.gridStyle(columnWidth, maxColumnCount, rowCount)
return (

View File

@ -126,7 +126,10 @@ interface ParseResponseRawResult {
export const parseResponseRaw = (response: string): ParseResponseRawResult => {
const chunks = parseChunks(response)
const parsedChunks = chunks.map(c => Papa.parse(c).data)
const maxColumnCount = Math.max(...parsedChunks.map(c => c[0].length))
const maxColumnCount =
parsedChunks.length > 0
? Math.max(...parsedChunks.map(c => c[0].length))
: 0
const data = []
for (let i = 0; i < parsedChunks.length; i++) {