mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-29 16:14:42 +00:00
feat: removed the stepInterval default and added auto as placeholder
This commit is contained in:
parent
3aa4e09727
commit
12c7b9b394
@ -78,7 +78,7 @@ function createBaseSpec(
|
||||
);
|
||||
|
||||
return {
|
||||
stepInterval: queryData.stepInterval,
|
||||
stepInterval: queryData?.stepInterval || undefined,
|
||||
disabled: queryData.disabled,
|
||||
filter: queryData?.filter?.expression ? queryData.filter : undefined,
|
||||
groupBy:
|
||||
@ -251,7 +251,7 @@ function convertPromQueriesToV5(
|
||||
name: queryName,
|
||||
query: queryData.query,
|
||||
disabled: queryData.disabled || false,
|
||||
step: queryData.stepInterval,
|
||||
step: queryData?.stepInterval,
|
||||
stats: false, // PromQL specific field
|
||||
},
|
||||
}),
|
||||
|
||||
@ -112,7 +112,7 @@ const MetricsAggregateSection = memo(function MetricsAggregateSection({
|
||||
<InputWithLabel
|
||||
onChange={handleChangeAggregateEvery}
|
||||
label="Seconds"
|
||||
placeholder="Enter a number"
|
||||
placeholder="Auto"
|
||||
labelAfter
|
||||
initialValue={query?.stepInterval ?? undefined}
|
||||
/>
|
||||
|
||||
@ -57,7 +57,7 @@ function QueryAggregationOptions({
|
||||
<div className="query-aggregation-interval-input-container">
|
||||
<InputWithLabel
|
||||
initialValue={
|
||||
queryData.stepInterval ? queryData.stepInterval : undefined
|
||||
queryData?.stepInterval ? queryData?.stepInterval : undefined
|
||||
}
|
||||
className="query-aggregation-interval-input"
|
||||
label="Seconds"
|
||||
|
||||
@ -179,7 +179,7 @@ export const initialQueryBuilderFormValues: IBuilderQuery = {
|
||||
sourceNames: alphabet,
|
||||
}),
|
||||
disabled: false,
|
||||
stepInterval: 60,
|
||||
stepInterval: undefined,
|
||||
having: [],
|
||||
limit: null,
|
||||
orderBy: [],
|
||||
|
||||
@ -101,7 +101,7 @@ export function updateStepInterval(
|
||||
|
||||
// if user haven't enter anything manually, that is we have default value of 60 then do the interval adjustment for bar otherwise apply the user's value
|
||||
const getSteps = (queryData: IBuilderQuery): number =>
|
||||
queryData.stepInterval === 60
|
||||
queryData?.stepInterval === 60
|
||||
? stepIntervalPoints || 60
|
||||
: queryData?.stepInterval || 60;
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ function AggregateEveryFilter({
|
||||
placeholder="Enter in seconds"
|
||||
disabled={isDisabled}
|
||||
style={selectStyle}
|
||||
value={query.stepInterval}
|
||||
value={query?.stepInterval}
|
||||
onChange={onChangeHandler}
|
||||
min={0}
|
||||
/>
|
||||
|
||||
@ -31,7 +31,7 @@ export const updateStepInterval = (
|
||||
queryData:
|
||||
query?.builder?.queryData?.map((item) => ({
|
||||
...item,
|
||||
stepInterval: getStepInterval(item.stepInterval),
|
||||
stepInterval: getStepInterval(item?.stepInterval ?? 60),
|
||||
})) || [],
|
||||
},
|
||||
};
|
||||
|
||||
@ -80,7 +80,7 @@ export type IBuilderQuery = {
|
||||
having: Having[];
|
||||
havingExpression?: HavingV5;
|
||||
limit: number | null;
|
||||
stepInterval: number;
|
||||
stepInterval: number | undefined;
|
||||
orderBy: OrderByPayload[];
|
||||
reduceTo: ReduceOperators;
|
||||
legend: string;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user