fix: trace filter groupby selection is breaking the FE

This commit is contained in:
Pranshu Chittora 2022-03-22 17:12:03 +05:30
parent 02d89a3a04
commit 5e02bfe2e4
No known key found for this signature in database
GPG Key ID: 3A9E57A016CC0626
3 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,7 @@
import { ChartData, ChartDataset, ChartDatasetProperties } from 'chart.js'; import { ChartData, ChartDataset, ChartDatasetProperties } from 'chart.js';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { colors } from 'lib/getRandomColor'; import { colors } from 'lib/getRandomColor';
import { keys } from 'lodash-es';
import { TraceReducer } from 'types/reducer/trace'; import { TraceReducer } from 'types/reducer/trace';
function transposeArray(array: number[][], arrayLength: number) { function transposeArray(array: number[][], arrayLength: number) {
@ -67,8 +68,8 @@ export const getChartDataforGroupBy = (
const allGroupBy = Object.keys(items).map((e) => items[e].groupBy); const allGroupBy = Object.keys(items).map((e) => items[e].groupBy);
Object.keys(allGroupBy).map((e) => { keys(allGroupBy).forEach((e: string): void => {
const { length } = Object.keys(allGroupBy[e]); const { length } = keys(allGroupBy[e]);
if (length >= max) { if (length >= max) {
max = length; max = length;

View File

@ -24,7 +24,7 @@ function TraceGraph(): JSX.Element {
return selectedGroupBy.length === 0 return selectedGroupBy.length === 0
? getChartData(payload) ? getChartData(payload)
: getChartDataforGroupBy(payload); : getChartDataforGroupBy(payload);
}, [payload, selectedGroupBy.length]); }, [payload, selectedGroupBy]);
if (error) { if (error) {
return ( return (

View File

@ -5144,7 +5144,7 @@ debug@^3.1.0, debug@^3.1.1, debug@^3.2.6, debug@^3.2.7:
dependencies: dependencies:
ms "^2.1.1" ms "^2.1.1"
"debug@github:ngokevin/debug#noTimestamp": debug@ngokevin/debug#noTimestamp:
version "2.2.0" version "2.2.0"
resolved "https://codeload.github.com/ngokevin/debug/tar.gz/ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a" resolved "https://codeload.github.com/ngokevin/debug/tar.gz/ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a"
@ -5352,7 +5352,7 @@ doctrine@^3.0.0:
dependencies: dependencies:
esutils "^2.0.2" esutils "^2.0.2"
"document-register-element@github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90": document-register-element@dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90:
version "0.5.4" version "0.5.4"
resolved "https://codeload.github.com/dmarcos/document-register-element/tar.gz/8ccc532b7f3744be954574caf3072a5fd260ca90" resolved "https://codeload.github.com/dmarcos/document-register-element/tar.gz/8ccc532b7f3744be954574caf3072a5fd260ca90"
@ -11821,7 +11821,7 @@ threads@^1.7.0:
optionalDependencies: optionalDependencies:
tiny-worker ">= 2" tiny-worker ">= 2"
"three-bmfont-text@github:dmarcos/three-bmfont-text#21d017046216e318362c48abd1a48bddfb6e0733": three-bmfont-text@dmarcos/three-bmfont-text#21d017046216e318362c48abd1a48bddfb6e0733:
version "2.4.0" version "2.4.0"
resolved "https://codeload.github.com/dmarcos/three-bmfont-text/tar.gz/21d017046216e318362c48abd1a48bddfb6e0733" resolved "https://codeload.github.com/dmarcos/three-bmfont-text/tar.gz/21d017046216e318362c48abd1a48bddfb6e0733"
dependencies: dependencies: