File tree Expand file tree Collapse file tree 5 files changed +11
-35
lines changed
filters/QueryBuilderSearchV2 Expand file tree Collapse file tree 5 files changed +11
-35
lines changed Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ export const Query = memo(function Query({
453453 </ Col >
454454 ) }
455455 < Col flex = "1" className = "qb-search-container" >
456- { [ DataSource . LOGS , DataSource . TRACES ] . includes ( query . dataSource ) ? (
456+ { query . dataSource === DataSource . LOGS ? (
457457 < QueryBuilderSearchV2
458458 query = { query }
459459 onChange = { handleChangeTagFilters }
Original file line number Diff line number Diff line change 22import './QueryBuilderSearchV2.styles.scss' ;
33
44import { Typography } from 'antd' ;
5- import cx from 'classnames' ;
65import {
76 ArrowDown ,
87 ArrowUp ,
@@ -26,7 +25,6 @@ interface ICustomDropdownProps {
2625 exampleQueries : TagFilter [ ] ;
2726 onChange : ( value : TagFilter ) => void ;
2827 currentFilterItem ?: ITag ;
29- isLogsDataSource : boolean ;
3028}
3129
3230export default function QueryBuilderSearchDropdown (
@@ -40,14 +38,11 @@ export default function QueryBuilderSearchDropdown(
4038 exampleQueries,
4139 options,
4240 onChange,
43- isLogsDataSource,
4441 } = props ;
4542 const userOs = getUserOperatingSystem ( ) ;
4643 return (
4744 < >
48- < div
49- className = { cx ( 'content' , { 'non-logs-data-source' : ! isLogsDataSource } ) }
50- >
45+ < div className = "content" >
5146 { ! currentFilterItem ?. key ? (
5247 < div className = "suggested-filters" > Suggested Filters</ div >
5348 ) : ! currentFilterItem ?. op ? (
Original file line number Diff line number Diff line change 1111 .rc-virtual-list-holder {
1212 height : 115px ;
1313 }
14- & .non-logs-data-source {
15- .rc-virtual-list-holder {
16- height : 256px ;
17- }
18- }
1914 }
2015 }
2116
Original file line number Diff line number Diff line change @@ -689,29 +689,12 @@ function QueryBuilderSearchV2(
689689 } ) ) ,
690690 ) ;
691691 } else {
692- setDropdownOptions ( [
693- // Add user typed option if it doesn't exist in the payload
694- ...( ! isEmpty ( tagKey ) &&
695- ! data ?. payload ?. attributeKeys ?. some ( ( val ) => isEqual ( val . key , tagKey ) )
696- ? [
697- {
698- label : tagKey ,
699- value : {
700- key : tagKey ,
701- dataType : DataTypes . EMPTY ,
702- type : '' ,
703- isColumn : false ,
704- isJSON : false ,
705- } ,
706- } ,
707- ]
708- : [ ] ) ,
709- // Map existing attribute keys from payload
710- ...( data ?. payload ?. attributeKeys ?. map ( ( key ) => ( {
692+ setDropdownOptions (
693+ data ?. payload ?. attributeKeys ?. map ( ( key ) => ( {
711694 label : key . key ,
712695 value : key ,
713- } ) ) || [ ] ) ,
714- ] ) ;
696+ } ) ) || [ ] ,
697+ ) ;
715698 }
716699 }
717700 if ( currentState === DropdownState . OPERATOR ) {
@@ -981,7 +964,6 @@ function QueryBuilderSearchV2(
981964 exampleQueries = { suggestionsData ?. payload ?. example_queries || [ ] }
982965 tags = { tags }
983966 currentFilterItem = { currentFilterItem }
984- isLogsDataSource = { isLogsDataSource }
985967 />
986968 ) }
987969 >
Original file line number Diff line number Diff line change @@ -170,7 +170,11 @@ export const useOptions = (
170170 ( option , index , self ) =>
171171 index ===
172172 self . findIndex (
173- ( o ) => o . label === option . label && o . value === option . value , // to remove duplicate & empty options from list
173+ ( o ) =>
174+ // to remove duplicate & empty options from list
175+ o . label === option . label &&
176+ o . value === option . value &&
177+ o . dataType ?. toLowerCase ( ) === option . dataType ?. toLowerCase ( ) , // handle case sensitivity
174178 ) && option . value !== '' ,
175179 ) || [ ]
176180 ) . map ( ( option ) => {
You can’t perform that action at this time.
0 commit comments