Skip to content

Commit 47f17f7

Browse files
Merge pull request #3971 from RedisInsight/fe/feature/RI-6172-remove-search-page
#RRI-6172 - remove search page
2 parents 474cbfd + 159f739 commit 47f17f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+84
-6446
lines changed

redisinsight/ui/src/components/main-router/constants/defaultRoutes.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import RdiPage from 'uiSrc/pages/rdi/home'
1616
import RdiInstancePage from 'uiSrc/pages/rdi/instance'
1717
import RdiStatisticsPage from 'uiSrc/pages/rdi/statistics'
1818
import PipelineManagementPage from 'uiSrc/pages/rdi/pipeline-management'
19-
import SearchPage from 'uiSrc/pages/search'
2019
import { ANALYTICS_ROUTES, RDI_PIPELINE_MANAGEMENT_ROUTES } from './sub-routes'
2120

2221
import COMMON_ROUTES from './commonRoutes'
@@ -32,11 +31,6 @@ const INSTANCE_ROUTES: IRoute[] = [
3231
path: Pages.workbench(':instanceId'),
3332
component: WorkbenchPage,
3433
},
35-
{
36-
pageName: PageNames.search,
37-
path: Pages.search(':instanceId'),
38-
component: SearchPage,
39-
},
4034
{
4135
pageName: PageNames.pubSub,
4236
path: Pages.pubSub(':instanceId'),

redisinsight/ui/src/components/main-router/constants/redisStackRoutes.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import EditConnection from 'uiSrc/pages/redis-stack/components/edit-connection'
99
import ClusterDetailsPage from 'uiSrc/pages/cluster-details'
1010
import AnalyticsPage from 'uiSrc/pages/analytics'
1111
import DatabaseAnalysisPage from 'uiSrc/pages/database-analysis'
12-
import SearchPage from 'uiSrc/pages/search'
1312
import COMMON_ROUTES from './commonRoutes'
1413

1514
const ANALYTICS_ROUTES: IRoute[] = [
@@ -46,12 +45,6 @@ const INSTANCE_ROUTES: IRoute[] = [
4645
path: Pages.workbench(':instanceId'),
4746
component: WorkbenchPage,
4847
},
49-
{
50-
pageName: PageNames.search,
51-
protected: true,
52-
path: Pages.search(':instanceId'),
53-
component: SearchPage,
54-
},
5548
{
5649
pageName: PageNames.pubSub,
5750
protected: true,

redisinsight/ui/src/components/monaco-laguages/MonacoLanguages.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ import { useSelector } from 'react-redux'
33
import { monaco } from 'react-monaco-editor'
44
import { findIndex } from 'lodash'
55
import { appRedisCommandsSelector } from 'uiSrc/slices/app/redis-commands'
6-
import { MonacoLanguage, redisLanguageConfig, Theme } from 'uiSrc/constants'
6+
import { MonacoLanguage, redisLanguageConfig, Theme, IRedisCommandTree } from 'uiSrc/constants'
77
import { getRedisMonarchTokensProvider } from 'uiSrc/utils'
88
import { darkTheme, lightTheme, MonacoThemes } from 'uiSrc/constants/monaco'
99
import { ThemeContext } from 'uiSrc/contexts/themeContext'
1010

1111
import { getRediSearchSubRedisMonarchTokensProvider } from 'uiSrc/utils/monaco/monarchTokens/redisearchTokensSubRedis'
1212
import SEARCH_COMMANDS_SPEC from 'uiSrc/pages/workbench/data/supported_commands.json'
1313
import { mergeRedisCommandsSpecs } from 'uiSrc/utils/transformers/redisCommands'
14-
import { SearchCommandTree } from 'uiSrc/pages/search/types'
1514
import { ModuleCommandPrefix } from 'uiSrc/pages/workbench/constants'
1615

1716
const MonacoLanguages = () => {
@@ -44,7 +43,7 @@ const MonacoLanguages = () => {
4443
}
4544

4645
monaco.languages.setLanguageConfiguration(MonacoLanguage.Redis, redisLanguageConfig)
47-
const REDIS_COMMANDS = mergeRedisCommandsSpecs(COMMANDS_SPEC, SEARCH_COMMANDS_SPEC) as SearchCommandTree[]
46+
const REDIS_COMMANDS = mergeRedisCommandsSpecs(COMMANDS_SPEC, SEARCH_COMMANDS_SPEC) as IRedisCommandTree[]
4847
const REDIS_SEARCH_COMMANDS = REDIS_COMMANDS.filter(({ name }) => name?.startsWith(ModuleCommandPrefix.RediSearch))
4948

5049
monaco.languages.setMonarchTokensProvider(

redisinsight/ui/src/components/navigation-menu/NavigationMenu.spec.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ describe('NavigationMenu', () => {
129129

130130
expect(screen.getByTestId('browser-page-btn')).toBeTruthy()
131131
expect(screen.getByTestId('workbench-page-btn')).toBeTruthy()
132-
expect(screen.getByTestId('search-page-btn')).toBeTruthy()
133132
})
134133

135134
it('should render public routes', () => {

redisinsight/ui/src/components/navigation-menu/NavigationMenu.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import BrowserSVG from 'uiSrc/assets/img/sidebar/browser.svg'
2626
import BrowserActiveSVG from 'uiSrc/assets/img/sidebar/browser_active.svg'
2727
import WorkbenchSVG from 'uiSrc/assets/img/sidebar/workbench.svg'
2828
import WorkbenchActiveSVG from 'uiSrc/assets/img/sidebar/workbench_active.svg'
29-
import SearchSVG from 'uiSrc/assets/img/sidebar/search.svg'
30-
import SearchActiveSVG from 'uiSrc/assets/img/sidebar/search_active.svg'
3129
import SlowLogSVG from 'uiSrc/assets/img/sidebar/slowlog.svg'
3230
import SlowLogActiveSVG from 'uiSrc/assets/img/sidebar/slowlog_active.svg'
3331
import PubSubSVG from 'uiSrc/assets/img/sidebar/pubsub.svg'
@@ -124,21 +122,6 @@ const NavigationMenu = () => {
124122
},
125123
onboard: ONBOARDING_FEATURES.BROWSER_PAGE
126124
},
127-
{
128-
tooltipText: 'Search and Query',
129-
pageName: PageNames.search,
130-
ariaLabel: 'Search and Query page button',
131-
onClick: () => handleGoPage(Pages.search(connectedInstanceId)),
132-
dataTestId: 'search-page-btn',
133-
connectedInstanceId,
134-
isActivePage: activePage === `/${PageNames.search}`,
135-
getClassName() {
136-
return cx(styles.navigationButton, { [styles.active]: this.isActivePage })
137-
},
138-
getIconType() {
139-
return this.isActivePage ? SearchSVG : SearchActiveSVG
140-
},
141-
},
142125
{
143126
tooltipText: 'Workbench',
144127
pageName: PageNames.workbench,

redisinsight/ui/src/components/query/query-card/QueryCard.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useParams } from 'react-router-dom'
66
import { isNull } from 'lodash'
77

88
import { DEFAULT_TEXT_VIEW_TYPE, ProfileQueryType, WBQueryType } from 'uiSrc/pages/workbench/constants'
9-
import { CommandExecutionType, ResultsMode, ResultsSummary, RunQueryMode } from 'uiSrc/slices/interfaces/workbench'
9+
import { ResultsMode, ResultsSummary, RunQueryMode } from 'uiSrc/slices/interfaces/workbench'
1010
import { getVisualizationsByCommand, getWBQueryType, isGroupResults, isSilentModeWithoutError, Maybe, } from 'uiSrc/utils'
1111
import { appPluginsSelector } from 'uiSrc/slices/app/plugins'
1212
import { CommandExecutionResult, IPluginVisualization } from 'uiSrc/slices/interfaces'
@@ -30,7 +30,6 @@ export interface Props {
3030
activeResultsMode?: ResultsMode
3131
resultsMode?: ResultsMode
3232
emptyCommand?: boolean
33-
executionType?: CommandExecutionType
3433
summary?: ResultsSummary
3534
createdAt?: Date
3635
loading?: boolean
@@ -68,7 +67,6 @@ const QueryCard = (props: Props) => {
6867
mode,
6968
activeResultsMode,
7069
resultsMode,
71-
executionType = CommandExecutionType.Workbench,
7270
summary,
7371
isOpen,
7472
createdAt,
@@ -113,9 +111,7 @@ const QueryCard = (props: Props) => {
113111
const toggleFullScreen = () => {
114112
setIsFullScreen((isFull) => {
115113
sendEventTelemetry({
116-
event: executionType === CommandExecutionType.Search
117-
? TelemetryEvent.SEARCH_RESULTS_IN_FULL_SCREEN
118-
: TelemetryEvent.WORKBENCH_RESULTS_IN_FULL_SCREEN,
114+
event: TelemetryEvent.WORKBENCH_RESULTS_IN_FULL_SCREEN,
119115
eventData: {
120116
databaseId: instanceId,
121117
state: isFull ? 'Close' : 'Open'
@@ -182,7 +178,6 @@ const QueryCard = (props: Props) => {
182178
mode={mode}
183179
resultsMode={resultsMode}
184180
activeResultsMode={activeResultsMode}
185-
executionType={executionType}
186181
emptyCommand={emptyCommand}
187182
summary={summary}
188183
summaryText={getSummaryText(summary, resultsMode)}
@@ -223,7 +218,6 @@ const QueryCard = (props: Props) => {
223218
result={result}
224219
query={command}
225220
mode={mode}
226-
executionType={executionType}
227221
setMessage={setMessage}
228222
commandId={id}
229223
/>

redisinsight/ui/src/components/query/query-card/QueryCardCliPlugin/QueryCardCliPlugin.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { pluginApi } from 'uiSrc/services/PluginAPI'
77
import { ThemeContext } from 'uiSrc/contexts/themeContext'
88
import { getBaseApiUrl, Nullable, formatToText, replaceEmptyValue } from 'uiSrc/utils'
99
import { Theme } from 'uiSrc/constants'
10-
import { CommandExecutionResult, CommandExecutionType, IPluginVisualization, RunQueryMode } from 'uiSrc/slices/interfaces'
10+
import { CommandExecutionResult, IPluginVisualization, RunQueryMode } from 'uiSrc/slices/interfaces'
1111
import { PluginEvents } from 'uiSrc/plugins/pluginEvents'
1212
import { prepareIframeHtml } from 'uiSrc/plugins/pluginImport'
1313
import {
@@ -28,7 +28,6 @@ export interface Props {
2828
setMessage: (text: string) => void
2929
commandId: string
3030
mode?: RunQueryMode
31-
executionType?: CommandExecutionType
3231
}
3332

3433
enum StylesNamePostfix {
@@ -52,7 +51,6 @@ const QueryCardCliPlugin = (props: Props) => {
5251
setMessage,
5352
commandId,
5453
mode = RunQueryMode.Raw,
55-
executionType
5654
} = props
5755
const { visualizations = [], staticPath } = useSelector(appPluginsSelector)
5856
const { modules = [] } = useSelector(connectedInstanceSelector)
@@ -93,7 +91,6 @@ const QueryCardCliPlugin = (props: Props) => {
9391
dispatch(
9492
sendPluginCommandAction({
9593
command,
96-
executionType,
9794
onSuccessAction: (response) => {
9895
sendMessageToPlugin({
9996
...commonOptions,

redisinsight/ui/src/components/query/query-card/QueryCardHeader/QueryCardHeader.tsx

Lines changed: 22 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,21 @@ import {
1919
getCommandNameFromQuery,
2020
getVisualizationsByCommand,
2121
isGroupMode,
22-
isGroupResults,
22+
truncateText,
23+
urlForAsset,
24+
truncateMilliseconds,
2325
isRawMode,
2426
isSilentMode,
2527
isSilentModeWithoutError,
26-
truncateMilliseconds,
27-
truncateText,
28-
urlForAsset,
28+
isGroupResults,
2929
} from 'uiSrc/utils'
3030
import { numberWithSpaces } from 'uiSrc/utils/numbers'
3131
import { ThemeContext } from 'uiSrc/contexts/themeContext'
3232
import { appPluginsSelector } from 'uiSrc/slices/app/plugins'
3333
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
34-
import {
35-
getProfileViewTypeOptions,
36-
getViewTypeOptions,
37-
isCommandAllowedForProfile,
38-
ProfileQueryType,
39-
WBQueryType
40-
} from 'uiSrc/pages/workbench/constants'
41-
import { CommandExecutionType, IPluginVisualization } from 'uiSrc/slices/interfaces'
42-
import { ResultsMode, ResultsSummary, RunQueryMode } from 'uiSrc/slices/interfaces/workbench'
34+
import { getViewTypeOptions, WBQueryType, getProfileViewTypeOptions, ProfileQueryType, isCommandAllowedForProfile } from 'uiSrc/pages/workbench/constants'
35+
import { IPluginVisualization } from 'uiSrc/slices/interfaces'
36+
import { RunQueryMode, ResultsMode, ResultsSummary } from 'uiSrc/slices/interfaces/workbench'
4337
import { appRedisCommandsSelector } from 'uiSrc/slices/app/redis-commands'
4438
import { FormatedDate, FullScreen } from 'uiSrc/components'
4539

@@ -63,7 +57,6 @@ export interface Props {
6357
mode?: RunQueryMode
6458
resultsMode?: ResultsMode
6559
activeResultsMode?: ResultsMode
66-
executionType?: CommandExecutionType
6760
summary?: ResultsSummary
6861
summaryText?: string
6962
queryType: WBQueryType
@@ -109,7 +102,6 @@ const QueryCardHeader = (props: Props) => {
109102
createdAt,
110103
mode,
111104
resultsMode,
112-
executionType,
113105
summary,
114106
activeResultsMode,
115107
summaryText,
@@ -129,7 +121,6 @@ const QueryCardHeader = (props: Props) => {
129121
const { instanceId = '' } = useParams<{ instanceId: string }>()
130122

131123
const { theme } = useContext(ThemeContext)
132-
const isExecuteTypeSearch = executionType === CommandExecutionType.Search
133124

134125
const eventStop = (event: React.MouseEvent) => {
135126
event.preventDefault()
@@ -148,12 +139,7 @@ const QueryCardHeader = (props: Props) => {
148139
}
149140

150141
const handleCopy = (event: React.MouseEvent, query: string) => {
151-
sendEvent(
152-
isExecuteTypeSearch
153-
? TelemetryEvent.SEARCH_COMMAND_COPIED
154-
: TelemetryEvent.WORKBENCH_COMMAND_COPIED,
155-
query
156-
)
142+
sendEvent(TelemetryEvent.WORKBENCH_COMMAND_COPIED, query)
157143
eventStop(event)
158144
navigator.clipboard?.writeText?.(query)
159145
}
@@ -168,29 +154,24 @@ const QueryCardHeader = (props: Props) => {
168154
const previousView = options.find(({ id }) => id === selectedValue)
169155
const type = currentView.value
170156
setSelectedValue(type as WBQueryType, initValue)
171-
sendEvent(isExecuteTypeSearch
172-
? TelemetryEvent.SEARCH_RESULT_VIEW_CHANGED
173-
: TelemetryEvent.WORKBENCH_RESULT_VIEW_CHANGED,
174-
query,
175-
{
176-
rawMode: isRawMode(activeMode),
177-
group: isGroupMode(activeResultsMode),
178-
previousView: previousView?.name,
179-
isPreviousViewInternal: !!previousView?.internal,
180-
currentView: currentView?.name,
181-
isCurrentViewInternal: !!currentView?.internal,
182-
})
157+
sendEvent(
158+
TelemetryEvent.WORKBENCH_RESULT_VIEW_CHANGED,
159+
query,
160+
{
161+
rawMode: isRawMode(activeMode),
162+
group: isGroupMode(activeResultsMode),
163+
previousView: previousView?.name,
164+
isPreviousViewInternal: !!previousView?.internal,
165+
currentView: currentView?.name,
166+
isCurrentViewInternal: !!currentView?.internal,
167+
}
168+
)
183169
}
184170

185171
const handleQueryDelete = (event: React.MouseEvent) => {
186172
eventStop(event)
187173
onQueryDelete()
188-
sendEvent(
189-
isExecuteTypeSearch
190-
? TelemetryEvent.SEARCH_CLEAR_RESULT_CLICKED
191-
: TelemetryEvent.WORKBENCH_CLEAR_RESULT_CLICKED,
192-
query
193-
)
174+
sendEvent(TelemetryEvent.WORKBENCH_CLEAR_RESULT_CLICKED, query)
194175
}
195176

196177
const handleQueryReRun = (event: React.MouseEvent) => {
@@ -200,14 +181,8 @@ const QueryCardHeader = (props: Props) => {
200181

201182
const handleToggleOpen = () => {
202183
if (!isFullScreen && !isSilentModeWithoutError(resultsMode, summary?.fail)) {
203-
const collapsedEventName = isExecuteTypeSearch
204-
? TelemetryEvent.SEARCH_RESULTS_COLLAPSED
205-
: TelemetryEvent.WORKBENCH_RESULTS_COLLAPSED
206-
const expandedEventName = isExecuteTypeSearch
207-
? TelemetryEvent.SEARCH_RESULTS_EXPANDED
208-
: TelemetryEvent.WORKBENCH_RESULTS_EXPANDED
209184
sendEvent(
210-
isOpen ? collapsedEventName : expandedEventName,
185+
isOpen ? TelemetryEvent.WORKBENCH_RESULTS_COLLAPSED : TelemetryEvent.WORKBENCH_RESULTS_EXPANDED,
211186
query
212187
)
213188
}

redisinsight/ui/src/components/side-panels/panels/ai-assistant/components/shared/markdown-message/components/code-block/CodeBlock.spec.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ describe('CodeBlock', () => {
2929
sendWBCommand({
3030
commandId: expect.any(String),
3131
commands: ['info'],
32-
executionType: CommandExecutionType.Workbench
3332
}),
3433
setDbIndexState(true)
3534
])

redisinsight/ui/src/components/side-panels/panels/ai-assistant/components/shared/markdown-message/components/code-block/CodeBlock.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { CodeButtonParams } from 'uiSrc/constants'
44
import { sendWbQueryAction } from 'uiSrc/slices/workbench/wb-results'
55
import { CodeButtonBlock } from 'uiSrc/components/markdown'
66
import { ButtonLang } from 'uiSrc/utils/formatters/markdown/remarkCode'
7-
import { CommandExecutionType } from 'uiSrc/slices/interfaces'
87
import { AdditionalRedisModule } from 'apiSrc/modules/database/models/additional.redis.module'
98

109
export interface Props {
@@ -25,7 +24,6 @@ const CodeBlock = (props: Props) => {
2524
children,
2625
null,
2726
params,
28-
CommandExecutionType.Workbench,
2927
{ afterAll: onFinish },
3028
onFinish
3129
))

0 commit comments

Comments
 (0)