Compare commits

...

1 Commits

Author SHA1 Message Date
amlannandy
02e9152ee0 chore: add fillZero function to query builder functions list 2025-11-21 14:32:26 +07:00
4 changed files with 10 additions and 2 deletions

View File

@@ -68,8 +68,8 @@ export const metricQueryFunctionOptions: SelectOption<string, string>[] = [
label: 'Time Shift',
},
{
value: QueryFunctionsTypes.TIME_SHIFT,
label: 'Time Shift',
value: QueryFunctionsTypes.FILL_ZERO,
label: 'Fill Zero',
},
];
@@ -156,4 +156,7 @@ export const queryFunctionsTypesConfig: QueryFunctionConfigType = {
showInput: true,
inputType: 'text',
},
fillZero: {
showInput: false,
},
};

View File

@@ -208,6 +208,7 @@ export enum QueryFunctionsTypes {
MEDIAN_5 = 'median5',
MEDIAN_7 = 'median7',
TIME_SHIFT = 'timeShift',
FILL_ZERO = 'fillZero',
}
export type PanelTypeKeys =

View File

@@ -59,6 +59,9 @@ describe('functionNameNormalizer', () => {
expect(normalizeFunctionName('median5')).toBe(QueryFunctionsTypes.MEDIAN_5);
expect(normalizeFunctionName('median7')).toBe(QueryFunctionsTypes.MEDIAN_7);
expect(normalizeFunctionName('anomaly')).toBe(QueryFunctionsTypes.ANOMALY);
expect(normalizeFunctionName('fillzero')).toBe(
QueryFunctionsTypes.FILL_ZERO,
);
});
});

View File

@@ -27,6 +27,7 @@ export const normalizeFunctionName = (functionName: string): string => {
median5: QueryFunctionsTypes.MEDIAN_5,
median7: QueryFunctionsTypes.MEDIAN_7,
anomaly: QueryFunctionsTypes.ANOMALY,
fillzero: QueryFunctionsTypes.FILL_ZERO,
};
// Convert to lowercase for case-insensitive matching