Skip to content

Commit 34e429a

Browse files
authored
Merge pull request #1655 from RedisInsight/fe/bugfix-RI-3726-remove-workbench-changes
Fe/bugfix ri 3726 remove workbench changes (that were part of EXPLAIN/PROFILE command) for now
2 parents 6355f4c + dee1683 commit 34e429a

File tree

11 files changed

+2
-250
lines changed

11 files changed

+2
-250
lines changed

redisinsight/ui/src/assets/img/workbench/vis_tag_cloud.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import cx from 'classnames'
44
import { EuiLoadingContent, keys } from '@elastic/eui'
55
import { useParams } from 'react-router-dom'
66

7-
import { WBQueryType, ProfileQueryType } from 'uiSrc/pages/workbench/constants'
7+
import { WBQueryType } from 'uiSrc/pages/workbench/constants'
88
import { RunQueryMode, ResultsMode, ResultsSummary } from 'uiSrc/slices/interfaces/workbench'
99
import {
1010
getWBQueryType,
@@ -44,7 +44,6 @@ export interface Props {
4444
onQueryDelete: () => void
4545
onQueryReRun: () => void
4646
onQueryOpen: () => void
47-
onQueryProfile: (type: ProfileQueryType) => void
4847
}
4948

5049
const getDefaultPlugin = (views: IPluginVisualization[], query: string) =>
@@ -76,7 +75,6 @@ const QueryCard = (props: Props) => {
7675
createdAt,
7776
onQueryOpen,
7877
onQueryDelete,
79-
onQueryProfile,
8078
onQueryReRun,
8179
loading,
8280
emptyCommand,
@@ -188,7 +186,6 @@ const QueryCard = (props: Props) => {
188186
setSelectedValue={changeViewTypeSelected}
189187
onQueryDelete={onQueryDelete}
190188
onQueryReRun={onQueryReRun}
191-
onQueryProfile={onQueryProfile}
192189
/>
193190
{isOpen && (
194191
<>

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

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { numberWithSpaces } from 'uiSrc/utils/numbers'
3232
import { ThemeContext } from 'uiSrc/contexts/themeContext'
3333
import { appPluginsSelector } from 'uiSrc/slices/app/plugins'
3434
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
35-
import { getViewTypeOptions, WBQueryType, getProfileViewTypeOptions, ProfileQueryType, isCommandAllowedForProfile } from 'uiSrc/pages/workbench/constants'
35+
import { getViewTypeOptions, WBQueryType } from 'uiSrc/pages/workbench/constants'
3636
import { IPluginVisualization } from 'uiSrc/slices/interfaces'
3737
import { RunQueryMode, ResultsMode, ResultsSummary } from 'uiSrc/slices/interfaces/workbench'
3838
import { appRedisCommandsSelector } from 'uiSrc/slices/app/redis-commands'
@@ -70,7 +70,6 @@ export interface Props {
7070
setSelectedValue: (type: WBQueryType, value: string) => void
7171
onQueryDelete: () => void
7272
onQueryReRun: () => void
73-
onQueryProfile: (type: ProfileQueryType) => void
7473
}
7574

7675
const getExecutionTimeString = (value: number): string => {
@@ -239,30 +238,6 @@ const QueryCardHeader = (props: Props) => {
239238
}
240239
})
241240

242-
const profileOptions: EuiSuperSelectOption<any>[] = (getProfileViewTypeOptions() as any[]).map((item) => {
243-
const { value, id, text } = item
244-
return {
245-
value: id ?? value,
246-
inputDisplay: (
247-
<div className={cx(styles.dropdownOption, styles.dropdownProfileOption)}>
248-
<EuiIcon
249-
className={styles.iconDropdownOption}
250-
type="visTagCloud"
251-
data-testid={`view-type-selected-${value}-${id}`}
252-
/>
253-
</div>
254-
),
255-
dropdownDisplay: (
256-
<div className={cx(styles.dropdownOption, styles.dropdownProfileOption)}>
257-
<span>{truncateText(text, 20)}</span>
258-
</div>
259-
),
260-
'data-test-subj': `profile-type-option-${value}-${id}`,
261-
}
262-
})
263-
264-
const canCommandProfile = isCommandAllowedForProfile(query)
265-
266241
const indexForSeparator = findIndex(pluginsOptions, (option) => !option.internal)
267242
if (indexForSeparator > -1) {
268243
modifiedOptions.splice(indexForSeparator + 1, 0, {
@@ -346,26 +321,6 @@ const QueryCardHeader = (props: Props) => {
346321
</EuiToolTip>
347322
)}
348323
</EuiFlexItem>
349-
<EuiFlexItem
350-
grow={false}
351-
className={cx(styles.buttonIcon, styles.viewTypeIcon)}
352-
onClick={onDropDownViewClick}
353-
>
354-
{isOpen && canCommandProfile && !summaryText && (
355-
<div className={styles.dropdownWrapper}>
356-
<div className={styles.dropdown}>
357-
<EuiSuperSelect
358-
options={profileOptions}
359-
itemClassName={cx(styles.changeViewItem, styles.dropdownProfileItem)}
360-
className={cx(styles.changeView, styles.dropdownProfileIcon)}
361-
valueOfSelected={ProfileQueryType.Profile}
362-
onChange={(value: ProfileQueryType) => onQueryProfile(value)}
363-
data-testid="run-profile-type"
364-
/>
365-
</div>
366-
</div>
367-
)}
368-
</EuiFlexItem>
369324
<EuiFlexItem
370325
grow={false}
371326
className={cx(styles.buttonIcon, styles.viewTypeIcon)}

redisinsight/ui/src/components/query-card/QueryCardHeader/styles.module.scss

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -127,27 +127,6 @@ $marginIcon: 12px;
127127
height: 40px;
128128
}
129129

130-
.dropdownProfileIcon {
131-
padding: inherit !important;
132-
:global {
133-
.euiSuperSelectControl.euiFormControlLayoutIcons {
134-
display: none !important;
135-
}
136-
}
137-
}
138-
139-
.dropdownProfileOption {
140-
display: inherit !important;
141-
}
142-
143-
.dropdownProfileItem {
144-
:global {
145-
.euiContextMenu__icon {
146-
display: none !important;
147-
}
148-
}
149-
}
150-
151130
.dropdown {
152131
width: 168px;
153132
position: absolute;

redisinsight/ui/src/pages/workbench/components/wb-results/WBResults/WBResults.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import cx from 'classnames'
33
import { EuiIcon, EuiText } from '@elastic/eui'
44

55
import { Theme } from 'uiSrc/constants'
6-
import { ProfileQueryType } from 'uiSrc/pages/workbench/constants'
7-
import { generateProfileQueryForCommand } from 'uiSrc/pages/workbench/utils'
86
import { CodeButtonParams } from 'uiSrc/pages/workbench/components/enablement-area/interfaces'
97
import { Nullable } from 'uiSrc/utils'
108
import QueryCard from 'uiSrc/components/query-card'
@@ -23,15 +21,13 @@ export interface Props {
2321
onQueryReRun: (query: string, commandId?: Nullable<string>, executeParams?: CodeButtonParams) => void
2422
onQueryDelete: (commandId: string) => void
2523
onQueryOpen: (commandId: string) => void
26-
onQueryProfile: (query: string, commandId?: Nullable<string>, executeParams?: CodeButtonParams) => void
2724
}
2825
const WBResults = (props: Props) => {
2926
const {
3027
items = [],
3128
activeMode,
3229
activeResultsMode,
3330
onQueryReRun,
34-
onQueryProfile,
3531
onQueryDelete,
3632
onQueryOpen,
3733
scrollDivRef
@@ -90,16 +86,6 @@ const WBResults = (props: Props) => {
9086
resultsMode={resultsMode}
9187
db={db}
9288
onQueryOpen={() => onQueryOpen(id)}
93-
onQueryProfile={(profileType: ProfileQueryType) => {
94-
const profileQuery = generateProfileQueryForCommand(command, profileType)
95-
if (profileQuery) {
96-
return onQueryProfile(
97-
profileQuery,
98-
null,
99-
{ mode, results: resultsMode, clearEditor: false, },
100-
)
101-
}
102-
}}
10389
onQueryReRun={() => onQueryReRun(
10490
command,
10591
null,

redisinsight/ui/src/pages/workbench/components/wb-results/WBResultsWrapper.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export interface Props {
1313
onQueryReRun: (query: string, commandId?: Nullable<string>, executeParams?: CodeButtonParams) => void
1414
onQueryOpen: (commandId: string) => void
1515
onQueryDelete: (commandId: string) => void
16-
onQueryProfile: (query: string, commandId?: Nullable<string>, executeParams?: CodeButtonParams) => void
1716
}
1817

1918
const WBResultsWrapper = (props: Props) => (

redisinsight/ui/src/pages/workbench/components/wb-view/WBView/WBView.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,6 @@ const WBView = (props: Props) => {
117117
onSubmit(query, commandId, executeParams)
118118
}
119119

120-
const handleProfile = (query?: string, commandId?: Nullable<string>, executeParams: CodeButtonParams = {}) => {
121-
sendEventSubmitTelemetry(TelemetryEvent.WORKBENCH_COMMAND_PROFILE, query, executeParams)
122-
onSubmit(query, commandId, executeParams)
123-
}
124-
125120
const sendEventSubmitTelemetry = (
126121
event: TelemetryEvent,
127122
commandInit = script,
@@ -241,7 +236,6 @@ const WBView = (props: Props) => {
241236
activeResultsMode={resultsMode}
242237
scrollDivRef={scrollDivRef}
243238
onQueryReRun={handleReRun}
244-
onQueryProfile={handleProfile}
245239
onQueryOpen={onQueryOpen}
246240
onQueryDelete={onQueryDelete}
247241
/>

redisinsight/ui/src/pages/workbench/constants.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,40 +27,6 @@ export const VIEW_TYPE_OPTIONS = [
2727
export const getViewTypeOptions = () =>
2828
[...VIEW_TYPE_OPTIONS]
2929

30-
31-
export const SEARCH_COMMANDS = ['ft.search', 'ft.aggregate']
32-
export const GRAPH_COMMANDS = ['graph.query']
33-
34-
const ALLOWED_PROFILE_COMMANDS = [...SEARCH_COMMANDS, ...GRAPH_COMMANDS]
35-
36-
export const isCommandAllowedForProfile = (query: string) => {
37-
return ALLOWED_PROFILE_COMMANDS.includes(query?.split(' ')?.[0]?.toLowerCase())
38-
}
39-
40-
export enum ProfileQueryType {
41-
Profile = 'Profile',
42-
Explain = 'Explain'
43-
}
44-
45-
const PROFILE_VIEW_TYPE_OPTIONS = [
46-
{
47-
id: ProfileQueryType.Profile,
48-
text: 'Profile the command',
49-
name: 'Profile',
50-
value: WBQueryType.Text,
51-
},
52-
{
53-
id: ProfileQueryType.Explain,
54-
text: 'Explain the command',
55-
name: 'Explain',
56-
value: WBQueryType.Text,
57-
},
58-
]
59-
60-
export const getProfileViewTypeOptions = () =>
61-
[...PROFILE_VIEW_TYPE_OPTIONS]
62-
63-
6430
export enum ModuleCommandPrefix {
6531
RediSearch = 'FT.',
6632
}

redisinsight/ui/src/pages/workbench/utils.spec.ts

Lines changed: 0 additions & 79 deletions
This file was deleted.

redisinsight/ui/src/pages/workbench/utils.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)