Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit 860b5f2

Browse files
authored
Merge v4.12.0 release into main branch (#2240)
* Added ability to debug shared package (redux state). * Bumped Web Chat to 4.12.0 * Integrated inspector with new WC activity focus hook * Updated fallback speech service ponyfill API * Fixed WC send box overflow visual bug * Added changelog entry * v4.12.0 Release * Fixed opening files via electron's dialog API (#2237) * Fixed opening files via electron's dialog API * Added a changelog entry. * Fixed a bug that was causing Electron's context menu to fail (#2238) * Updated 4.12.0 release date * Fixed split button caret icon alignment (#2239) * Categorized 4.12.0 changes * Updated path to electron-builder hashFile utility
1 parent 5e2ea09 commit 860b5f2

9 files changed

Lines changed: 83 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## Unreleased
8+
9+
## v4.12.0 - 2021 - 3 - 04
10+
## Added
811
- [client/main] Added UI to open bot dialog that allows the user to set transcript testing properties `randomSeed` and `randomValue` in PR [2209](https://github.com/microsoft/BotFramework-Emulator/pull/2209)
912
- [client] Added a dialog to the "Conversation -> Send System Activity" menu that allows the user to send custom activity payloads to their bot in PR [2213](https://github.com/microsoft/BotFramework-Emulator/pull/2213)
1013
- [main] Bumped `electron` from `4.1.1` to `11.0.1` in PR [2226](https://github.com/microsoft/BotFramework-Emulator/pull/2226)
1114
- [main] Bumped `electron-builder` to `22.9.1` and `electron-updater` to `4.3.5` to fix the Mac build in PR [2230](https://github.com/microsoft/BotFramework-Emulator/pull/2230)
12-
- [client] Re-enabled the `<webview>` tag in the client so that the inspectors show again in PR [2233](https://github.com/microsoft/BotFramework-Emulator/pull/2233)
1315
- [client] Bumped `botframework-webchat` to v4.12.0 and fixed various Web Chat-related bugs in PR [2236](https://github.com/microsoft/BotFramework-Emulator/pull/2236)
1416

17+
## Fixed
18+
- [client] Re-enabled the `<webview>` tag in the client so that the inspectors show again in PR [2233](https://github.com/microsoft/BotFramework-Emulator/pull/2233)
19+
- [main] Fixed a bug where we were expecting the incorrect shape from Electron's updated `dialog.showOpenDialog()` API in PR [2237](https://github.com/microsoft/BotFramework-Emulator/pull/2237)
20+
- [main] Fixed a bug that was causing Electron's native context menu to silently fail when selecting an option in PR [2238](https://github.com/microsoft/BotFramework-Emulator/pull/2238)
21+
- [client] Fixed an aligment issue with the caret button of the `<SplitButton />` widget in PR [2239](https://github.com/microsoft/BotFramework-Emulator/pull/2239)
22+
- [main] Fixed an outdated path to an `electron-builder` utility function used to generate the auto update yaml files in PR [2240](https://github.com/microsoft/BotFramework-Emulator/pull/2240)
23+
1524
## v4.11.0 - 2020 - 11 - 05
1625
- [client] Moved from master to main as the default branch. [2194](https://github.com/microsoft/BotFramework-Emulator/pull/2194)
1726
- [client] Updated support for new activity middleware contract provided by Web Chat. [2202](https://github.com/microsoft/BotFramework-Emulator/pull/2202)

packages/app/main/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@bfemulator/main",
33
"packagename": "BotFramework-Emulator",
4-
"version": "4.11.0",
4+
"version": "4.12.0",
55
"private": true,
66
"description": "Development tool for the Microsoft Bot Framework. Allows developers to test and debug bots on localhost.",
77
"main": "./app/server/main.js",

packages/app/main/scripts/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333

3434
/** Hashes a file asynchronously */
3535
function hashFileAsync(filename, algo = 'sha512', encoding = 'base64') {
36-
var builderUtil = require('builder-util');
36+
var builderUtil = require('app-builder-lib/out/util/hash');
3737
return builderUtil.hashFile(filename, algo, encoding);
3838
}
3939

4040
module.exports = {
41-
hashFileAsync
41+
hashFileAsync,
4242
};

packages/app/main/src/commands/electronCommands.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jest.mock('electron', () => ({
6666
dialog: {
6767
showMessageBox: (mainBrowserWindow: any, p: { buttons: string[]; type: string; title: string; message: string }) =>
6868
void 0,
69-
showOpenDialog: () => void 0,
69+
showOpenDialog: () => ({ filePaths: [] }),
7070
showSaveDialogSync: () => void 0,
7171
},
7272
shell: {

packages/app/main/src/commands/electronCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class ElectronCommands {
6868
// ---------------------------------------------------------------------------
6969
// Shows an open dialog and returns a path
7070
@Command(Commands.ShowOpenDialog)
71-
protected showOpenDialog(dialogOptions: Electron.OpenDialogOptions = {}): false | string {
71+
protected showOpenDialog(dialogOptions: Electron.OpenDialogOptions = {}): Promise<string> {
7272
return showOpenDialog(emulatorApplication.mainWindow.browserWindow, dialogOptions);
7373
}
7474

packages/app/main/src/services/contextMenuService.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,24 @@
3434
import { Menu, MenuItem, MenuItemConstructorOptions, BrowserWindow } from 'electron';
3535
import { ContextMenuCoordinates } from '@bfemulator/app-shared';
3636

37+
type ContextMenuResult = {
38+
id: string;
39+
};
40+
3741
export class ContextMenuService {
3842
private static currentMenu: Menu;
3943

4044
public static showMenuAndWaitForInput(
4145
options: Partial<MenuItemConstructorOptions>[] = [],
4246
menuCoords?: ContextMenuCoordinates
43-
): Promise<MenuItem> {
47+
): Promise<ContextMenuResult> {
4448
if (ContextMenuService.currentMenu) {
4549
ContextMenuService.currentMenu.closePopup();
4650
}
47-
return new Promise(resolve => {
48-
const clickHandler = menuItem => {
51+
return new Promise<ContextMenuResult>(resolve => {
52+
const clickHandler = (menuItem: MenuItem) => {
4953
ContextMenuService.currentMenu = null;
50-
resolve(menuItem);
54+
resolve({ id: menuItem.id });
5155
};
5256

5357
const template = options.map(option => {
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
// Licensed under the MIT license.
4+
//
5+
// Microsoft Bot Framework: http://botframework.com
6+
//
7+
// Bot Framework Emulator Github:
8+
// https://github.com/Microsoft/BotFramwork-Emulator
9+
//
10+
// Copyright (c) Microsoft Corporation
11+
// All rights reserved.
12+
//
13+
// MIT License:
14+
// Permission is hereby granted, free of charge, to any person obtaining
15+
// a copy of this software and associated documentation files (the
16+
// "Software"), to deal in the Software without restriction, including
17+
// without limitation the rights to use, copy, modify, merge, publish,
18+
// distribute, sublicense, and/or sell copies of the Software, and to
19+
// permit persons to whom the Software is furnished to do so, subject to
20+
// the following conditions:
21+
//
22+
// The above copyright notice and this permission notice shall be
23+
// included in all copies or substantial portions of the Software.
24+
//
25+
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
26+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29+
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30+
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31+
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32+
//
33+
34+
import { showOpenDialog } from './showOpenDialog';
35+
36+
const mockShowOpenDialog = jest.fn().mockResolvedValue({ filePaths: [] });
37+
jest.mock('electron', () => ({
38+
dialog: {
39+
showOpenDialog: async (...args) => mockShowOpenDialog(...args),
40+
},
41+
}));
42+
43+
describe('showOpenDialog', () => {
44+
it('should return an empty string if nothing was selected', async () => {
45+
const filePath = await showOpenDialog(undefined, undefined);
46+
47+
expect(filePath).toBe('');
48+
});
49+
50+
it('should return the selected file path', async () => {
51+
mockShowOpenDialog.mockResolvedValueOnce({ filePaths: ['someFile'] });
52+
const filePath = await showOpenDialog(undefined, undefined);
53+
54+
expect(filePath).toBe('someFile');
55+
});
56+
});

packages/app/main/src/utils/showOpenDialog.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import { BrowserWindow, dialog, OpenDialogOptions } from 'electron';
3535

3636
/** Shows a native open file / directory dialog */
37-
export const showOpenDialog = (window: BrowserWindow, options: OpenDialogOptions): false | string => {
38-
const filePaths = dialog.showOpenDialog(window, options);
39-
return filePaths && filePaths[0];
37+
export const showOpenDialog = async (window: BrowserWindow, options: OpenDialogOptions): Promise<string> => {
38+
const { filePaths = [] } = await dialog.showOpenDialog(window, options);
39+
return filePaths[0] || '';
4040
};

packages/sdk/ui-react/src/widget/splitButton/splitButton.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113

114114
&:before {
115115
display: inline-block;
116-
height: 7px;
116+
height: 11px;
117117
width: 9px;
118118
-webkit-mask-size: 9px;
119119
-webkit-mask: url('../../media/ic_chevron_up.svg');

0 commit comments

Comments
 (0)