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

Commit 721fc3c

Browse files
authored
Merge branch 'master' into srravich/bugfix-1788-LUIS
2 parents 5827b2a + d3d9bf5 commit 721fc3c

20 files changed

Lines changed: 259 additions & 36 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
## Added
1010
- [client/main] Added Ngrok Status Viewer in PR [2032](https://github.com/microsoft/BotFramework-Emulator/pull/2032)
1111
- [client/main] Changed conversation infrastructure to use Web Sockets to communicate with Web Chat in PR [2034](https://github.com/microsoft/BotFramework-Emulator/pull/2034)
12+
- [client/main] Added new telemetry events and properties in PR [2063](https://github.com/microsoft/BotFramework-Emulator/pull/2063)
1213

1314
## Fixed
1415
- [client] Hid services pane by default in PR [2059](https://github.com/microsoft/BotFramework-Emulator/pull/2059)
1516
- [client/main] Moved duplicate redux store code (actions / reducers / helpers) to `app/shared` package in PR [2060](https://github.com/microsoft/BotFramework-Emulator/pull/2060)
1617
- [client] Fixed an issue where trying to add a QnA KB manually after signing into Azure was causing the app to crash in PR [2066](https://github.com/microsoft/BotFramework-Emulator/pull/2066)
1718
- [client] Removed buble background on attachments [2067](https://github.com/microsoft/BotFramework-Emulator/pull/2067)
1819
- [client] Fixed an issue where the themes menu was empty on Windows & Linux in PR [2069](https://github.com/microsoft/BotFramework-Emulator/pull/2069)
20+
- [client] Fixed Web Chat suggestedActionBorder deprecation warning in PR [2070](https://github.com/microsoft/BotFramework-Emulator/pull/2070)
21+
22+
- [client] Fixed an issue where pressing enter opens the Azure government website instead of connecting to the bot [2073](https://github.com/microsoft/BotFramework-Emulator/pull/2073)
1923

2024
## Removed
2125
- [client/main] Removed legacy payments code in PR [2058](https://github.com/microsoft/BotFramework-Emulator/pull/2058)

packages/app/client/src/state/sagas/azureAuthSaga.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ describe('The azureAuthSaga', () => {
198198
ct++;
199199
}
200200
expect(ct).toBe(5);
201-
expect(remoteCallSpy).toHaveBeenCalledWith(SharedConstants.Commands.Telemetry.TrackEvent, 'signIn_failure');
201+
expect(remoteCallSpy).toHaveBeenCalledWith(SharedConstants.Commands.Telemetry.TrackEvent, 'azure_signIn', {
202+
success: false,
203+
});
202204
});
203205

204206
it('should contain 6 steps when the Azure login dialog prompt is confirmed and auth succeeds', async () => {
@@ -267,7 +269,10 @@ describe('The azureAuthSaga', () => {
267269
}
268270
expect(ct).toBe(6);
269271
expect(store.getState().azureAuth.access_token).toBe('a valid access_token');
270-
expect(remoteCallSpy).toHaveBeenCalledWith(SharedConstants.Commands.Telemetry.TrackEvent, 'signIn_success');
272+
expect(remoteCallSpy).toHaveBeenCalledWith(SharedConstants.Commands.Telemetry.TrackEvent, 'azure_signIn', {
273+
persistLogin: true,
274+
success: true,
275+
});
271276
});
272277
});
273278
});

packages/app/client/src/state/sagas/azureAuthSaga.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ export class AzureAuthSaga {
7474
PersistAzureLoginChanged,
7575
persistLogin
7676
);
77-
AzureAuthSaga.commandService.remoteCall(TrackEvent, 'signIn_success').catch(_e => void 0);
77+
AzureAuthSaga.commandService
78+
.remoteCall(TrackEvent, 'azure_signIn', { persistLogin: !!persistLogin, success: true })
79+
.catch(_e => void 0);
7880
} else {
7981
yield DialogService.showDialog(action.payload.loginFailedDialog);
80-
AzureAuthSaga.commandService.remoteCall(TrackEvent, 'signIn_failure').catch(_e => void 0);
82+
AzureAuthSaga.commandService.remoteCall(TrackEvent, 'azure_signIn', { success: false }).catch(_e => void 0);
8183
}
8284
yield put(azureArmTokenDataChanged(azureAuth.access_token));
8385
return azureAuth;

packages/app/client/src/state/sagas/botSagas.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,20 @@ export class BotSagas {
168168

169169
// telemetry
170170
if (!action.payload.isFromBotFile) {
171-
BotSagas.commandService.remoteCall(SharedConstants.Commands.Telemetry.TrackEvent, 'bot_open', {
172-
numOfServices: 0,
173-
source: 'url',
174-
});
175-
}
176-
if (!isLocalHostUrl(action.payload.endpoint)) {
177-
BotSagas.commandService.remoteCall(SharedConstants.Commands.Telemetry.TrackEvent, 'livechat_openRemote').catch();
171+
BotSagas.commandService
172+
.remoteCall(SharedConstants.Commands.Telemetry.TrackEvent, 'bot_open', {
173+
numOfServices: 0,
174+
source: 'url',
175+
})
176+
.catch(_ => void 0);
178177
}
178+
BotSagas.commandService
179+
.remoteCall(SharedConstants.Commands.Telemetry.TrackEvent, 'livechat_open', {
180+
isDebug: action.payload.mode === 'debug',
181+
isGov: action.payload.channelService === 'azureusgovernment',
182+
isRemote: !isLocalHostUrl(action.payload.endpoint),
183+
})
184+
.catch(_ => void 0);
179185
}
180186
}
181187

packages/app/client/src/state/sagas/frameworkSettingsSagas.spec.ts

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
3131
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3232
//
33+
3334
import {
3435
beginAdd,
3536
editor,
@@ -40,14 +41,20 @@ import {
4041
setDirtyFlag,
4142
setFrameworkSettings,
4243
FrameworkActionType,
44+
FrameworkSettings,
4345
SharedConstants,
4446
} from '@bfemulator/app-shared';
4547
import { applyMiddleware, combineReducers, createStore } from 'redux';
4648
import sagaMiddlewareFactory from 'redux-saga';
47-
import { put, select, takeEvery } from 'redux-saga/effects';
49+
import { call, put, select, takeEvery } from 'redux-saga/effects';
4850
import { CommandServiceImpl, CommandServiceInstance } from '@bfemulator/sdk-shared';
4951

50-
import { activeDocumentSelector, frameworkSettingsSagas, FrameworkSettingsSagas } from './frameworkSettingsSagas';
52+
import {
53+
activeDocumentSelector,
54+
frameworkSettingsSagas,
55+
FrameworkSettingsSagas,
56+
getFrameworkSettings,
57+
} from './frameworkSettingsSagas';
5158

5259
jest.mock('electron', () => ({
5360
ipcMain: new Proxy(
@@ -101,31 +108,59 @@ describe('The frameworkSettingsSagas', () => {
101108
});
102109

103110
it('should register the expected generators', () => {
104-
const it = frameworkSettingsSagas();
105-
expect(it.next().value).toEqual(
111+
const gen = frameworkSettingsSagas();
112+
expect(gen.next().value).toEqual(
106113
takeEvery(FrameworkActionType.SAVE_FRAMEWORK_SETTINGS, FrameworkSettingsSagas.saveFrameworkSettings)
107114
);
108115
});
109116

110117
it('should save the framework settings', async () => {
111-
const it = FrameworkSettingsSagas.saveFrameworkSettings(saveFrameworkSettingsAction({}));
118+
const currentSettings: Partial<FrameworkSettings> = {
119+
autoUpdate: false,
120+
useCustomId: false,
121+
usePrereleases: false,
122+
userGUID: '',
123+
ngrokPath: 'some/path/to/ngrok',
124+
};
125+
const updatedSettings: Partial<FrameworkSettings> = {
126+
autoUpdate: true,
127+
useCustomId: true,
128+
usePrereleases: false,
129+
userGUID: 'some-user-id',
130+
ngrokPath: 'some/different/path/to/ngrok',
131+
};
132+
const gen = FrameworkSettingsSagas.saveFrameworkSettings(saveFrameworkSettingsAction(updatedSettings));
112133
// selector to get the active document from the state
113-
const selector = it.next().value;
134+
const selector = gen.next().value;
114135
expect(selector).toEqual(select(activeDocumentSelector));
115136
const value = selector.SELECT.selector(mockStore.getState());
116137
// put the dirty state to false
117-
expect(it.next(value).value).toEqual(put(setDirtyFlag(value.documentId, false)));
118-
expect(it.next().value).toEqual(put(setFrameworkSettings({})));
119-
expect(it.next().done).toBe(true);
138+
expect(gen.next(value).value).toEqual(put(setDirtyFlag(value.documentId, false)));
139+
expect(gen.next().value).toEqual(put(setFrameworkSettings(updatedSettings)));
140+
expect(gen.next().value).toEqual(select(getFrameworkSettings));
141+
expect(gen.next(currentSettings).value).toEqual(
142+
call(
143+
[commandService, commandService.remoteCall],
144+
SharedConstants.Commands.Telemetry.TrackEvent,
145+
'app_changeSettings',
146+
{
147+
autoUpdate: true,
148+
useCustomId: true,
149+
userGUID: 'some-user-id',
150+
ngrokPath: 'some/different/path/to/ngrok',
151+
}
152+
)
153+
);
154+
expect(gen.next().done).toBe(true);
120155
});
121156

122157
it('should send a notification when saving the settings fails', () => {
123-
const it = FrameworkSettingsSagas.saveFrameworkSettings(saveFrameworkSettingsAction({}));
124-
it.next();
158+
const gen = FrameworkSettingsSagas.saveFrameworkSettings(saveFrameworkSettingsAction({}));
159+
gen.next();
125160
const errMsg = `Error while saving emulator settings: oh noes!`;
126161
const notification = newNotification(errMsg);
127162
notification.timestamp = jasmine.any(Number) as any;
128163
notification.id = jasmine.any(String) as any;
129-
expect(it.throw('oh noes!').value).toEqual(put(beginAdd(notification)));
164+
expect(gen.throw('oh noes!').value).toEqual(put(beginAdd(notification)));
130165
});
131166
});

packages/app/client/src/state/sagas/frameworkSettingsSagas.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,43 @@ import {
4040
FrameworkAction,
4141
FrameworkActionType,
4242
FrameworkSettings,
43+
SharedConstants,
4344
} from '@bfemulator/app-shared';
44-
import { ForkEffect, put, select, takeEvery } from 'redux-saga/effects';
45+
import { ForkEffect, call, put, select, takeEvery } from 'redux-saga/effects';
46+
import { CommandServiceImpl, CommandServiceInstance } from '@bfemulator/sdk-shared';
4547

4648
import { RootState } from '../store';
49+
import { getSettingsDelta } from '../../utils';
4750

4851
export const activeDocumentSelector = (state: RootState) => {
4952
const { editors, activeEditor } = state.editor;
5053
const { activeDocumentId } = editors[activeEditor];
5154
return editors[activeEditor].documents[activeDocumentId];
5255
};
5356

57+
export const getFrameworkSettings = (state: RootState): FrameworkSettings => state.framework;
58+
5459
export class FrameworkSettingsSagas {
60+
@CommandServiceInstance()
61+
private static commandService: CommandServiceImpl;
62+
5563
// when saving settings from the settings editor we need to mark the document as clean
5664
// and then set the settings
5765
public static *saveFrameworkSettings(action: FrameworkAction<FrameworkSettings>): IterableIterator<any> {
5866
try {
5967
const activeDoc: Document = yield select(activeDocumentSelector);
6068
yield put(setDirtyFlag(activeDoc.documentId, false)); // mark as clean
6169
yield put(setFrameworkSettings(action.payload));
70+
const currentSettings = yield select(getFrameworkSettings);
71+
const settingsDelta = getSettingsDelta(currentSettings, action.payload);
72+
if (settingsDelta) {
73+
yield call(
74+
[FrameworkSettingsSagas.commandService, FrameworkSettingsSagas.commandService.remoteCall],
75+
SharedConstants.Commands.Telemetry.TrackEvent,
76+
'app_changeSettings',
77+
settingsDelta
78+
);
79+
}
6280
} catch (e) {
6381
const errMsg = `Error while saving emulator settings: ${e}`;
6482
const notification = newNotification(errMsg);

packages/app/client/src/ui/dialogs/openBotDialog/openBotDialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export class OpenBotDialog extends Component<OpenBotDialogProps, OpenBotDialogSt
181181
className={dialogStyles.dialogLink}
182182
linkRole={true}
183183
onClick={this.onEmulatorAzureGovDocsClick}
184+
type="button"
184185
>
185186
&nbsp;Learn more.
186187
</LinkButton>

packages/app/client/src/ui/editor/emulator/parts/chat/webChatTheme.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export default {
5353
timestampColor: 'var(--webchat-timestamp-text)',
5454

5555
suggestedActionBackground: 'var(--webchat-sa-bg)',
56-
suggestedActionBorder: 'var(--webchat-sa-border)',
56+
suggestedActionBorderColor: 'var(--webchat-sa-border-color)',
57+
suggestedActionBorderStyle: 'var(--webchat-sa-border-style)',
58+
suggestedActionBorderWidth: 'var(--webchat-sa-border-width)',
5759
suggestedActionTextColor: 'var(--webchat-sa-text)',
5860

5961
transcriptOverlayButtonBackground: 'var(--webchat-transcript-overlay-bg)',

packages/app/client/src/ui/styles/themes/dark.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ html {
5757

5858
/* suggested actions */
5959
--webchat-sa-bg: var(--webchat-bubble-bg);
60-
--webchat-sa-border: solid 1px var(--neutral-4);
60+
--webchat-sa-border-color: var(--neutral-4);
61+
--webchat-sa-border-style: solid;
62+
--webchat-sa-border-width: 1px;
6163
--webchat-sa-text: #3794FF;
6264

6365
/* bot state button */

packages/app/client/src/ui/styles/themes/high-contrast.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ html {
5656

5757
/* suggested actions */
5858
--webchat-sa-bg: var(--webchat-bubble-bg);
59-
--webchat-sa-border: solid 1px var(--neutral-4);
59+
--webchat-sa-border-color: var(--neutral-4);
60+
--webchat-sa-border-style: solid;
61+
--webchat-sa-border-width: 1px;
6062
--webchat-sa-text: #3794FF;
6163

6264
/* bot state button */

0 commit comments

Comments
 (0)