mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-10 22:18:59 +08:00
bug: Trace search bug is resolved (#741)
* bug: Trace search bug is resolved * bug: Trace search bug is resolved * chore: parseTagsToQuery is updated * chore: parseTagsToQuery is updated * chore: parseTagsToQuery is updated * chore: parseTagsToQuery is updated
This commit is contained in:
parent
9f7c60d2c1
commit
540a682bf0
@ -75,7 +75,7 @@ const SingleTags = (props: AllTagsProps): JSX.Element => {
|
|||||||
value={AllMenu.find((e) => e.key === selectedOperator)?.value || ''}
|
value={AllMenu.find((e) => e.key === selectedOperator)?.value || ''}
|
||||||
>
|
>
|
||||||
{AllMenu.map((e) => (
|
{AllMenu.map((e) => (
|
||||||
<Option key={e.key} value={e.value}>
|
<Option key={e.value} value={e.key}>
|
||||||
{e.value}
|
{e.value}
|
||||||
</Option>
|
</Option>
|
||||||
))}
|
))}
|
||||||
|
@ -13,14 +13,14 @@ export const parseQueryToTags = (query: string): PayloadProps<Tags> => {
|
|||||||
const noOfTags = query.split(' AND ');
|
const noOfTags = query.split(' AND ');
|
||||||
|
|
||||||
const tags: Tags = noOfTags.map((filter) => {
|
const tags: Tags = noOfTags.map((filter) => {
|
||||||
const isInPresent = filter.includes('IN');
|
const isInPresent = filter.includes('in');
|
||||||
const isNotInPresent = filter.includes('NOT_IN');
|
const isNotInPresent = filter.includes('not in');
|
||||||
|
|
||||||
if (!isNotInPresent || !isInPresent) {
|
if (!isNotInPresent && !isInPresent) {
|
||||||
isError = true;
|
isError = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const splitBy = isNotInPresent ? 'NOT_IN' : isInPresent ? 'IN' : '';
|
const splitBy = isNotInPresent ? 'not in' : isInPresent ? 'in' : '';
|
||||||
|
|
||||||
if (splitBy.length === 0) {
|
if (splitBy.length === 0) {
|
||||||
isError = true;
|
isError = true;
|
||||||
@ -40,13 +40,15 @@ export const parseQueryToTags = (query: string): PayloadProps<Tags> => {
|
|||||||
|
|
||||||
const removingFirstAndLastBrackets = `${filterForTags?.slice(1, -1)}`;
|
const removingFirstAndLastBrackets = `${filterForTags?.slice(1, -1)}`;
|
||||||
|
|
||||||
const noofFilters = removingFirstAndLastBrackets.split(',');
|
const noofFilters = removingFirstAndLastBrackets
|
||||||
|
.split(',')
|
||||||
|
.map((e) => e.replaceAll(/"/g, ''));
|
||||||
|
|
||||||
noofFilters.forEach((e) => {
|
noofFilters.forEach((e) => {
|
||||||
const firstChar = e.charAt(0);
|
const firstChar = e.charAt(0);
|
||||||
const lastChar = e.charAt(e.length - 1);
|
const lastChar = e.charAt(e.length - 1);
|
||||||
|
|
||||||
if (!(firstChar === '"' && lastChar === '"')) {
|
if (firstChar === '"' && lastChar === '"') {
|
||||||
isError = true;
|
isError = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -73,7 +75,9 @@ export const parseTagsToQuery = (tags: Tags): PayloadProps<string> => {
|
|||||||
isError = true;
|
isError = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${Key[0]} ${Operator} (${Values.map((e) => `"${e}"`).join(',')})`;
|
return `${Key[0]} ${Operator} (${Values.map((e) => {
|
||||||
|
return `"${e.replaceAll(/"/g, '')}"`;
|
||||||
|
}).join(',')})`;
|
||||||
})
|
})
|
||||||
.join(' AND ');
|
.join(' AND ');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user