Skip to content
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

Oneway and Mutual Dependency ElementRelationShip #1360

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions samples/app-hello-world/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ urlFragment: officedev-microsoft-teams-samples-app-hello-world-nodejs
* Tabs
* Bots
* Messaging Extensions
* Element RelationShip Property
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm new to sample app creation, but why do we not create a separate RT sample app yet use existing hello-world app to illustrate RT usage? This might create confusion to developers.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also so far only elementRelationshipSet is covered. I don't see "hostMustSupportFunctionalities" yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

* OneWay Dependency
* Mutual Dependency

## Interaction with app

![HelloWorldGif](Images/AppHelloWorldGif.gif)

![ElementRelationShipProperty](Images/ElementRelationShip/OneWay_MutualDependency.gif)


## Try it yourself - experience the App in your Microsoft Teams client
Please find below demo manifest which is deployed on Microsoft Azure and you can try it yourself by uploading the app package (.zip file link below) to your teams and/or as a personal app. (Sideloading must be enabled for your tenant, [see steps here](https://docs.microsoft.com/microsoftteams/platform/concepts/build-and-test/prepare-your-o365-tenant#enable-custom-teams-apps-and-turn-on-custom-app-uploading)).

Expand Down Expand Up @@ -164,6 +170,26 @@ The simplest way to run this sample in Teams is to use Teams Toolkit for Visual

**Note:** Similarly, you can test your application in the Office 365 desktop app as well.

**Element RealtionShip Property**
**Oneway Dependency - Bot and Message Extension both should work**
![BotResponse](Images/ElementRelationShip/3.ResponseFromBot_OnewayDepency.png)

![MessageExtension](Images/ElementRelationShip/4.MsgExt_OneWayDependency.png)

**Mutual Dependency - Bot,Tab and Configurable Tab all three should work**
**Group Scope**
![ConfigurableTab](Images/ElementRelationShip/6.ConfigureTab.png)

![GroupChatTab](Images/ElementRelationShip/7.GC_Tab_MutualDependency.png)

![GroupChatBot](Images/ElementRelationShip/8.GC_Bot_MutualDependency.png)

![GroupChatMessageExt](Images/ElementRelationShip/9.GC_MsgExtension.png)

**Outlook - Oneway Dependency**
**Outlook doesn't support bots, and since Message Extensions depend on a bot, the Message Extension doesn't work in Outlook**
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong in two aspects:

  1. If RT is used correctly to specify actionME dependsOn bot, then the actionME shouldn't even show up in Outlook. But in your illustration, the command shows up.
  2. The fact that the command shows up as your illustration displays is actually a bug - the command shows up yet doesn't work. It doesn't represent the correct end result of using RT.

![OutLookMessageExtension](Images/ElementRelationShip/11.Outlook_MsgExt.png)

## Deploy the bot to Azure

To learn more about deploying a bot to Azure, see [Deploy your bot to Azure](https://aka.ms/azuredeployment) for a complete list of deployment instructions.
Expand Down
147 changes: 93 additions & 54 deletions samples/app-hello-world/nodejs/appManifest/manifest.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,119 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
"manifestVersion": "1.16",
"$schema": "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.schema.json",
"manifestVersion": "devPreview",
"version": "1.0.0",
"id": "${{TEAMS_APP_ID}}",
"packageName": "com.contoso.helloworld",
"developer": {
"name": "Contoso",
"websiteUrl": "https://www.microsoft.com",
"privacyUrl": "https://www.microsoft.com/privacy",
"termsOfUseUrl": "https://www.microsoft.com/termsofuse"
"name": "Contoso",
"websiteUrl": "https://www.microsoft.com",
"privacyUrl": "https://www.microsoft.com/privacy",
"termsOfUseUrl": "https://www.microsoft.com/termsofuse"
},
"name": {
"short": "Hello World",
"full": "Hello World App for Microsoft Teams"
"short": "ElementRelationshipSet",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an app for ElementRelationshipSet or for Hello World?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created New sample, Comment fixed

"full": "Hello World App for Microsoft Teams"
},
"description": {
"short": "Hello World App for Microsoft Teams",
"full": "This sample app provides a very simple app for Microsoft Teams. You can extend this to add more content and capabilities."
"short": "Hello World App for Microsoft Teams",
"full": "This sample app provides a very simple app for Microsoft Teams. You can extend this to add more content and capabilities."
},
"icons": {
"outline": "outline.png",
"color": "color.png"
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#60A18E",
"staticTabs": [
{
"entityId": "com.contoso.helloworld.hellotab",
"name": "Hello Tab",
"contentUrl": "https://${{BOT_DOMAIN}}/hello",
"scopes": [
"personal"
"elementRelationshipSet": {
"oneWayDependencies": [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add one more oneWayDepend scenario that's about a tab dependsOn ME (at ME level, instead of command level)

{
"element": {
"name": "composeExtensions",
"id": "composeExt_ID",
"commandIds": [
"getRandomText"
]
},
"dependsOn": [
{
"name": "bots",
"id": "${{AAD_APP_CLIENT_ID}}"
}
]
}
],
"mutualDependencies": [
[
{
"name": "bots",
"id": "${{AAD_APP_CLIENT_ID}}"
},
{
"name": "staticTabs",
"id": "staticTab_ID"
},
{
"name": "configurableTabs",
"id": "configurableTab_ID"
}
]
]
}
},
"staticTabs": [
{
"entityId": "staticTab_ID",
"name": "Hello Tab",
"contentUrl": "https://${{BOT_DOMAIN}}/hello",
"scopes": [
"personal"
]
}
],
"configurableTabs": [
{
"configurationUrl": "https://${{BOT_DOMAIN}}/configure",
"canUpdateConfiguration": true,
"scopes": [
"team"
]
}
{
"id": "configurableTab_ID",
"configurationUrl": "https://${{BOT_DOMAIN}}/configure",
"canUpdateConfiguration": true,
"scopes": [
"team",
"groupChat"
]
}
],
"bots": [
{
"botId": "${{AAD_APP_CLIENT_ID}}",
"needsChannelSelector": false,
"isNotificationOnly": false,
"scopes": [
"team",
"personal"
]
}
{
"botId": "${{AAD_APP_CLIENT_ID}}",
"needsChannelSelector": false,
"isNotificationOnly": false,
"scopes": [
"team",
"personal",
"groupChat"
]
}
],
"composeExtensions": [
{
"botId": "${{AAD_APP_CLIENT_ID}}",
"commands": [
{
"id": "getRandomText",
"description": "Gets some random text and images that you can insert in messages for fun.",
"title": "Get some random text for fun",
"initialRun": true,
"parameters": [
{
"name": "cardTitle",
"description": "Card title to use",
"title": "Card title"
}
{
"id": "composeExt_ID",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a searchME dependsOn bot case. Yet our hero case for RT in terms of command level dependency is really actionME dependsOn bot. And this actionME should also contain a botSentCard scenario.

Also suggest we explicitly use the "type" field to call out the type of the command.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

"botId": "${{AAD_APP_CLIENT_ID}}",
"commands": [
{
"id": "getRandomText",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest we use a more meaningful value for the id field, despite not necessarily needing UUID.

"description": "Gets some random text and images that you can insert in messages for fun.",
"title": "Get some random text for fun",
"initialRun": true,
"parameters": [
{
"name": "cardTitle",
"description": "Card title to use",
"title": "Card title"
}
]
}
]
}
]
}
}
],
"permissions": [],
"validDomains": [
"${{BOT_DOMAIN}}"
"${{BOT_DOMAIN}}"
]
}