Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with duplicate native browser functions. #1920

Merged
merged 1 commit into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [client] Fixed an issue with the transcripts path input inside of the resource settings dialog in PR [1836](https://github.com/microsoft/BotFramework-Emulator/pull/1836)
- [client] Implemented HTML app menu for Windows in PR [1893](https://github.com/microsoft/BotFramework-Emulator/pull/1893)
- [client/main] Migrated from Bing Speech API to Cognitive Services Speech API in PR [1878](https://github.com/microsoft/BotFramework-Emulator/pull/1878)
- [client] Fixed issue with certain native browser functions (cut, copy, paste, etc.) firing twice in PR [1920](https://github.com/microsoft/BotFramework-Emulator/pull/1920)


## v4.5.2 - 2019 - 07 - 17
Expand Down
40 changes: 0 additions & 40 deletions packages/app/client/src/utils/eventHandlers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ const {
let mockLocalCommandsCalled = [];
let mockRemoteCommandsCalled = [];
const mockCurrentWebContents = {
undo: jest.fn(),
redo: jest.fn(),
cut: jest.fn(),
copy: jest.fn(),
paste: jest.fn(),
setZoomLevel: jest.fn(),
getZoomFactor: jest.fn(),
setZoomFactor: jest.fn(),
Expand Down Expand Up @@ -165,41 +160,6 @@ describe('#globalHandlers', () => {
});
});

it('should perform an undo when Ctrl+Z is pressed', async () => {
const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'z' });
await globalHandlers(event);

expect(mockCurrentWebContents.undo).toHaveBeenCalled();
});

it('should perform a redo when Ctrl+Y is pressed', async () => {
const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'y' });
await globalHandlers(event);

expect(mockCurrentWebContents.redo).toHaveBeenCalled();
});

it('should perform a cut when Ctrl+X is pressed', async () => {
const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'x' });
await globalHandlers(event);

expect(mockCurrentWebContents.cut).toHaveBeenCalled();
});

it('should perform a copy when Ctrl+C is pressed', async () => {
const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'c' });
await globalHandlers(event);

expect(mockCurrentWebContents.copy).toHaveBeenCalled();
});

it('should perform a paste when Ctrl+V is pressed', async () => {
const event = new KeyboardEvent('keydown', { ctrlKey: true, key: 'v' });
await globalHandlers(event);

expect(mockCurrentWebContents.paste).toHaveBeenCalled();
});

it('should reset the zoom level when Ctrl+0 is pressed', async () => {
const event = new KeyboardEvent('keydown', { ctrlKey: true, key: '0' });
await globalHandlers(event);
Expand Down
25 changes: 0 additions & 25 deletions packages/app/client/src/utils/eventHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,6 @@ class EventHandlers {
awaitable = EventHandlers.commandService.call(ShowBotCreationDialog);
}

// Ctrl+Z
if (ctrlOrCmdPressed && key === 'z') {
remote.getCurrentWebContents().undo();
}

// Ctrl+Y
if (ctrlOrCmdPressed && key === 'y') {
remote.getCurrentWebContents().redo();
}

// Ctrl+X
if (ctrlOrCmdPressed && key === 'x') {
remote.getCurrentWebContents().cut();
}

// Ctrl+C
if (ctrlOrCmdPressed && key === 'c') {
remote.getCurrentWebContents().copy();
}

// Ctrl+V
if (ctrlOrCmdPressed && key === 'v') {
remote.getCurrentWebContents().paste();
}

// Ctrl+0
if (ctrlOrCmdPressed && key === '0') {
remote.getCurrentWebContents().setZoomLevel(0);
Expand Down