Skip to content

Commit

Permalink
Merge branch 'main' into peterinnesmsft/templates_update
Browse files Browse the repository at this point in the history
  • Loading branch information
peterinnesmsft authored Apr 26, 2021
2 parents 610cafd + 462807e commit 64044b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { getDropdownOptions } from './getDropdownOptions';
export const RecognizerField: React.FC<FieldProps<MicrosoftIRecognizer>> = (props) => {
const { value, id, label, description, uiOptions, required, onChange } = props;
const { shellApi, ...shellData } = useShellApi();
const { telemetryClient } = shellApi;

useMigrationEffect(value, onChange);
const { recognizers: recognizerConfigs, currentRecognizer } = useRecognizerConfig();
Expand All @@ -38,6 +39,7 @@ export const RecognizerField: React.FC<FieldProps<MicrosoftIRecognizer>> = (prop
? seedNewRecognizer(shellData, shellApi)
: { $kind: option.key as string, intents: [] }; // fallback to default Recognizer instance;
onChange(recognizerInstance);
telemetryClient?.track('RecognizerChanged', { recognizer: option.key as string });
};

return (
Expand Down
7 changes: 6 additions & 1 deletion Composer/packages/types/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ type OrchestratorEvents = {
OrchestratorBuildCompleted: { baseModel: string; firstBuild: boolean };
};

type PropertyEditorEvents = {
RecognizerChanged: { recognizer: string };
};

type OtherEvents = {};

type PageView = {
Expand Down Expand Up @@ -232,7 +236,8 @@ export type TelemetryEvents = ApplicationEvents &
LgEditorEvents &
WebChatEvents &
LuEditorEvents &
OrchestratorEvents;
OrchestratorEvents &
PropertyEditorEvents;

export type TelemetryEventName = keyof TelemetryEvents;

Expand Down

0 comments on commit 64044b7

Please sign in to comment.