Skip to content

Commit

Permalink
Rebased Teams extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterjam committed Apr 5, 2024
1 parent 256522f commit dde8cf1
Show file tree
Hide file tree
Showing 16 changed files with 2,577 additions and 414 deletions.
6 changes: 3 additions & 3 deletions extensions/teams/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
],
"compounds": [
{
"name": "Debug (Edge)",
"name": "Debug in Teams (Edge)",
"configurations": [
"Launch App (Edge)",
"Attach to Local Service"
Expand All @@ -79,7 +79,7 @@
"stopAll": true
},
{
"name": "Debug (Chrome)",
"name": "Debug in Teams (Chrome)",
"configurations": [
"Launch App (Chrome)",
"Attach to Local Service"
Expand All @@ -92,7 +92,7 @@
"stopAll": true
},
{
"name": "Debug in Test Tool",
"name": "Debug in Test Tool (Preview)",
"configurations": [
"Attach to Local Service"
],
Expand Down
6 changes: 3 additions & 3 deletions extensions/teams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ A bot interaction can be a quick question and answer, or it can be a complex con
> To run the Basic Bot template in your local dev machine, you will need:
>
> - [Node.js](https://nodejs.org/), supported versions: 16, 18
> - [Teams Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Teams Toolkit CLI](https://aka.ms/teamsfx-cli)
> - [Teams Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Teams Toolkit CLI](https://aka.ms/teamsfx-toolkit-cli)
1. First, select the Teams Toolkit icon on the left in the VS Code toolbar.
2. Press F5 to start debugging which launches your app in Teams App Test Tool using a web browser. Select `Debug in Test Tool`.
2. Press F5 to start debugging which launches your app in Teams App Test Tool using a web browser. Select `Debug in Test Tool (Preview)`.
3. The browser will pop up to open Teams App Test Tool.
4. You will receive a welcome message from the bot, and you can send anything to the bot to get an echoed response.

Expand Down Expand Up @@ -64,5 +64,5 @@ Following documentation will help you to extend the Basic Bot template.
- [Collaborate on app development](https://learn.microsoft.com/microsoftteams/platform/toolkit/teamsfx-collaboration)
- [Set up the CI/CD pipeline](https://learn.microsoft.com/microsoftteams/platform/toolkit/use-cicd-template)
- [Publish the app to your organization or the Microsoft Teams app store](https://learn.microsoft.com/microsoftteams/platform/toolkit/publish)
- [Develop with Teams Toolkit CLI](https://aka.ms/teamsfx-cli/debug)
- [Develop with Teams Toolkit CLI](https://aka.ms/teams-toolkit-cli/debug)
- [Preview the app on mobile clients](https://github.com/OfficeDev/TeamsFx/wiki/Run-and-debug-your-Teams-application-on-iOS-or-Android-client)
Binary file modified extensions/teams/appPackage/CogSearchOutline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified extensions/teams/appPackage/color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions extensions/teams/appPackage/manifest.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
"manifestVersion": "1.16",
"version": "1.1.4",
"version": "3.0.0",
"id": "${{TEAMS_APP_ID}}",
"packageName": "com.microsoft.teams.extension",
"developer": {
"name": "James Hunter",
"websiteUrl": "https://www.microsoft.com",
"privacyUrl": "https://privacy.microsoft.com/en-us/privacystatement",
"privacyUrl": "https://www.microsoft.com/en-us/privacystatement",
"termsOfUseUrl": "https://www.microsoft.com/en-us/servicesagreement"
},
"icons": {
"color": "CogSearchColor.png",
"outline": "CogSearchOutline.png"
},
"name": {
"short": "Enterprise Chat with your Data",
"full": "Enterprise Chat with your own Data"
"short": "Chat with Data",
"full": "Chat with your own Data"
},
"description": {
"short": "A tool that combines the capabilities of Azure Cognitive Search and LLMs.",
Expand Down
1 change: 0 additions & 1 deletion extensions/teams/devTools/.testTool.installInfo.json

This file was deleted.

1 change: 1 addition & 0 deletions extensions/teams/env/.env.testtool
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ TEAMSFX_ENV=testtool

# Environment variables used by test tool
TEAMSAPPTESTER_PORT=56150
TEAMSFX_NOTIFICATION_STORE_FILENAME=.notification.testtoolstore.json
AZURE_FUNCTION_URL=https://<DEPLOYMENT_PREFIX>-backend.azurewebsites.net/api/GetConversationResponse?code=<FUNCTION_APP_CLIENT_KEY>&clientId=clientKey
23 changes: 13 additions & 10 deletions extensions/teams/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,20 @@ const onTurnErrorHandler = async (context: TurnContext, error: Error) => {
// application insights.
console.error(`\n [onTurnError] unhandled error: ${error}`);

// Send a trace activity, which will be displayed in Bot Framework Emulator
await context.sendTraceActivity(
"OnTurnError Trace",
`${error}`,
"https://www.botframework.com/schemas/error",
"TurnError"
);
// Only send error message for user messages, not for other message types so the bot doesn't spam a channel or chat.
if (context.activity.type === "message") {
// Send a trace activity, which will be displayed in Bot Framework Emulator
await context.sendTraceActivity(
"OnTurnError Trace",
`${error}`,
"https://www.botframework.com/schemas/error",
"TurnError"
);

// Send a message to the user
await context.sendActivity(`The bot encountered unhandled error:\n ${error.message}`);
await context.sendActivity("To continue to run this bot, please fix the bot source code.");
// Send a message to the user
await context.sendActivity(`The bot encountered unhandled error:\n ${error.message}`);
await context.sendActivity("To continue to run this bot, please fix the bot source code.");
}
};

// Set the onTurnError for the singleton CloudAdapter.
Expand Down
2 changes: 1 addition & 1 deletion extensions/teams/infra/azure.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ param azureFunctionURL string

param webAppSKU string

@maxLength(42)
@maxLength(42)
param botDisplayName string

param serverfarmsName string = resourceBaseName
Expand Down
220 changes: 0 additions & 220 deletions extensions/teams/infra/azure.json

This file was deleted.

2 changes: 1 addition & 1 deletion extensions/teams/infra/azure.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"value": "B1"
},
"botDisplayName": {
"value": "cwyod_ts"
"value": "TBT"
}
}
}
Loading

0 comments on commit dde8cf1

Please sign in to comment.