Skip to content

Commit d3559da

Browse files
Merge pull request #1736 from OfficeDev/yugal/python-conversion-06
Added python sample msgext-message-reminder, graph-pinned-messages
2 parents a73f551 + 4cc46ca commit d3559da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2632
-161
lines changed

.github/workflows/build-complete-samples.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,10 @@ jobs:
12021202
name: 'bot-initiate-thread-in-channel'
12031203
version: '3.10.x'
12041204

1205+
- project_path: 'samples/graph-pinned-messages/python'
1206+
name: 'graph-pinned-messages'
1207+
version: '3.10.x'
1208+
12051209
- project_path: 'samples/msgext-search/python'
12061210
name: 'msgext-search'
12071211
version: '3.10.x'
@@ -1217,6 +1221,10 @@ jobs:
12171221
- project_path: 'samples/msgext-link-unfurling/python'
12181222
name: 'msgext-link-unfurling'
12191223
version: '3.10.x'
1224+
1225+
- project_path: 'samples/msgext-message-reminder/python'
1226+
name: 'msgext-message-reminder'
1227+
version: '3.10.x'
12201228

12211229
- project_path: 'samples/msgext-search-auth-config/python'
12221230
name: 'msgext-search-auth-config'

samples/graph-pinned-messages/nodejs/ClientApp/package-lock.json

