Skip to content

Commit f6e0f24

Browse files
authored
feat: when using group aggregate function, set default to all grouping tag values (#4716)
1 parent 0a9713f commit f6e0f24

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/timeMachine/reducers/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,20 @@ export const timeMachineReducer = (
840840
// we want to clear out any previously selected values
841841
draftQuery.builderConfig.tags[index].values = []
842842

843+
// but for the group aggregate, want to set default values
844+
if (builderAggregateFunctionType === 'group') {
845+
draftQuery.builderConfig.tags[
846+
index
847+
].values = draftQuery.builderConfig.tags
848+
.map(t => t.key)
849+
.filter(x => !!x)
850+
}
851+
843852
draftQuery.builderConfig.tags[
844853
index
845854
].aggregateFunctionType = builderAggregateFunctionType
855+
856+
buildActiveQuery(draftState)
846857
}
847858
})
848859
}

0 commit comments

Comments
 (0)