Skip to content

Commit

Permalink
codestyle and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
trinity-1686a committed May 15, 2024
1 parent 613a245 commit cd1cf38
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion quickwit/quickwit-ui/src/components/QueryActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function QueryEditorActionBar(props: SearchComponentProps) {
const shouldDisplayTimeRangeSelect = timestamp_field_name ?? false;

const handleChange = (_event: React.SyntheticEvent, newTab: number) => {
const updatedSearchRequest = Object.assign({}, props.searchRequest, {aggregation: newTab != 0});
const updatedSearchRequest = {...props.searchRequest, aggregation: newTab != 0};
props.onSearchRequestUpdate(updatedSearchRequest);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export function MetricKind(props: SearchComponentProps) {

const handleTypeChange = (event: SelectChangeEvent) => {
const value = event.target.value;
const updatedMetric = value != "count" ? Object.assign({}, metricRef.current, {type: value}) : null;
const updatedAggregation = Object.assign({}, props.searchRequest.aggregationConfig, {metric: updatedMetric});
const updatedSearchRequest = Object.assign({}, props.searchRequest, {aggregationConfig: updatedAggregation});
const updatedMetric = value != "count" ? {...metricRef.current!, type: value} : null;
const updatedAggregation = {...props.searchRequest.aggregationConfig, metric: updatedMetric};
const updatedSearchRequest = {...props.searchRequest, aggregationConfig: updatedAggregation};
props.onSearchRequestUpdate(updatedSearchRequest);
metricRef.current = updatedMetric;
};
Expand All @@ -63,9 +63,9 @@ export function MetricKind(props: SearchComponentProps) {
if (metricRef.current == null) {
return;
}
const updatedMetric = Object.assign({}, metricRef.current, {field: value});
const updatedAggregation = Object.assign({}, props.searchRequest.aggregationConfig, {metric: updatedMetric});
const updatedSearchRequest = Object.assign({}, props.searchRequest, {aggregationConfig: updatedAggregation});
const updatedMetric = {...metricRef.current!, field: value};
const updatedAggregation = {...props.searchRequest.aggregationConfig, metric: updatedMetric};
const updatedSearchRequest = {...props.searchRequest, aggregationConfig: updatedAggregation};
props.onSearchRequestUpdate(updatedSearchRequest);
metricRef.current = updatedMetric;
};
Expand Down Expand Up @@ -108,7 +108,7 @@ export function AggregationKind(props: SearchComponentProps) {
const updateAggregationProp = (newAggregations: ({term: TermAgg} | {histogram: HistogramAgg})[]) => {
const metric = props.searchRequest.aggregationConfig.metric;
const updatedAggregation = Object.assign({}, {metric: metric}, ...newAggregations);
const updatedSearchRequest = Object.assign({}, props.searchRequest, {aggregationConfig: updatedAggregation});
const updatedSearchRequest = {...props.searchRequest, aggregationConfig: updatedAggregation};
props.onSearchRequestUpdate(updatedSearchRequest);
};

Expand Down Expand Up @@ -233,7 +233,7 @@ export function AggregationKind(props: SearchComponentProps) {
const aggregationConfig = props.searchRequest.aggregationConfig;
if (aggregationConfig.histogram === null && aggregationConfig.term === null) {
const initialAggregation = Object.assign({}, ...aggregations);
const initialSearchRequest = Object.assign({}, props.searchRequest, {aggregationConfig: initialAggregation});
const initialSearchRequest = {...props.searchRequest, aggregationConfig: initialAggregation};
props.onSearchRequestUpdate(initialSearchRequest);
}

Expand All @@ -247,7 +247,7 @@ export function AggregationKind(props: SearchComponentProps) {
sx={{ "margin-left": "10px", "min-height": "44px" }}
>
<MenuItem value="auto">Auto</MenuItem>
<MenuItem value="10s">10 secods</MenuItem>
<MenuItem value="10s">10 seconds</MenuItem>
<MenuItem value="1m">1 minute</MenuItem>
<MenuItem value="5m">5 minutes</MenuItem>
<MenuItem value="10m">10 minutes</MenuItem>
Expand Down
2 changes: 1 addition & 1 deletion quickwit/quickwit-ui/src/services/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class Client {
if (body !== null) {
params.method = "POST";
params.body = body;
params.headers = Object.assign({}, params.headers, {"content-type": "application/json"});
params.headers = {...params.headers, "content-type": "application/json"};
}
const response = await fetch(url, params);
if (response.ok) {
Expand Down

0 comments on commit cd1cf38

Please sign in to comment.