mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 01:48:59 +08:00
Revert "fix: use search v2 component for traces data source & minor improveme…" (#7511)
This reverts commit d7a6607a25f6c6c5e08576f72f27deeabaf38d97.
This commit is contained in:
parent
3b4a8e5e0f
commit
7972261237
@ -453,7 +453,7 @@ export const Query = memo(function Query({
|
|||||||
</Col>
|
</Col>
|
||||||
)}
|
)}
|
||||||
<Col flex="1" className="qb-search-container">
|
<Col flex="1" className="qb-search-container">
|
||||||
{[DataSource.LOGS, DataSource.TRACES].includes(query.dataSource) ? (
|
{query.dataSource === DataSource.LOGS ? (
|
||||||
<QueryBuilderSearchV2
|
<QueryBuilderSearchV2
|
||||||
query={query}
|
query={query}
|
||||||
onChange={handleChangeTagFilters}
|
onChange={handleChangeTagFilters}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
import './QueryBuilderSearchV2.styles.scss';
|
import './QueryBuilderSearchV2.styles.scss';
|
||||||
|
|
||||||
import { Typography } from 'antd';
|
import { Typography } from 'antd';
|
||||||
import cx from 'classnames';
|
|
||||||
import {
|
import {
|
||||||
ArrowDown,
|
ArrowDown,
|
||||||
ArrowUp,
|
ArrowUp,
|
||||||
@ -26,7 +25,6 @@ interface ICustomDropdownProps {
|
|||||||
exampleQueries: TagFilter[];
|
exampleQueries: TagFilter[];
|
||||||
onChange: (value: TagFilter) => void;
|
onChange: (value: TagFilter) => void;
|
||||||
currentFilterItem?: ITag;
|
currentFilterItem?: ITag;
|
||||||
isLogsDataSource: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function QueryBuilderSearchDropdown(
|
export default function QueryBuilderSearchDropdown(
|
||||||
@ -40,14 +38,11 @@ export default function QueryBuilderSearchDropdown(
|
|||||||
exampleQueries,
|
exampleQueries,
|
||||||
options,
|
options,
|
||||||
onChange,
|
onChange,
|
||||||
isLogsDataSource,
|
|
||||||
} = props;
|
} = props;
|
||||||
const userOs = getUserOperatingSystem();
|
const userOs = getUserOperatingSystem();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div className="content">
|
||||||
className={cx('content', { 'non-logs-data-source': !isLogsDataSource })}
|
|
||||||
>
|
|
||||||
{!currentFilterItem?.key ? (
|
{!currentFilterItem?.key ? (
|
||||||
<div className="suggested-filters">Suggested Filters</div>
|
<div className="suggested-filters">Suggested Filters</div>
|
||||||
) : !currentFilterItem?.op ? (
|
) : !currentFilterItem?.op ? (
|
||||||
|
@ -11,11 +11,6 @@
|
|||||||
.rc-virtual-list-holder {
|
.rc-virtual-list-holder {
|
||||||
height: 115px;
|
height: 115px;
|
||||||
}
|
}
|
||||||
&.non-logs-data-source {
|
|
||||||
.rc-virtual-list-holder {
|
|
||||||
height: 256px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -689,29 +689,12 @@ function QueryBuilderSearchV2(
|
|||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
setDropdownOptions([
|
setDropdownOptions(
|
||||||
// Add user typed option if it doesn't exist in the payload
|
data?.payload?.attributeKeys?.map((key) => ({
|
||||||
...(!isEmpty(tagKey) &&
|
|
||||||
!data?.payload?.attributeKeys?.some((val) => isEqual(val.key, tagKey))
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
label: tagKey,
|
|
||||||
value: {
|
|
||||||
key: tagKey,
|
|
||||||
dataType: DataTypes.EMPTY,
|
|
||||||
type: '',
|
|
||||||
isColumn: false,
|
|
||||||
isJSON: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
// Map existing attribute keys from payload
|
|
||||||
...(data?.payload?.attributeKeys?.map((key) => ({
|
|
||||||
label: key.key,
|
label: key.key,
|
||||||
value: key,
|
value: key,
|
||||||
})) || []),
|
})) || [],
|
||||||
]);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currentState === DropdownState.OPERATOR) {
|
if (currentState === DropdownState.OPERATOR) {
|
||||||
@ -981,7 +964,6 @@ function QueryBuilderSearchV2(
|
|||||||
exampleQueries={suggestionsData?.payload?.example_queries || []}
|
exampleQueries={suggestionsData?.payload?.example_queries || []}
|
||||||
tags={tags}
|
tags={tags}
|
||||||
currentFilterItem={currentFilterItem}
|
currentFilterItem={currentFilterItem}
|
||||||
isLogsDataSource={isLogsDataSource}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
@ -170,7 +170,11 @@ export const useOptions = (
|
|||||||
(option, index, self) =>
|
(option, index, self) =>
|
||||||
index ===
|
index ===
|
||||||
self.findIndex(
|
self.findIndex(
|
||||||
(o) => o.label === option.label && o.value === option.value, // to remove duplicate & empty options from list
|
(o) =>
|
||||||
|
// to remove duplicate & empty options from list
|
||||||
|
o.label === option.label &&
|
||||||
|
o.value === option.value &&
|
||||||
|
o.dataType?.toLowerCase() === option.dataType?.toLowerCase(), // handle case sensitivity
|
||||||
) && option.value !== '',
|
) && option.value !== '',
|
||||||
) || []
|
) || []
|
||||||
).map((option) => {
|
).map((option) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user