Lines changed: 202 additions & 160 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/graph-pinned-messages/nodejs/ClientApp/src/components/dashboard.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ class Dashboard extends Component {
8585

8686
// Exchange client token with server token and fetch the pinned message details.
8787
exchangeClientTokenForServerToken = async (token) => {
88-
var id = "ChatId"; //Replace {{ChatId ex - 19:75e4d14a2c2c4644a7adaf4e3976d17b@thread.v2}}
88+
if (!this.state.context || !this.state.context.chat || !this.state.context.chat.id) {
89+
console.error("Chat context is not available");
90+
this.setState({ isError: true });
91+
return;
92+
}
93+
94+
var id = this.state.context.chat.id;
8995
axios.get(`/api/chat/getGraphAccessToken?ssoToken=${token}&chatId=${id}`).then((response) => {
9096
var responseMessageData = response.data;
9197
console.log("-----Response--->",responseMessageData);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MicrosoftAppId=
2+
MicrosoftAppPassword=
3+
AAD_APP_TENANT_ID=
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# TeamsFx files
2+
env/.env.*.user
3+
appManifest/build/
4+
5+
# python virtual environment
6+
.venv/
7+
8+
# misc
9+
.deployment/
10+
11+
# tmp files
12+
__pycache__/
13+
14+
/build/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"TeamsDevApp.ms-teams-vscode-extension",
4+
"ms-python.python",
5+
]
6+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Launch App (Edge)",
6+
"type": "msedge",
7+
"request": "launch",
8+
"url": "https://teams.microsoft.com/l/app/${{local:TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
9+
"cascadeTerminateToConfigurations": [
10+
"Python: Run App Locally"
11+
],
12+
"presentation": {
13+
"group": "all",
14+
"hidden": true
15+
},
16+
"internalConsoleOptions": "neverOpen"
17+
},
18+
{
19+
"name": "Launch App (Chrome)",
20+
"type": "chrome",
21+
"request": "launch",
22+
"url": "https://teams.microsoft.com/l/app/${{local:TEAMS_APP_ID}}?installAppPackage=true&webjoin=true&${account-hint}",
23+
"cascadeTerminateToConfigurations": [
24+
"Python: Run App Locally"
25+
],
26+
"presentation": {
27+
"group": "all",
28+
"hidden": true
29+
},
30+
"internalConsoleOptions": "neverOpen"
31+
},
32+
{
33+
"name": "Python: Run App Locally",
34+
"type": "debugpy",
35+
"request": "launch",
36+
"program": "${workspaceFolder}/app.py",
37+
"cwd": "${workspaceFolder}",
38+
"console": "integratedTerminal"
39+
}
40+
],
41+
"compounds": [
42+
{
43+
"name": "Debug (Edge)",
44+
"configurations": [
45+
"Launch App (Edge)",
46+
"Python: Run App Locally"
47+
],
48+
"preLaunchTask": "Prepare Teams App Resources",
49+
"presentation": {
50+
"group": "all",
51+
"order": 1
52+
},
53+
"stopAll": true
54+
},
55+
{
56+
"name": "Debug (Chrome)",
57+
"configurations": [
58+
"Launch App (Chrome)",
59+
"Python: Run App Locally"
60+
],
61+
"preLaunchTask": "Prepare Teams App Resources",
62+
"presentation": {
63+
"group": "all",
64+
"order": 2
65+
},
66+
"stopAll": true
67+
}
68+
]
69+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"debug.onTaskErrors": "abort",
3+
"python.analysis.extraPaths": [
4+
"./Models"
5+
]
6+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// This file is automatically generated by Microsoft 365 Agents Toolkit.
2+
// The teamsfx tasks defined in this file require Microsoft 365 Agents Toolkit version >= 5.0.0.
3+
// See https://aka.ms/teamsfx-tasks for details on how to customize each task.
4+
{
5+
"version": "2.0.0",
6+
"tasks": [
7+
{
8+
"label": "Prepare Teams App Resources",
9+
"dependsOn": [
10+
"Validate prerequisites",
11+
"Start local tunnel",
12+
"Provision",
13+
"Deploy"
14+
],
15+
"dependsOrder": "sequence"
16+
},
17+
{
18+
// Check all required prerequisites.
19+
// See https://aka.ms/teamsfx-tasks/check-prerequisites to know the details and how to customize the args.
20+
"label": "Validate prerequisites",
21+
"type": "teamsfx",
22+
"command": "debug-check-prerequisites",
23+
"args": {
24+
"prerequisites": [
25+
"m365Account", // Sign-in prompt for Microsoft 365 account, then validate if the account enables the sideloading permission.
26+
"portOccupancy" // Validate available ports to ensure those debug ones are not occupied.
27+
],
28+
"portOccupancy": [
29+
3978, // app service port
30+
]
31+
}
32+
},
33+
{
34+
// Start the local tunnel service to forward public URL to local port and inspect traffic.
35+
// See https://aka.ms/teamsfx-tasks/local-tunnel for the detailed args definitions.
36+
"label": "Start local tunnel",
37+
"type": "teamsfx",
38+
"command": "debug-start-local-tunnel",
39+
"args": {
40+
"type": "dev-tunnel",
41+
"ports": [
42+
{
43+
"portNumber": 3978,
44+
"protocol": "http",
45+
"access": "public",
46+
"writeToEnvironmentFile": {
47+
"endpoint": "BOT_ENDPOINT", // output tunnel endpoint as BOT_ENDPOINT
48+
"domain": "BOT_DOMAIN" // output tunnel domain as BOT_DOMAIN
49+
}
50+
}
51+
],
52+
"env": "local"
53+
},
54+
"isBackground": true,
55+
"problemMatcher": "$teamsfx-local-tunnel-watch"
56+
},
57+
{
58+
// Create the debug resources.
59+
// See https://aka.ms/teamsfx-tasks/provision to know the details and how to customize the args.
60+
"label": "Provision",
61+
"type": "teamsfx",
62+
"command": "provision",
63+
"args": {
64+
"env": "local"
65+
}
66+
},
67+
{
68+
// Build project.
69+
// See https://aka.ms/teamsfx-tasks/deploy to know the details and how to customize the args.
70+
"label": "Deploy",
71+
"type": "teamsfx",
72+
"command": "deploy",
73+
"args": {
74+
"env": "local"
75+
}
76+
}
77+
]
78+
}
179 KB
Loading

0 commit comments

Comments
 (0)