fix: Debugger shortcut is line deletion shortcut on the editor (#24725)

## Description
fix: Debugger shortcut is line deletion shortcut on the editor

#### PR fixes following issue(s)
Fixes #22499 

#### Type of change
- Bug fix (non-breaking change which fixes an issue)

## Testing

#### How Has This Been Tested?
- [x] Manual

#### Test Plan
Checked keyboard shortcut behaviour on the editor
>
>
#### Issues raised during DP testing
none
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [x] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
This commit is contained in:
Druthi Polisetty 2023-06-26 15:11:40 +05:30 committed by GitHub
parent 4480d0c8d0
commit 85703c65b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -157,6 +157,7 @@ import { debug } from "loglevel";
import { PeekOverlayExpressionIdentifier, SourceType } from "@shared/ast";
import type { MultiplexingModeConfig } from "components/editorComponents/CodeEditor/modes";
import { MULTIPLEXING_MODE_CONFIGS } from "components/editorComponents/CodeEditor/modes";
import { getDeleteLineShortcut } from "./utils/deleteLine";
type ReduxStateProps = ReturnType<typeof mapStateToProps>;
type ReduxDispatchProps = ReturnType<typeof mapDispatchToProps>;
@ -379,6 +380,9 @@ class CodeEditor extends Component<Props, State> {
saveAndAutoIndentCode(editor);
AnalyticsUtil.logEvent("PRETTIFY_AND_SAVE_KEYBOARD_SHORTCUT");
},
[getDeleteLineShortcut()]: () => {
return;
},
};
if (this.props.tabBehaviour === TabBehaviour.INPUT) {

View File

@ -0,0 +1,7 @@
import { getPlatformOS } from "utils/helpers";
import { KEYBOARD_SHORTCUTS_BY_PLATFORM } from "./keyboardShortcutConstants";
export const getDeleteLineShortcut = () => {
const platformOS = getPlatformOS() || "default";
return KEYBOARD_SHORTCUTS_BY_PLATFORM[platformOS].deleteLine;
};

View File

@ -7,6 +7,7 @@ export const KEYBOARD_SHORTCUTS_BY_PLATFORM = {
autoIndentShortcut: "Shift-Cmd-P",
autoIndentShortcutText: "Shift + Cmd + P",
codeComment: "Cmd-/",
deleteLine: "Cmd-D",
},
[PLATFORM_OS.IOS]: {
saveAndAutoIndent: "Cmd-S",
@ -14,6 +15,7 @@ export const KEYBOARD_SHORTCUTS_BY_PLATFORM = {
autoIndentShortcut: "Shift-Cmd-P",
autoIndentShortcutText: "Shift + Cmd + P",
codeComment: "Cmd-/",
deleteLine: "Cmd-D",
},
[PLATFORM_OS.WINDOWS]: {
saveAndAutoIndent: "Ctrl-S",
@ -21,6 +23,7 @@ export const KEYBOARD_SHORTCUTS_BY_PLATFORM = {
autoIndentShortcut: "Shift-Alt-F",
autoIndentShortcutText: "Shift + Alt + F",
codeComment: "Ctrl-/",
deleteLine: "Ctrl-D",
},
[PLATFORM_OS.ANDROID]: {
saveAndAutoIndent: "Ctrl-S",
@ -28,6 +31,7 @@ export const KEYBOARD_SHORTCUTS_BY_PLATFORM = {
autoIndentShortcut: "Shift-Alt-F",
autoIndentShortcutText: "Shift + Alt + F",
codeComment: "Ctrl-/",
deleteLine: "Ctrl-D",
},
[PLATFORM_OS.LINUX]: {
saveAndAutoIndent: "Ctrl-S",
@ -35,6 +39,7 @@ export const KEYBOARD_SHORTCUTS_BY_PLATFORM = {
autoIndentShortcut: "Shift-Ctrl-I",
autoIndentShortcutText: "Shift + Ctrl + I",
codeComment: "Ctrl-/",
deleteLine: "Ctrl-D",
},
default: {
saveAndAutoIndent: "Ctrl-S",
@ -42,5 +47,6 @@ export const KEYBOARD_SHORTCUTS_BY_PLATFORM = {
autoIndentShortcut: "Shift-Alt-F",
autoIndentShortcutText: "Shift + Alt + F",
codeComment: "Ctrl-/",
deleteLine: "Ctrl-D",
},
};