mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 20:35:53 +08:00
fix: fixed incorrect label for orderBy clause when selected (#6177)
This commit is contained in:
parent
701b8803ac
commit
dd097821d1
@ -59,9 +59,10 @@ export const useOrderByFilter = ({
|
||||
];
|
||||
}, [searchText]);
|
||||
|
||||
const selectedValue = useMemo(() => transformToOrderByStringValues(query), [
|
||||
query,
|
||||
]);
|
||||
const selectedValue = useMemo(
|
||||
() => transformToOrderByStringValues(query, entityVersion),
|
||||
[query, entityVersion],
|
||||
);
|
||||
|
||||
const generateOptions = useCallback(
|
||||
(options: IOption[]): IOption[] => {
|
||||
|
@ -13,11 +13,14 @@ export const orderByValueDelimiter = '|';
|
||||
|
||||
export const transformToOrderByStringValues = (
|
||||
query: IBuilderQuery,
|
||||
entityVersion?: string,
|
||||
): IOption[] => {
|
||||
const prepareSelectedValue: IOption[] = query.orderBy.map((item) => {
|
||||
if (item.columnName === SIGNOZ_VALUE) {
|
||||
return {
|
||||
label: `${query.aggregateOperator}(${query.aggregateAttribute.key}) ${item.order}`,
|
||||
label: `${
|
||||
entityVersion === 'v4' ? query.spaceAggregation : query.aggregateOperator
|
||||
}(${query.aggregateAttribute.key}) ${item.order}`,
|
||||
value: `${item.columnName}${orderByValueDelimiter}${item.order}`,
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user