mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 17:45:55 +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]);
|
}, [searchText]);
|
||||||
|
|
||||||
const selectedValue = useMemo(() => transformToOrderByStringValues(query), [
|
const selectedValue = useMemo(
|
||||||
query,
|
() => transformToOrderByStringValues(query, entityVersion),
|
||||||
]);
|
[query, entityVersion],
|
||||||
|
);
|
||||||
|
|
||||||
const generateOptions = useCallback(
|
const generateOptions = useCallback(
|
||||||
(options: IOption[]): IOption[] => {
|
(options: IOption[]): IOption[] => {
|
||||||
|
@ -13,11 +13,14 @@ export const orderByValueDelimiter = '|';
|
|||||||
|
|
||||||
export const transformToOrderByStringValues = (
|
export const transformToOrderByStringValues = (
|
||||||
query: IBuilderQuery,
|
query: IBuilderQuery,
|
||||||
|
entityVersion?: string,
|
||||||
): IOption[] => {
|
): IOption[] => {
|
||||||
const prepareSelectedValue: IOption[] = query.orderBy.map((item) => {
|
const prepareSelectedValue: IOption[] = query.orderBy.map((item) => {
|
||||||
if (item.columnName === SIGNOZ_VALUE) {
|
if (item.columnName === SIGNOZ_VALUE) {
|
||||||
return {
|
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}`,
|
value: `${item.columnName}${orderByValueDelimiter}${item.order}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user