Skip to content

Commit

Permalink
Resolved review comments for log view fixes 1.
Browse files Browse the repository at this point in the history
Signed-off-by: Saisanju Sreevalsakumar <saisanju_s@persistent.com>
  • Loading branch information
saisanju-s committed Sep 30, 2022
1 parent a59bb0a commit 22edf49
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -898,19 +898,20 @@ export const Explorer = ({
[AGGREGATIONS]: [],
};
case VIS_CHART_TYPES.LogsView: {
const dimensions = [
...statsToken.aggregations
.map((agg) => ({
label: `${agg.function.name}(${agg.function.value_expression})` ?? '',
name: `${agg.function.name}(${agg.function.value_expression})` ?? '',
const dimensions = statsToken.aggregations
.map((agg) => {
const logViewField = `${agg.function.name}(${agg.function.value_expression})` ?? '';
return {
label: logViewField,
name: logViewField,
};
})
.concat(
groupByToken.group_fields?.map((agg) => ({
label: agg.name ?? '',
name: agg.name ?? '',
}))
.concat(
groupByToken.group_fields?.map((agg) => ({
label: agg.name ?? '',
name: agg.name ?? '',
}))
),
];
);
if (span !== undefined) {
const { time_field, interval, unit } = span;
const timespanField = `span(${time_field[0].name},${interval}${unit[0].value})`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,20 @@ const defaultUserConfigs = (queryString, visualizationName: string) => {
},
};
if (visualizationName === VIS_CHART_TYPES.LogsView) {
const dimensions = [
...statsTokens.aggregations
.map((agg) => ({
label: `${agg.function.name}(${agg.function.value_expression})` ?? '',
name: `${agg.function.name}(${agg.function.value_expression})` ?? '',
const dimensions = statsTokens.aggregations
.map((agg) => {
const logViewField = `${agg.function.name}(${agg.function.value_expression})` ?? '';
return {
label: logViewField,
name: logViewField,
};
})
.concat(
statsTokens.groupby.group_fields?.map((agg) => ({
label: agg.name ?? '',
name: agg.name ?? '',
}))
.concat(
statsTokens.groupby.group_fields?.map((agg) => ({
label: agg.name ?? '',
name: agg.name ?? '',
}))
),
];
);
if (statsTokens.groupby.span !== null) {
const { field, literal_value, time_unit } = statsTokens.groupby.span.span_expression;
const timespanField = `span(${field},${literal_value}${time_unit})`;
Expand Down

0 comments on commit 22edf49

Please sign in to comment.