-
Notifications
You must be signed in to change notification settings - Fork 859
Added Python Sample tab-people-picker, tab-channel-group-quickstart and tab-personal-quickstart #1695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds two new Python sample applications for Microsoft Teams tabs: a People Picker demo and a Channel/Group Quickstart.
- Introduces
tab-people-picker
sample with HTML templates, Flask routes, and Teams SDK integration for user selection modes. - Adds
tab-channel-group-quickstart
sample with full tab routing (App, Config, Privacy, Terms) and Flask API endpoints. - Provides manifests, environment configurations, CI YAML, and VS Code task/launch settings for both samples.
Reviewed Changes
Copilot reviewed 41 out of 60 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
samples/tab-people-picker/python/templates/tab.html | HTML/JS template for People Picker interactions |
samples/tab-people-picker/python/config.py | Bot configuration environment variable mapping |
samples/tab-channel-group-quickstart/python/m365agents.yml | Local provisioning metadata (sampleTag mismatch) |
samples/tab-channel-group-quickstart/python/assets/sample.json | Metadata JSON (incorrect sample name suffix) |
Files not reviewed (1)
- samples/tab-people-picker/python/package-lock.json: Language not supported
Comments suppressed due to low confidence (3)
samples/tab-people-picker/python/templates/tab.html:166
- [nitpick] Clarify in the docs that "aad id" refers to the user AAD object ID or use consistent terminology, e.g., "setSelected: [userAadId]".
<pre>microsoftTeams.people.selectPeople(
samples/tab-channel-group-quickstart/python/m365agents.yml:7
- The sampleTag is still referencing "tab-device-permissions-python"; update it to "tab-channel-group-quickstart-python" to match this sample.
sampleTag: Microsoft-Teams-Samples:tab-device-permissions-python
samples/tab-channel-group-quickstart/python/assets/sample.json:3
- The asset name ends in "-js" but this is the Python sample; rename to "...-quickstart-python" for consistency.
"name": "officedev-microsoft-teams-samples-tab-channel-group-quickstart-js",
microsoftTeams.app.initialize().then(() => { | ||
$("#defaultSelected").hide(); | ||
$("#allMemberOfOrganisationSelected").hide(); | ||
$("#singleSelected").hide(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a hide call for "#defaultMemberSelected" on page load so the default-selected output container starts hidden, similar to the other result containers.
$("#singleSelected").hide(); | |
$("#singleSelected").hide(); | |
$("#defaultMemberSelected").hide(); |
Copilot uses AI. Check for mistakes.
PORT = 3978 | ||
APP_ID = os.environ.get("MicrosoftAppId", "<<MICROSOFT-APP-ID>>") | ||
APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "<<MICROSOFT-APP-PASSWORD>>") | ||
BOT_ENDPOINT = os.environ.get("BaseUrl", "<<BOT-ENDPOINT>>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code reads env var "BaseUrl" but the sample uses "BOT_ENDPOINT". Change to os.environ.get("BOT_ENDPOINT", ...) for consistency with your .env and provisioning.
BOT_ENDPOINT = os.environ.get("BaseUrl", "<<BOT-ENDPOINT>>") | |
BOT_ENDPOINT = os.environ.get("BOT_ENDPOINT", "<<BOT-ENDPOINT>>") |
Copilot uses AI. Check for mistakes.
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Tab People Picker Demo -python</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Add a space before "python" ("- Python") in the title for consistency with other sample titles.
<title>Tab People Picker Demo -python</title> | |
<title>Tab People Picker Demo - Python</title> |
Copilot uses AI. Check for mistakes.
<head> | ||
<meta charset="UTF-8"> | ||
<title>Teams People Picker Demo</title> | ||
<script src="https://res.cdn.office.net/teams-js/2.34.0/js/MicrosoftTeams.min.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider aligning the Teams SDK version across both samples for consistency; the quickstart uses 2.0.0 while this uses 2.34.0.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix the given comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hide the email address and any security related things from here.
version: v1.2 | ||
|
||
additionalMetadata: | ||
sampleTag: Microsoft-Teams-Samples:tab-device-permissions-python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change tab-device-permission to current sample name
# Creates a new Azure Active Directory (AAD) app to authenticate users if the environment variable that stores clientId is empty | ||
- uses: aadApp/create | ||
with: | ||
name: tab-device-permissions-aad # Note: when you run aadApp/update, the AAD app name will be updated based on the definition in manifest. If you don't want to change the name, make sure the name in AAD manifest is the same with the name defined here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change sample name tab-device-permission. check and update everywhere
- uses: teamsApp/create | ||
with: | ||
# Teams app name | ||
name: tab-device-permissions${{APP_NAME_SUFFIX}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here also sample name
version: v1.2 | ||
|
||
additionalMetadata: | ||
sampleTag: Microsoft-Teams-Samples:tab-device-permissions-python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sample name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please hide email address or domain for security
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hide object Id and email address domain
|
||
if __name__ == "__main__": | ||
# Get SSL configuration from environment | ||
ssl_crt = os.getenv('SSL_CRT_FILE', 'C:/Users/v-yadavyash/.fx/certificate/localhost.crt') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove local path
if __name__ == "__main__": | ||
# Get SSL configuration from environment | ||
ssl_crt = os.getenv('SSL_CRT_FILE', 'C:/Users/v-yadavyash/.fx/certificate/localhost.crt') | ||
ssl_key = os.getenv('SSL_KEY_FILE', 'C:/Users/v-yadavyash/.fx/certificate/localhost.key') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove local path
No description provided.