bug: exclude param is added in the getTagFilters (#1025)

This commit is contained in:
palash-signoz 2022-05-03 15:29:54 +05:30 committed by GitHub
parent 59f32884d2
commit 9351fd09c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import { AxiosError } from 'axios';
import { omitBy } from 'lodash-es';
import { ErrorResponse, SuccessResponse } from 'types/api';
import { PayloadProps, Props } from 'types/api/trace/getTagFilters';
import { TraceFilterEnum } from 'types/reducer/trace';
const getTagFilters = async (
props: Props,
@ -12,6 +13,14 @@ const getTagFilters = async (
const duration =
omitBy(props.other, (_, key) => !key.startsWith('duration')) || [];
const exclude: TraceFilterEnum[] = [];
props.isFilterExclude.forEach((value, key) => {
if (value) {
exclude.push(key);
}
});
const nonDuration = omitBy(props.other, (_, key) =>
key.startsWith('duration'),
);
@ -22,6 +31,7 @@ const getTagFilters = async (
...nonDuration,
maxDuration: String((duration.duration || [])[0] || ''),
minDuration: String((duration.duration || [])[1] || ''),
exclude,
});
return {

View File

@ -27,6 +27,7 @@ function TagsKey(props: TagsKeysProps): JSX.Element {
start: globalTime.minTime,
end: globalTime.maxTime,
other: Object.fromEntries(traces.selectedFilter),
isFilterExclude: traces.isFilterExclude,
});
if (response.statusCode === 200) {

View File

@ -1,9 +1,12 @@
import { TraceReducer } from 'types/reducer/trace';
export interface Props {
start: number;
end: number;
other: {
[k: string]: string[];
};
isFilterExclude: TraceReducer['isFilterExclude'];
}
interface TagsKeys {