@@ -26,6 +26,7 @@ import {
2626 selectTagKey ,
2727 selectTagValue ,
2828} from 'src/timeMachine/actions/queryBuilderThunks'
29+ import { isFlagEnabled } from 'src/shared/utils/featureFlag'
2930
3031import {
3132 setBuilderAggregateFunctionType ,
@@ -85,9 +86,29 @@ class TagSelector extends PureComponent<Props> {
8586 )
8687 }
8788
89+ private get isCompliant ( ) {
90+ const {
91+ index,
92+ selectedKey,
93+ selectedValues,
94+ aggregateFunctionType,
95+ } = this . props
96+
97+ return (
98+ isFlagEnabled ( 'newQueryBuilder' ) &&
99+ index === 0 &&
100+ selectedKey === '_measurement' &&
101+ aggregateFunctionType !== 'group' &&
102+ selectedValues . length <= 1
103+ )
104+ }
105+
88106 private get header ( ) {
89107 const { aggregateFunctionType, index, isInCheckOverlay} = this . props
90108
109+ if ( this . isCompliant ) {
110+ return null
111+ }
91112 return (
92113 < BuilderCard . DropdownHeader
93114 options = { [ 'filter' , 'group' ] }
@@ -133,6 +154,7 @@ class TagSelector extends PureComponent<Props> {
133154 : `Search ${ selectedKey } tag values`
134155 return (
135156 < >
157+ { this . isCompliant && < BuilderCard . Header title = "Measurement" /> }
136158 < BuilderCard . Menu testID = { `tag-selector--container ${ index } ` } >
137159 { aggregateFunctionType !== 'group' && (
138160 < FlexBox
@@ -141,19 +163,21 @@ class TagSelector extends PureComponent<Props> {
141163 margin = { ComponentSize . Small }
142164 >
143165 < ErrorBoundary >
144- < SearchableDropdown
145- searchTerm = { keysSearchTerm }
146- emptyText = "No Tags Found"
147- searchPlaceholder = "Search keys..."
148- buttonStatus = { toComponentStatus ( keysStatus ) }
149- selectedOption = { selectedKey }
150- onSelect = { this . handleSelectTag }
151- onChangeSearchTerm = { this . handleKeysSearch }
152- testID = "tag-selector--dropdown"
153- buttonTestID = "tag-selector--dropdown-button"
154- menuTestID = "tag-selector--dropdown-menu"
155- options = { keys }
156- />
166+ { ! this . isCompliant && (
167+ < SearchableDropdown
168+ searchTerm = { keysSearchTerm }
169+ emptyText = "No Tags Found"
170+ searchPlaceholder = "Search keys..."
171+ buttonStatus = { toComponentStatus ( keysStatus ) }
172+ selectedOption = { selectedKey }
173+ onSelect = { this . handleSelectTag }
174+ onChangeSearchTerm = { this . handleKeysSearch }
175+ testID = "tag-selector--dropdown"
176+ buttonTestID = "tag-selector--dropdown-button"
177+ menuTestID = "tag-selector--dropdown-menu"
178+ options = { keys }
179+ />
180+ ) }
157181 </ ErrorBoundary >
158182 { this . selectedCounter }
159183 </ FlexBox >
@@ -206,7 +230,7 @@ class TagSelector extends PureComponent<Props> {
206230 items = { values }
207231 selectedItems = { selectedValues }
208232 onSelectItem = { this . handleSelectValue }
209- multiSelect = { ! this . props . isInCheckOverlay }
233+ multiSelect = { ! this . props . isInCheckOverlay || this . isCompliant }
210234 />
211235 )
212236 }
0 commit comments