diff --git a/quickwit/quickwit-ui/src/components/QueryEditor/AggregationEditor.tsx b/quickwit/quickwit-ui/src/components/QueryEditor/AggregationEditor.tsx index 7bfd68bb864..e5f21de65f9 100644 --- a/quickwit/quickwit-ui/src/components/QueryEditor/AggregationEditor.tsx +++ b/quickwit/quickwit-ui/src/components/QueryEditor/AggregationEditor.tsx @@ -71,12 +71,12 @@ export function MetricKind(props: SearchComponentProps) { }; return ( - - + + - + + @@ -104,7 +106,7 @@ export function AggregationKind(props: SearchComponentProps) { }; const [aggregations, setAggregations] = useState<({term: TermAgg} | {histogram: HistogramAgg})[]>( [defaultAgg]); - + const updateAggregationProp = (newAggregations: ({term: TermAgg} | {histogram: HistogramAgg})[]) => { const metric = props.searchRequest.aggregationConfig.metric; const updatedAggregation = Object.assign({}, {metric: metric}, ...newAggregations); @@ -205,7 +207,7 @@ export function AggregationKind(props: SearchComponentProps) { const options = []; if (pos >= agg.length) { options.push(( - Add aggregation + Add aggregation )) } let addHistogram = true; @@ -216,14 +218,14 @@ export function AggregationKind(props: SearchComponentProps) { if (getAggregationKind(agg[i]) === "term") addTerm = false; } if (addHistogram) { - options.push((Histogram aggregation)) + options.push((Histogram aggregation)) } if (addTerm) { - options.push((Term aggregation)); + options.push((Term aggregation)); } if (agg.length > 1) { options.push(( - Remove aggregation + Remove aggregation )) } return options; @@ -241,65 +243,74 @@ export function AggregationKind(props: SearchComponentProps) { const agg = aggs[pos] if (isHistogram(agg)) { return ( - + + + ); } if (isTerm(agg)) { - return [( - handleTermFieldChange(pos, e)} - sx={{ "margin-left": "10px" }} - /> - ),( - handleTermCountChange(pos, e)} - value={agg.term.size} - sx={{ "margin-left": "10px" }} - /> - )] + return (<> + + handleTermFieldChange(pos, e)} + sx={{ "margin-left": "10px" }} + /> + + + handleTermCountChange(pos, e)} + value={agg.term.size} + sx={{ "margin-left": "10px" }} + /> + + ) } return (null); } return ( - - - + <> + + + + {drawAdditional(0, aggregations)} - - - - {drawAdditional(1, aggregations)} - - + + + + + {drawAdditional(1, aggregations)} + + + ) } diff --git a/quickwit/quickwit-ui/src/components/SearchResult/AggregationResult.tsx b/quickwit/quickwit-ui/src/components/SearchResult/AggregationResult.tsx index 6e2025b2f5c..8649eeae750 100644 --- a/quickwit/quickwit-ui/src/components/SearchResult/AggregationResult.tsx +++ b/quickwit/quickwit-ui/src/components/SearchResult/AggregationResult.tsx @@ -48,6 +48,7 @@ export function AggregationResult({searchResponse}: {searchResponse: SearchRespo }; }); series; + // we don't customize colors because we would need a full palette. return ( entry.value)}]} + series={[{ data: result.map(entry => entry.value), color: "#004BD9A5"}]} xAxis={[{ data: result.map(entry => entry.term), scaleType: 'band' }]} margin={{ top: 10, bottom: 30, left: 40, right: 10 }} />) diff --git a/quickwit/quickwit-ui/src/components/SearchResult/SearchResult.tsx b/quickwit/quickwit-ui/src/components/SearchResult/SearchResult.tsx index 0a6f406ec1f..19ea6469feb 100644 --- a/quickwit/quickwit-ui/src/components/SearchResult/SearchResult.tsx +++ b/quickwit/quickwit-ui/src/components/SearchResult/SearchResult.tsx @@ -70,7 +70,7 @@ export default function SearchResult(props: SearchResultProps) { const result = useMemo( () => { if (props.searchResponse == null || props.index == null) { - return null; + return null; } else if (props.searchResponse.aggregations === undefined) { console.log("result table"); return (); @@ -83,7 +83,7 @@ export default function SearchResult(props: SearchResultProps) { ); return ( - + diff --git a/quickwit/quickwit-ui/src/services/client.ts b/quickwit/quickwit-ui/src/services/client.ts index 94d953e6357..adced732ef2 100644 --- a/quickwit/quickwit-ui/src/services/client.ts +++ b/quickwit/quickwit-ui/src/services/client.ts @@ -171,7 +171,7 @@ export class Client { max: request.endTimestamp, }; } else { - extended_bounds = undefined; + extended_bounds = undefined; } aggregation = { histo_agg: { diff --git a/quickwit/quickwit-ui/src/utils/urls.ts b/quickwit/quickwit-ui/src/utils/urls.ts index 28f24a844d5..cb8d5b5ab6c 100644 --- a/quickwit/quickwit-ui/src/utils/urls.ts +++ b/quickwit/quickwit-ui/src/utils/urls.ts @@ -117,7 +117,7 @@ export function toUrlSearchRequestParams(request: SearchRequest): URLSearchParam if (val == null) { return undefined; } else { - return val; + return val; } })) }