Skip to content

Commit 7fdc939

Browse files
authored
Merge pull request #1200 from RedisInsight/fe/feature/RI-3587-group-mode-shortcut
#RI-3587 - change tooltip text, remove keyboard shortcut
2 parents a656fcf + 3c988b7 commit 7fdc939

File tree

8 files changed

+14
-54
lines changed

8 files changed

+14
-54
lines changed

redisinsight/ui/src/components/query/Query/Query.tsx

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ const aroundQuotesRegExp = /(^["']|["']$)/g
6666
let decorations: string[] = []
6767
let execHistoryPos: number = 0
6868
let execHistory: CommandExecutionUI[] = []
69-
let toggleGroupMode: () => void = () => {}
7069

7170
const Query = (props: Props) => {
7271
const {
@@ -118,11 +117,6 @@ const Query = (props: Props) => {
118117
execHistoryPos = 0
119118
}, [execHistoryItems])
120119

121-
useEffect(() => {
122-
// HACK: The Monaco editor memoize the state and ignores updates to it
123-
toggleGroupMode = onChangeGroupMode
124-
}, [resultsMode])
125-
126120
useEffect(() => {
127121
if (!monacoObjects.current) return
128122
const commands = query.split('\n')
@@ -406,10 +400,6 @@ const Query = (props: Props) => {
406400
getMonacoAction(MonacoAction.Submit, (editor) => handleSubmit(editor.getValue()), monaco)
407401
)
408402

409-
editor.addAction(
410-
getMonacoAction(MonacoAction.ChangeGroupMode, () => toggleGroupMode(), monaco)
411-
)
412-
413403
editor.addCommand(monaco.KeyMod.Shift | monaco.KeyCode.Space, () => {
414404
onPressWidget()
415405
}, SYNTAX_CONTEXT_ID)
@@ -543,18 +533,7 @@ const Query = (props: Props) => {
543533
</EuiToolTip>
544534
<EuiToolTip
545535
position="left"
546-
content={
547-
KEYBOARD_SHORTCUTS?.workbench?.changeGroupMode && (
548-
<div style={{ display: 'flex', alignItems: 'baseline' }}>
549-
<EuiText className={styles.tooltipText} size="s">{`${KEYBOARD_SHORTCUTS.workbench.changeGroupMode?.label}:\u00A0\u00A0`}</EuiText>
550-
<KeyboardShortcut
551-
badgeTextClassName={styles.tooltipText}
552-
separator={KEYBOARD_SHORTCUTS?._separator}
553-
items={KEYBOARD_SHORTCUTS.workbench.changeGroupMode.keys}
554-
/>
555-
</div>
556-
)
557-
}
536+
content="Group Results"
558537
data-testid="run-query-tooltip"
559538
>
560539
<>

redisinsight/ui/src/components/shortcuts-flyout/schema.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export const SHORTCUTS: ShortcutGroup[] = [
3838
name: 'Workbench',
3939
items: [
4040
KEYBOARD_SHORTCUTS.workbench.runQuery,
41-
KEYBOARD_SHORTCUTS.workbench.changeGroupMode,
4241
KEYBOARD_SHORTCUTS.workbench.nextLine,
4342
KEYBOARD_SHORTCUTS.workbench.listOfCommands,
4443
KEYBOARD_SHORTCUTS.workbench.triggerHints,

redisinsight/ui/src/constants/keyboardShortcuts.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ const COMMON_SHORTCUTS = {
4242
description: 'Run Command',
4343
keys: ['Ctrl', 'Enter'],
4444
},
45-
changeGroupMode: {
46-
label: 'Group Mode',
47-
description: 'Toggle the group mode in Workbench',
48-
keys: ['Ctrl', 'Shift', 'G'],
49-
},
5045
nextLine: {
5146
description: 'Go to the next line',
5247
keys: ['Enter'],
@@ -110,11 +105,6 @@ const MAC_SHORTCUTS = {
110105
description: 'Run Command',
111106
keys: [(<span className="cmdSymbol"></span>), 'Enter'],
112107
},
113-
changeGroupMode: {
114-
label: 'Group Mode',
115-
description: 'Toggle the group mode in Workbench',
116-
keys: [(<span className="cmdSymbol"></span>), 'Shift', 'G'],
117-
},
118108
nextLine: {
119109
description: 'Go to the next line',
120110
keys: ['Enter'],

redisinsight/ui/src/pages/settings/components/workbench-settings/WorkbenchSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const WorkbenchSettings = () => {
5858
initValue={batchSize.toString()}
5959
onApply={handleApplyPipelineCountChanges}
6060
validation={(value) => validateNumber(value)}
61-
title="Pipeline mode"
61+
title="Pipeline Mode"
6262
testid="pipeline-bunch"
6363
placeholder={`${PIPELINE_COUNT_DEFAULT}`}
6464
label="Commands in pipeline:"

redisinsight/ui/src/utils/monacoActions.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@ export const getMonacoAction = (
1919
}
2020
}
2121

22-
if (actionId === MonacoAction.ChangeGroupMode) {
23-
return {
24-
id: 'change-group-mode',
25-
label: 'Group Mode',
26-
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.KEY_G],
27-
run: action
28-
}
29-
}
30-
3122
return { id: '', label: '', run: () => {} }
3223
}
3324

tests/e2e/tests/regression/workbench/editor-cleanup.e2e.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ test('Disabled Editor Cleanup toggle behavior', async t => {
3232
await t.click(settingsPage.accordionWorkbenchSettings);
3333
// Disable Editor Cleanup
3434
await t.click(settingsPage.switchEditorCleanupOption);
35+
// Verify that user can see text "Clear the Editor after running commands" for Editor Cleanup In Settings
36+
await t.expect(settingsPage.switchEditorCleanupOption.sibling(0).withExactText('Clear the Editor after running commands').visible).ok('Cleanup text is not correct');
3537
// Go to Workbench page
3638
await t.click(myRedisDatabasePage.workbenchButton);
3739
// Send commands

tests/e2e/tests/regression/workbench/group-mode.e2e.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ test('Verify that user can run the commands from the Editor in the group mode',
3838
// Verify that if the only one command is executed in group, the result will be displayed as for group mode
3939
await workbenchPage.sendCommandInWorkbench(`${command}`);
4040
await t.expect(workbenchPage.queryCardCommand.textContent).eql('1 Command(s) - 1 success, 0 error(s)', 'Not valid summary for 1 command');
41-
// Verify that user can use keyboard shortcut Ctrl+Shift+G to enable the group mode
42-
await t.click(workbenchPage.queryInput);
43-
await t.pressKey('shift+ctrl+g');
41+
// Turn off group mode
42+
await t.click(workbenchPage.groupMode);
4443
await workbenchPage.sendCommandInWorkbench(commandsString);
4544
await t.expect(workbenchPage.queryCardCommand.textContent).notEql(`${commandsNumber} Command(s) - ${commandsNumber} success, 0 error(s)`, 'Commands are sent in groups');
4645
for (let i = 0; i++; i < commandsNumber) {

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,19 +2781,19 @@
27812781
dependencies:
27822782
"@types/react" "*"
27832783

2784-
"@types/react@*", "@types/react@^17.0.1":
2785-
version "17.0.37"
2786-
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.37.tgz#6884d0aa402605935c397ae689deed115caad959"
2787-
integrity sha512-2FS1oTqBGcH/s0E+CjrCCR9+JMpsu9b69RTFO+40ua43ZqP5MmQ4iUde/dMjWR909KxZwmOQIFq6AV6NjEG5xg==
2784+
"@types/react@*", "@types/react@^18.0.20":
2785+
version "18.0.20"
2786+
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.20.tgz#e4c36be3a55eb5b456ecf501bd4a00fd4fd0c9ab"
2787+
integrity sha512-MWul1teSPxujEHVwZl4a5HxQ9vVNsjTchVA+xRqv/VYGCuKGAU6UhfrTdF5aBefwD1BHUD8i/zq+O/vyCm/FrA==
27882788
dependencies:
27892789
"@types/prop-types" "*"
27902790
"@types/scheduler" "*"
27912791
csstype "^3.0.2"
27922792

2793-
"@types/react@^18.0.20":
2794-
version "18.0.20"
2795-
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.20.tgz#e4c36be3a55eb5b456ecf501bd4a00fd4fd0c9ab"
2796-
integrity sha512-MWul1teSPxujEHVwZl4a5HxQ9vVNsjTchVA+xRqv/VYGCuKGAU6UhfrTdF5aBefwD1BHUD8i/zq+O/vyCm/FrA==
2793+
"@types/react@^17.0.1":
2794+
version "17.0.37"
2795+
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.37.tgz#6884d0aa402605935c397ae689deed115caad959"
2796+
integrity sha512-2FS1oTqBGcH/s0E+CjrCCR9+JMpsu9b69RTFO+40ua43ZqP5MmQ4iUde/dMjWR909KxZwmOQIFq6AV6NjEG5xg==
27972797
dependencies:
27982798
"@types/prop-types" "*"
27992799
"@types/scheduler" "*"

0 commit comments

Comments
 (0)