Skip to content

Commit

Permalink
build: sprint release merge v3 back to dev (#1004)
Browse files Browse the repository at this point in the history
* Update README.md

* fix: teams chef sample failed to preview

* fix: eslint error for legacy spfx version

* fix: update spfx productivity dashboard sample readme

---------

Co-authored-by: Wei Shen <[email protected]>
Co-authored-by: JerryYang <[email protected]>
Co-authored-by: Huihui Wu <[email protected]>
  • Loading branch information
4 people authored Aug 17, 2023
1 parent 7274194 commit 2624a73
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 29 deletions.
4 changes: 2 additions & 2 deletions spfx-productivity-dashboard/src/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"configurations": [
{
"name": "Hosted workbench",
"type": "pwa-chrome",
"type": "msedge",
"request": "launch",
"url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx",
"url": "https://{tenantDomain}/_layouts/workbench.aspx",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
Expand Down
4 changes: 2 additions & 2 deletions spfx-productivity-dashboard/src/.yo-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"nodeVersion": "16.17.0",
"sdksVersions": {
"@microsoft/microsoft-graph-client": "3.0.2",
"@microsoft/teams-js": "2.4.1"
"@microsoft/teams-js": "2.9.1"
},
"version": "1.16.0-beta.2",
"version": "1.17.4",
"libraryName": "spfx-productivity-dashboard",
"libraryId": "a6240e42-f9f6-49a9-b642-b16cac87b013",
"environment": "spo",
Expand Down
4 changes: 2 additions & 2 deletions spfx-productivity-dashboard/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Prerequisite to use this sample

- [Set up SharePoint Framework development environment](https://aka.ms/teamsfx-spfx-dev-environment-setup)(Recommend to use SPFx v1.16.0-beta.2
- [Set up SharePoint Framework development environment](https://aka.ms/teamsfx-spfx-dev-environment-setup)(Recommend to use SPFx v1.17.4
- A Microsoft 365 tenant in which you have permission to upload Teams apps. You can get a free Microsoft 365 developer tenant by joining the [Microsoft 365 developer program](https://developer.microsoft.com/en-us/microsoft-365/dev-program).
- [Teams Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [TeamsFx CLI](https://aka.ms/teamsfx-cli)
- [Deploy the Microsoft Graph Toolkit SharePoint Framework package to your tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-web-part-microsoft-graph-toolkit?WT.mc_id=m365-80548-wmastyka#deploy-the-microsoft-graph-toolkit-sharepoint-framework-package)
Expand All @@ -26,7 +26,7 @@
1. Open the project in Visual Studio Code, click `Provision` in LIFECYCLE panel of Microsoft Teams Toolkit extension or open the command palette and select `Teams: Provision`. This step will create an app in Teams App Studio.
1. Go back to Microsoft Teams Toolkit extension, click `Deploy` in LIFECYCLE panel or open the command palette and select `Teams: Deploy`.
> This step will build a SharePoint package (*.sppkg) under `sharepoint/solution` folder. The Teams Toolkit will automatically upload and deploy it to your tenant App Catalog site. Only tenant App Catalog site admin has permission to do it. If you are not the admin, you can create your test tenant following [Setup your Microsoft 365 tenant](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant).
1. Go to your [SharePoint Admin center](https://{yourtenant}-admin.sharepoint.com). In the left-hand navigation, select `Advanced` and then `API Access`. You should see pending requests for each of the permissions requested in src\config\package-solution.json file. Select and approve each permission.
1. Go to your SharePoint Admin center. In the left-hand navigation, select `Advanced` and then `API Access`. You should see pending requests for each of the permissions requested in src\config\package-solution.json file. Select and approve each permission.

### Preview the app in Teams

Expand Down
2 changes: 1 addition & 1 deletion spfx-productivity-dashboard/src/assets/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
{
"key": "SPFX-VERSION",
"value": "1.16.0-beta.2"
"value": "1.17.4"
}
],
"thumbnails": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"websiteUrl": "",
"privacyUrl": "",
"termsOfUseUrl": "",
"mpnId": "Undefined-1.16.0-beta.2"
"mpnId": "Undefined-1.17.4"
},
"metadata": {
"shortDescription": {
Expand Down
3 changes: 3 additions & 0 deletions spfx-productivity-dashboard/src/config/sass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}
2 changes: 1 addition & 1 deletion spfx-productivity-dashboard/src/config/serve.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx"
"initialPage": "https://{tenantDomain}/_layouts/workbench.aspx"
}
21 changes: 11 additions & 10 deletions spfx-productivity-dashboard/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@
},
"dependencies": {
"@microsoft/mgt-spfx": "^2.6.2",
"@microsoft/sp-core-library": "1.16.0-beta.2",
"@microsoft/sp-lodash-subset": "1.16.0-beta.2",
"@microsoft/sp-office-ui-fabric-core": "1.16.0-beta.2",
"@microsoft/sp-property-pane": "1.16.0-beta.2",
"@microsoft/sp-webpart-base": "1.16.0-beta.2",
"@microsoft/sp-core-library": "1.17.4",
"@microsoft/sp-lodash-subset": "1.17.4",
"@microsoft/sp-office-ui-fabric-core": "1.17.4",
"@microsoft/sp-property-pane": "1.17.4",
"@microsoft/sp-webpart-base": "1.17.4",
"tslib": "2.3.1"
},
"devDependencies": {
"@microsoft/eslint-config-spfx": "1.16.0-beta.2",
"@microsoft/eslint-plugin-spfx": "1.16.0-beta.2",
"@microsoft/rush-stack-compiler-4.5": "0.2.2",
"@microsoft/sp-build-web": "1.16.0-beta.2",
"@microsoft/sp-module-interfaces": "1.16.0-beta.2",
"@microsoft/eslint-config-spfx": "1.17.4",
"@microsoft/eslint-plugin-spfx": "1.17.4",
"@microsoft/rush-stack-compiler-4.5": "0.5.0",
"@microsoft/sp-build-web": "1.17.4",
"@microsoft/sp-module-interfaces": "1.17.4",
"@rushstack/eslint-config": "2.5.1",
"@types/webpack-env": "~1.15.2",
"ajv": "^6.12.5",
"eslint": "8.7.0",
"gulp": "4.0.2",
"typescript": "4.5.5"
}
Expand Down
31 changes: 21 additions & 10 deletions teams-chef-bot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
CloudAdapter,
ConfigurationBotFrameworkAuthentication,
ConfigurationServiceClientCredentialFactory,
MemoryStorage
MemoryStorage,
TurnContext
} from 'botbuilder';

const botFrameworkAuthentication = new ConfigurationBotFrameworkAuthentication(
Expand All @@ -29,7 +30,7 @@ const botFrameworkAuthentication = new ConfigurationBotFrameworkAuthentication(
const adapter = new CloudAdapter(botFrameworkAuthentication);

// Catch-all for errors.
const onTurnErrorHandler = async (context, error) => {
const onTurnErrorHandler = async (context: TurnContext, error: any) => {
// This check writes out errors to console log .vs. app insights.
// NOTE: In production environment, you should consider logging this to Azure
// application insights.
Expand Down Expand Up @@ -61,7 +62,15 @@ server.listen(process.env.port || process.env.PORT || 3978, () => {
console.log('\nTo test your bot in Teams, sideload the app manifest.json within Teams Apps.');
});

import { Application, ConversationHistory, DefaultPromptManager, DefaultTurnState, OpenAIModerator, OpenAIPlanner, AI } from '@microsoft/botbuilder-m365';
import {
AI,
Application,
ConversationHistory,
DefaultPromptManager,
DefaultTurnState,
OpenAIModerator,
OpenAIPlanner
} from '@microsoft/teams-ai';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface ConversationState {}
Expand Down Expand Up @@ -94,25 +103,27 @@ const app = new Application<ApplicationTurnState>({
}
});

app.ai.action(AI.FlaggedInputActionName, async (context, state, data) => {
await context.sendActivity(`I'm sorry your message was flagged: ${JSON.stringify(data)}`);
return false;
});
app.ai.action(
AI.FlaggedInputActionName,
async (context: TurnContext, state: ApplicationTurnState, data: Record<string, any>) => {
await context.sendActivity(`I'm sorry your message was flagged: ${JSON.stringify(data)}`);
return false;
}
);

app.ai.action(AI.FlaggedOutputActionName, async (context, state, data) => {
app.ai.action(AI.FlaggedOutputActionName, async (context: TurnContext, state: ApplicationTurnState, data: any) => {
await context.sendActivity(`I'm not allowed to talk about such things.`);
return false;
});

app.message('/history', async (context, state) => {
app.message('/history', async (context: TurnContext, state: ApplicationTurnState) => {
const history = ConversationHistory.toString(state, 2000, '\n\n');
await context.sendActivity(history);
});

// Listen for incoming server requests.
server.post('/api/messages', async (req, res) => {
// Route received a request to adapter for processing
console.warn("Adapter.progress starting..")
await adapter.process(req, res as any, async (context) => {
// Dispatch to application for routing
await app.run(context);
Expand Down

0 comments on commit 2624a73

Please sign in to comment.