Commit 266ab233802a2c70d82b96568b2af5b4b095f6ea
Committed by
GitHub
Merge pull request #5423 from vvlladd28/bug/map-utils/parse-data-index
[3.3.2]UI: Fixed map-utils parse data - not correct index (timeseries without aggregation)
Showing
1 changed file
with
5 additions
and
5 deletions
... | ... | @@ -330,12 +330,12 @@ export function parseData(input: DatasourceData[], dataIndex?: number): Formatte |
330 | 330 | deviceType: null |
331 | 331 | }; |
332 | 332 | entityArray.filter(el => el.data.length).forEach(el => { |
333 | - dataIndex = isDefined(dataIndex) ? dataIndex : el.data.length - 1; | |
334 | - if (!obj.hasOwnProperty(el.dataKey.label) || el.data[dataIndex][1] !== '') { | |
335 | - obj[el.dataKey.label] = el.data[dataIndex][1]; | |
336 | - obj[el.dataKey.label + '|ts'] = el.data[dataIndex][0]; | |
333 | + const index = isDefined(dataIndex) ? dataIndex : el.data.length - 1; | |
334 | + if (!obj.hasOwnProperty(el.dataKey.label) || el.data[index][1] !== '') { | |
335 | + obj[el.dataKey.label] = el.data[index][1]; | |
336 | + obj[el.dataKey.label + '|ts'] = el.data[index][0]; | |
337 | 337 | if (el.dataKey.label.toLowerCase() === 'type') { |
338 | - obj.deviceType = el.data[dataIndex][1]; | |
338 | + obj.deviceType = el.data[index][1]; | |
339 | 339 | } |
340 | 340 | } |
341 | 341 | }); | ... | ... |