1
- import { EuiButtonIcon , EuiToolTip , keys } from '@elastic/eui'
1
+ import { keys } from '@elastic/eui'
2
2
import React , { useEffect , useState } from 'react'
3
3
import { useDispatch , useSelector } from 'react-redux'
4
4
import cx from 'classnames'
5
5
6
- import { useParams } from 'react-router-dom'
7
6
import MultiSearch from 'uiSrc/components/multi-search/MultiSearch'
8
7
import { SCAN_COUNT_DEFAULT , SCAN_TREE_COUNT_DEFAULT } from 'uiSrc/constants/api'
9
8
import { replaceSpaces } from 'uiSrc/utils'
10
9
import {
11
- changeExactMatch ,
12
10
deleteSearchHistoryAction ,
13
11
fetchKeys ,
14
12
fetchSearchHistoryAction ,
@@ -17,11 +15,13 @@ import {
17
15
setFilter ,
18
16
setSearchMatch
19
17
} from 'uiSrc/slices/browser/keys'
20
- import { KeyViewType , SearchHistoryItem , SearchMode } from 'uiSrc/slices/interfaces/keys'
21
- import { redisearchHistorySelector , redisearchSelector } from 'uiSrc/slices/browser/redisearch'
18
+ import { SearchMode , KeyViewType , SearchHistoryItem } from 'uiSrc/slices/interfaces/keys'
19
+ import {
20
+ redisearchHistorySelector ,
21
+ redisearchSelector
22
+ } from 'uiSrc/slices/browser/redisearch'
22
23
23
24
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
24
- import { sendEventTelemetry , TelemetryEvent } from 'uiSrc/telemetry'
25
25
import styles from './styles.module.scss'
26
26
27
27
const placeholders = {
@@ -31,7 +31,7 @@ const placeholders = {
31
31
32
32
const SearchKeyList = ( ) => {
33
33
const { id } = useSelector ( connectedInstanceSelector )
34
- const { search, viewType, searchMode, exactMatch } = useSelector ( keysSelector )
34
+ const { search, viewType, searchMode } = useSelector ( keysSelector )
35
35
const { search : redisearchQuery , selectedIndex } = useSelector ( redisearchSelector )
36
36
const { data : rediSearchHistory , loading : rediSearchHistoryLoading } = useSelector ( redisearchHistorySelector )
37
37
const { data : searchHistory , loading : searchHistoryLoading } = useSelector ( keysSearchHistorySelector )
@@ -40,7 +40,6 @@ const SearchKeyList = () => {
40
40
const [ disableSubmit , setDisableSubmit ] = useState ( false )
41
41
42
42
const dispatch = useDispatch ( )
43
- const { instanceId } = useParams < { instanceId : string } > ( )
44
43
45
44
useEffect ( ( ) => {
46
45
if ( id ) {
@@ -115,23 +114,6 @@ const SearchKeyList = () => {
115
114
handleApply ( '' )
116
115
}
117
116
118
- const handleChangeExactMatch = ( ) => {
119
- sendEventTelemetry ( {
120
- event : TelemetryEvent . BROWSER_FILTER_PER_PATTERN_CLICKED ,
121
- eventData : {
122
- databaseId : instanceId ,
123
- view : viewType ,
124
- previous : exactMatch ? 'Exact' : 'Pattern' ,
125
- current : exactMatch ? 'Pattern' : 'Exact' ,
126
- }
127
- } )
128
- dispatch ( changeExactMatch ( ! exactMatch ) )
129
-
130
- if ( value ) {
131
- handleApply ( )
132
- }
133
- }
134
-
135
117
return (
136
118
< div className = { cx ( styles . container , { [ styles . redisearchMode ] : searchMode === SearchMode . Redisearch } ) } >
137
119
< MultiSearch
@@ -148,24 +130,6 @@ const SearchKeyList = () => {
148
130
onApply : handleApplySuggestion ,
149
131
onDelete : handleDeleteSuggestions ,
150
132
} }
151
- optionalButton = { searchMode === SearchMode . Pattern ? (
152
- < EuiToolTip
153
- title = "Exact Search"
154
- content = { exactMatch ? 'Disable to see keys matching your pattern' : 'Enable to see keys that exactly match your pattern' }
155
- position = "bottom"
156
- >
157
- < EuiButtonIcon
158
- display = "empty"
159
- iconType = "bullseye"
160
- color = "primary"
161
- size = "xs"
162
- onClick = { handleChangeExactMatch }
163
- aria-label = "exact match button"
164
- className = { cx ( styles . exactSearchIcon , { [ styles . disabled ] : ! exactMatch } ) }
165
- data-testid = "exact-match-button"
166
- />
167
- </ EuiToolTip >
168
- ) : null }
169
133
disableSubmit = { disableSubmit }
170
134
placeholder = { placeholders [ searchMode ] }
171
135
className = { styles . input }
0 commit comments