Skip to content

Adds command: teams deeplink tab generate#1722

Closed
nanddeepn wants to merge 8 commits intopnp:masterfrom
nanddeepn:deeplink
Closed

Adds command: teams deeplink tab generate#1722
nanddeepn wants to merge 8 commits intopnp:masterfrom
nanddeepn:deeplink

Conversation

@nanddeepn
Copy link
Copy Markdown
Contributor

Adds 'teams deeplink tab generate' command

Linked Issue

Closes #1656

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 19, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 65514bb on nanddeepn:deeplink into f60120e on pnp:master.

`-l, --label <label>`|The label to use in the deep link
`-m, --tabType <TabTypeOptions>`|The tab type. Allowed values `Static`, `Configurable`
`--query [query]`|JMESPath query string. See [http://jmespath.org/](http://jmespath.org/) for more information and examples
`-o, --output [output]`|Output type. `json|text`. Default `text`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Escaped pipe json|text should be replaced with comma json,text

@rabwill
Copy link
Copy Markdown
Contributor

rabwill commented Jul 20, 2020

Hey @nanddeepn , thank you so much for this.

Looks like the test coverage has dropped, could you please take a look? Feel free to reach out if you have any questions 🙂

@nanddeepn
Copy link
Copy Markdown
Contributor Author

nanddeepn commented Jul 20, 2020

Hi @rabwill
The verbose logging is reported as uncovered. Please share your views to resolve this.
Thank you!
code_coverage

@rabwill
Copy link
Copy Markdown
Contributor

rabwill commented Jul 20, 2020

Hey @nanddeepn , looks like you need to add one more test with debug option true as well to get that covered. My trick usually is to look into other commands and their tests as well to see how they are implemented.

From this report looks like we have 2 things to take care of

  • debug mode test
  • A case for when the tabType is not provided (look at line 60 in the coverage report)
    We can combine both into one test too.

Also when you do an npm run test you can see the coverage report before you push it into the branch. This helps for anyone to resolve any additional test coverage to be adjusted.

If you still have any question please drop us a line, and thank you so much again for sparing your time 👍🏽

@garrytrinder
Copy link
Copy Markdown
Member

Thank you @nanddeepn we will review shortly 👍🏻

Copy link
Copy Markdown
Member

@garrytrinder garrytrinder left a comment

Choose a reason for hiding this comment

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

Thanks @nanddeepn please see my comments in the review.

I've also been having some issues testing this in my tenant, entityId seems to be always returning as null when targeting either out of the box Tabs, like Website and also Custom Tabs from a Custom Teams App.

If you could give any guidance on how you have been testing in your tenant that would be great for me to follow along.

`--verbose`|Runs command with verbose logging
`--debug`|Runs command with debug logging

## Examples
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The example here does not match the example in the command help

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry @garrytrinder ,
Did not get this point. Can you please clarify the command mismatch?

## Examples

Generates a Microsoft Teams deep link from an existing Tab with id 1432c9da-8b9c-4602-9248-e0800f3e3f07

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's remove this unnecessary empty line



Get deeplink for tab with id, for a configurable tab
```sh
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add an empty line here to separate the example text and the example

```

Get deeplink for tab with id, for a static tab
```sh
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add an empty line here to separate the example text and the example

`-c, --channelId <channelId>`|The ID of the channel where the tab exists
`-t, --tabId <tabId>`|The ID of the tab to generate the deep link from
`-l, --label <label>`|The label to use in the deep link
`-m, --tabType <TabTypeOptions>`|The tab type. Allowed values `Static`, `Configurable`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lets change <TabTypeOptions> to <tabTypeOptions>, note the lowercase leading character

Comment on lines +63 to +64
let context: string = `{"channelId": "${args.options.channelId}"}`;
deeplink = { deeplink: `https://teams.microsoft.com/l/entity/${appId}/${entityId}?webUrl=${contentUrl}&label=${args.options.label}&context=${context}` };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As context variable includes special characters or spaces, and will be used in a URL, we should encode the value.


You can only retrieve deeplink to tabs for teams of which you are a member.

Tabs 'Conversations' and 'Files' are present in every team and therefore not
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The docs and command help should match.

Comment thread src/index.spec.ts Outdated
'teams user remove',
'teams user set'
'teams user set',
'teams deeplink tab generate'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As this command does not implement an alias we should remove this line.

tabType: string;
}

class TeamsDeeplinkTabGenerateCommand extends GraphCommand {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should implement the getTelemetryProperties method to provide command telemetry.

{
option: '-m, --tabType <TabTypeOptions>',
description: `The tab type. Allowed values ${this.tabTypeMap.join('|')}. Default ${this.tabTypeMap[0]}`,
autocomplete: this.tabTypeMap
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As we only have two possible values for this option and they are not likely to change, we can just use a string array here to keep things simple and easier to read, as we have done with other commands.

See example here in cdn-policy-set.ts

https://github.com/pnp/office365-cli/blob/9b70527cc776495e73e5644b2b271cb120a26871/src/o365/spo/commands/cdn/cdn-policy-set.ts#L106-L110

@garrytrinder garrytrinder marked this pull request as draft August 15, 2020 09:44
@nanddeepn
Copy link
Copy Markdown
Contributor Author

Thanks @nanddeepn please see my comments in the review.

I've also been having some issues testing this in my tenant, entityId seems to be always returning as null when targeting either out of the box Tabs, like Website and also Custom Tabs from a Custom Teams App.

If you could give any guidance on how you have been testing in your tenant that would be great for me to follow along.

Hi @garrytrinder
I will retest this tomorrow and share my findings. Thanks.

@nanddeepn
Copy link
Copy Markdown
Contributor Author

Thanks @nanddeepn please see my comments in the review.
I've also been having some issues testing this in my tenant, entityId seems to be always returning as null when targeting either out of the box Tabs, like Website and also Custom Tabs from a Custom Teams App.
If you could give any guidance on how you have been testing in your tenant that would be great for me to follow along.

Hi @garrytrinder
I will retest this tomorrow and share my findings. Thanks.

Hi @garrytrinder
The entityId is returned as null from Graph API for OOB tabs.
entityid

Can we use the webUrl property instead?

@garrytrinder
Copy link
Copy Markdown
Member

Can we use the webUrl property instead?

If webUrl contains the entityId in the url string, we could extract it when entityId in the configuration object is null.

@nanddeepn
Copy link
Copy Markdown
Contributor Author

Can we use the webUrl property instead?

If webUrl contains the entityId in the url string, we could extract it when entityId in the configuration object is null.

Thanks! We should always get the entityId from webUrl, because the entityId returned in few cases (like Power Apps tab) does not work correctly for deeplink.

@nanddeepn
Copy link
Copy Markdown
Contributor Author

Hi @garrytrinder
Incorporated review comments. Please review.
Thanks!

@garrytrinder
Copy link
Copy Markdown
Member

Hey @nanddeepn thank you for making the changes, when you are happy for your PR to be reviewed after making changes, please use the “Ready for Review” button to take it out of “Draft” status, that way we know that it is ready to review. I have done this for you on this PR 👍🏻

#1666

@garrytrinder garrytrinder marked this pull request as ready for review August 21, 2020 06:40
@garrytrinder garrytrinder self-assigned this Aug 26, 2020
@garrytrinder
Copy link
Copy Markdown
Member

Thank you for making the changes @nanddeepn however I am still having issues testing this, please see the behaviour seen below.

I added a SharePoint Tab to a Teams Channel and executed the command with the following options

m365 teams deeplink tab generate --teamId 7db85d59-5b57-4cb7-9aff-f76da9dbadb5 --channelId 19:[email protected] --tabId a363a4c3-2182-416f-bd9e-c4f28718210c --label Link

which generates the below URL

https://teams.microsoft.com/l/entity/2a527703-1f6f-4559-a332-d8a7d288cd88/_djb2_msteams_prefix_f911737e-4db2-44fc-8de9-2307c95b3e84?webUrl=https%3A%2F%2Fteams.microsoft.com%2Fl%2Fentity%2F2a527703-1f6f-4559-a332-d8a7d288cd88%2F_djb2_msteams_prefix_f911737e-4db2-44fc-8de9-2307c95b3e84%3FwebUrl%3Dhttps%253a%252f%252ftrinder365dev.sharepoint.com%252fsites%252fExecutiveSupport%252fSitePages%252fHome.aspx%26label%3DHome%26context%3D%257b%250d%250a%2B%2B%2522canvasUrl%2522%253a%2B%2522https%253a%252f%252ftrinder365dev.sharepoint.com%252fsites%252fexecutivesupport%252f_layouts%252f15%252fteamslogon.aspx%253fspfx%253dtrue%2526dest%253dhttps%25253A%25252F%25252Ftrinder365dev.sharepoint.com%25252Fsites%25252FExecutiveSupport%25252FSitePages%25252FHome.aspx%2522%252c%250d%250a%2B%2B%2522channelId%2522%253a%2B%252219%253abf1ef19f49d24983a9ae19e17c41fcf1%2540thread.tacv2%2522%252c%250d%250a%2B%2B%2522subEntityId%2522%253a%2Bnull%250d%250a%257d%26groupId%3D7db85d59-5b57-4cb7-9aff-f76da9dbadb5%26tenantId%3De8954f17-a373-4b61-b54d-45c038fe3188&label=Link

Using this in a link takes me to this page and not the tab in the Team

image

If I go to the tab and copy the link from the menu

image

It generates the below URL

https://teams.microsoft.com/l/entity/2a527703-1f6f-4559-a332-d8a7d288cd88/_djb2_msteams_prefix_3631940468?context=%7B%22subEntityId%22%3Anull%2C%22channelId%22%3A%2219%3Abf1ef19f49d24983a9ae19e17c41fcf1%40thread.tacv2%22%7D&groupId=7db85d59-5b57-4cb7-9aff-f76da9dbadb5&tenantId=e8954f17-a373-4b61-b54d-45c038fe3188

Which when pasted into a chat, takes me to the correct location. Oddly when pasted into a chat, the Tab name is displayed as the link Label even though it is not present in the generated URL, so the UI must be doing something we can't see, however looking at the context object in more detail, it passes null as the subEntityId & populates channelId. The value is value of the parameter is encoded in the URL.

{
  "subEntityId": null,
  "channelId": "19:[email protected]"
}

Based on the above, it would appear that the command implementation is much simpler than first imagined and that we can simply return the webUrl property as the deeplink. The webUrl of the above example is

https://teams.microsoft.com/l/entity/2a527703-1f6f-4559-a332-d8a7d288cd88/_djb2_msteams_prefix_f911737e-4db2-44fc-8de9-2307c95b3e84?webUrl=https%3a%2f%2ftrinder365dev.sharepoint.com%2fsites%2fExecutiveSupport%2fSitePages%2fHome.aspx&label=Home&context=%7b%0d%0a++%22canvasUrl%22%3a+%22https%3a%2f%2ftrinder365dev.sharepoint.com%2fsites%2fexecutivesupport%2f_layouts%2f15%2fteamslogon.aspx%3fspfx%3dtrue%26dest%3dhttps%253A%252F%252Ftrinder365dev.sharepoint.com%252Fsites%252FExecutiveSupport%252FSitePages%252FHome.aspx%22%2c%0d%0a++%22channelId%22%3a+%2219%3abf1ef19f49d24983a9ae19e17c41fcf1%40thread.tacv2%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&groupId=7db85d59-5b57-4cb7-9aff-f76da9dbadb5&tenantId=e8954f17-a373-4b61-b54d-45c038fe3188

The documentation that I refer to in the original Issue seems to be related to deep linking to a Tab within a Teams Personal App and not to a Tab within a Team Channel like this command is attempting to do.

I would suggest that we remove the --tabType and --label options as they are no longer required however this then means that this command would be very similar to a teams tab get command but only returning a specific property value.

@pnp/cli-for-microsoft-365-maintainers thoughts?

@garrytrinder garrytrinder marked this pull request as draft August 26, 2020 21:45
@nanddeepn
Copy link
Copy Markdown
Contributor Author

nanddeepn commented Aug 27, 2020

Hi @garrytrinder

In order to generate the URL to tab, i.e. of type Configurable the command should be as below:

m365 teams deeplink tab generate --teamId 7db85d59-5b57-4cb7-9aff-f76da9dbadb5 --channelId 19:[email protected] --tabId a363a4c3-2182-416f-bd9e-c4f28718210c --label Link --tabType Configurable

Because the default tabType is Static, it generated the URL of static tab for you. Please try by adding the tabType as Configurable.

  • The webUrl always generates the URL to the Configurable tab, so we cannot use it to generate the Static tab URL.
  • We can remove label option as it does not seems to be playing any role.

Please let me know, if I misunderstood your queries.
Thank you.

@waldekmastykarz
Copy link
Copy Markdown
Member

@nanddeepn just for my understanding: is the tabType fixed for the given tab or can you specify different tabType for the same tab which would create different deeplinks that serve different purposes? If you get a correct deeplink only by specifying a correct pair of tab ID and type, then I'd like to suggest that we don't require the user to find out the type of tab and instead retrieve it and set it ourselves to make it easier to use this command.

@nanddeepn
Copy link
Copy Markdown
Contributor Author

nanddeepn commented Aug 28, 2020

Hi @waldekmastykarz
We can specify different tabType for same tab as Static and Configurable. The Configurable one can take you directly to that specific tab inside the Channel.

Each tabType generates different deeplinks.
Format of deeplink for Configurable tabType is as below:
https://teams.microsoft.com/l/entity/{appId}/{entityId}?webUrl={contentUrl}&label={label}&context={context}

Format of deeplink for Static tabType is as below (omitting context):
https://teams.microsoft.com/l/entity/{appId}/{entityId}?webUrl={contentUrl}&label={label}

@waldekmastykarz
Copy link
Copy Markdown
Member

Do both of these generated links work and take you to the tab? If so, what's the difference between them?

@nanddeepn
Copy link
Copy Markdown
Contributor Author

Hi @waldekmastykarz

Here is the output

Deeplink for Configurable tabType
Ran below command to get the deeplink for Configurable tabType:
m365 teams deeplink tab generate --teamId 340537cc-f8e0-41f8-97b0-6cf0218d3357 --channelId 19:[email protected] --tabId c0e57a22-ab3d-43fa-9200-e11f24876041 --label 'MyLabel' --tabType 'Configurable'

Below is the generated deeplink URL:
https://teams.microsoft.com/l/entity/4d3b7fcd-b601-4718-9021-b88dbab77e26/_djb2_msteams_prefix_5b896f4e-4137-4b7f-8c00-c9eff0b79242?webUrl=https%3A%2F%2Fteams.microsoft.com%2Fl%2Fentity%2F4d3b7fcd-b601-4718-9021-b88dbab77e26%2F_djb2_msteams_prefix_5b896f4e-4137-4b7f-8c00-c9eff0b79242%3Flabel%3DTeamsTab%26context%3D%257b%250d%250a%2B%2B%2522canvasUrl%2522%253a%2B%2522https%253a%252f%252fnachan365.sharepoint.com%252fsites%252fBustedMinds%252f_layouts%252f15%252fTeamsLogon.aspx%253fSPFX%253dtrue%2526dest%253d%252fsites%252fBustedMinds%252f_layouts%252f15%252fteamshostedapp.aspx%25253Flist%253de850a61a-cfd4-453f-9b05-a69315e499ed%252526id%253d5%252526webPartInstanceId%253d2e221200-0b95-4d20-b4aa-8ca9dbf03e4b%2522%252c%250d%250a%2B%2B%2522channelId%2522%253a%2B%252219%253aa169ff3b9bb344e382e0fb7972826e1c%2540thread.tacv2%2522%252c%250d%250a%2B%2B%2522subEntityId%2522%253a%2Bnull%250d%250a%257d%26groupId%3D340537cc-f8e0-41f8-97b0-6cf0218d3357%26tenantId%3Dde348bc7-1aeb-4406-8cb3-97db021cadb4&label=MyLabel&context={"channelId": "19%3Aa169ff3b9bb344e382e0fb7972826e1c%40thread.tacv2"}

Output:
configurable

Deeplink for Static tabType
Ran below command to get the deeplink for Configurable tabType:
m365 teams deeplink tab generate --teamId 340537cc-f8e0-41f8-97b0-6cf0218d3357 --channelId 19:[email protected] --tabId c0e57a22-ab3d-43fa-9200-e11f24876041 --label 'MyLabel'

Below is the generated deeplink URL:
https://teams.microsoft.com/l/entity/4d3b7fcd-b601-4718-9021-b88dbab77e26/_djb2_msteams_prefix_5b896f4e-4137-4b7f-8c00-c9eff0b79242?webUrl=https%3A%2F%2Fteams.microsoft.com%2Fl%2Fentity%2F4d3b7fcd-b601-4718-9021-b88dbab77e26%2F_djb2_msteams_prefix_5b896f4e-4137-4b7f-8c00-c9eff0b79242%3Flabel%3DTeamsTab%26context%3D%257b%250d%250a%2B%2B%2522canvasUrl%2522%253a%2B%2522https%253a%252f%252fnachan365.sharepoint.com%252fsites%252fBustedMinds%252f_layouts%252f15%252fTeamsLogon.aspx%253fSPFX%253dtrue%2526dest%253d%252fsites%252fBustedMinds%252f_layouts%252f15%252fteamshostedapp.aspx%25253Flist%253de850a61a-cfd4-453f-9b05-a69315e499ed%252526id%253d5%252526webPartInstanceId%253d2e221200-0b95-4d20-b4aa-8ca9dbf03e4b%2522%252c%250d%250a%2B%2B%2522channelId%2522%253a%2B%252219%253aa169ff3b9bb344e382e0fb7972826e1c%2540thread.tacv2%2522%252c%250d%250a%2B%2B%2522subEntityId%2522%253a%2Bnull%250d%250a%257d%26groupId%3D340537cc-f8e0-41f8-97b0-6cf0218d3357%26tenantId%3Dde348bc7-1aeb-4406-8cb3-97db021cadb4&label=MyLabel

Output:
static

@waldekmastykarz
Copy link
Copy Markdown
Member

So if I understand it correctly, the one takes you to the instance of the tab in a channel, where the other to its definition? In that case, I think we should rename the tabType option to linkType, don't you think @garrytrinder? The command doesn't change the type of tab and it generates both kinds of links for the tab, so naming it tabType is confusing, wouldn't you say? Unless I got it all backwards 😊

@garrytrinder
Copy link
Copy Markdown
Member

garrytrinder commented Aug 30, 2020

Just to make you aware that I changed the spec slightly on the associated issue following @waldekmastykarz comments.

I will make some time to take look through this PR later this evening following your comments @nanddeepn, thank you for providing the detail 👍🏻

@garrytrinder
Copy link
Copy Markdown
Member

At the moment, I don't see what value the static type gives us as it just returns the About tab of the Teams app that contains the Tab, when I would expect to link the tab in the channel.

I have the following Tabs configured in a Teams channel, I have returned the Copy Link (generated using the UI button) and Web Url (taken from the MS Graph Tab response) to see the difference.

Tab Copy Link Web Url
Custom Tab https://teams.microsoft.com/l/channel/19%3Abf1ef19f49d24983a9ae19e17c41fcf1%40thread.tacv2/tab%3A%3A3684540b-1f67-4783-944e-825903731285?groupId=7db85d59-5b57-4cb7-9aff-f76da9dbadb5&tenantId=e8954f17-a373-4b61-b54d-45c038fe3188 https://teams.microsoft.com/l/channel/19%3abf1ef19f49d24983a9ae19e17c41fcf1%40thread.tacv2/tab%3a%3a3684540b-1f67-4783-944e-825903731285?label=MyTeamsApp&groupId=7db85d59-5b57-4cb7-9aff-f76da9dbadb5&tenantId=e8954f17-a373-4b61-b54d-45c038fe3188
SharePoint Tab https://teams.microsoft.com/l/entity/2a527703-1f6f-4559-a332-d8a7d288cd88/_djb2_msteams_prefix_3843585084?context=%7B%22subEntityId%22%3Anull%2C%22channelId%22%3A%2219%3Abf1ef19f49d24983a9ae19e17c41fcf1%40thread.tacv2%22%7D&groupId=7db85d59-5b57-4cb7-9aff-f76da9dbadb5&tenantId=e8954f17-a373-4b61-b54d-45c038fe3188 https://teams.microsoft.com/l/entity/2a527703-1f6f-4559-a332-d8a7d288cd88/_djb2_msteams_prefix_f911737e-4db2-44fc-8de9-2307c95b3e84?webUrl=https%3a%2f%2ftrinder365dev.sharepoint.com%2fsites%2fexecutivesupport%2f_layouts%2f15%2fnews.aspx&label=Home&context=%7b%0d%0a++%22canvasUrl%22%3a+%22https%3a%2f%2ftrinder365dev.sharepoint.com%2fsites%2fexecutivesupport%2f_layouts%2f15%2fteamslogon.aspx%3fspfx%3dtrue%26dest%3dhttps%253A%252F%252Ftrinder365dev.sharepoint.com%252Fsites%252Fexecutivesupport%252F_layouts%252F15%252Fnews.aspx%22%2c%0d%0a++%22channelId%22%3a+%2219%3abf1ef19f49d24983a9ae19e17c41fcf1%40thread.tacv2%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&groupId=7db85d59-5b57-4cb7-9aff-f76da9dbadb5&tenantId=e8954f17-a373-4b61-b54d-45c038fe3188
Azure DevOps Tab https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.vsts/_djb2_msteams_prefix_1996105607?context=%7B%22subEntityId%22%3Anull%2C%22channelId%22%3A%2219%3Abf1ef19f49d24983a9ae19e17c41fcf1%40thread.tacv2%22%7D&groupId=7db85d59-5b57-4cb7-9aff-f76da9dbadb5&tenantId=e8954f17-a373-4b61-b54d-45c038fe3188 https://teams.microsoft.com/l/entity/com.microsoft.teamspace.tab.vsts/_djb2_msteams_prefix_2d42964b-749f-4237-89a7-8e0951298b32?webUrl=https%3a%2f%2fdev.azure.com%2ftrinder365dev%2f698770eb-d883-4f99-98de-f15ff3847de7%2f_boards%2fboard%2ft%2f09ed0aea-8228-4477-990e-8ea02bb8fa33%2fIssues%3fembedded%3dfalse&label=Space+Game+-+web+Team+Issues+Board&context=%7b%0d%0a++%22canvasUrl%22%3a+%22https%3a%2f%2fdev.azure.com%2ftrinder365dev%2f_integrationredirect%2fauthenticationRedirect%3f%26replyto%3dhttps%253A%252F%252Fdev.azure.com%252Ftrinder365dev%252F698770eb-d883-4f99-98de-f15ff3847de7%252F_boards%252Fboard%252Ft%252F09ed0aea-8228-4477-990e-8ea02bb8fa33%252FIssues%253Fembedded%253Dtrue%22%2c%0d%0a++%22channelId%22%3a+%2219%3abf1ef19f49d24983a9ae19e17c41fcf1%40thread.tacv2%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&groupId=7db85d59-5b57-4cb7-9aff-f76da9dbadb5&tenantId=e8954f17-a373-4b61-b54d-45c038fe3188

Using either the Copy Link or Web Url has the desired effect, clicking the link opens the Tab in the Channel.

Looking at the documentation, https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links, there is the below note

This is different from the links provided by the Copy link to tab menu item, which just generates a deep link that points to this tab.

As the webUrl property in the MS Graph Tab response returns a deeplink for the tab in the channel, rather than trying to manually create the deeplink, we could just return that.

To me that changes the behaviour of the command and that rather than generating a deep link we are just returning a specific property of the Tab response.

Rather than having a command that is specific, teams tab deeplink get, we might as use the code already written to implement a teams tab get command which returns all properties including webUrl, which acts as a deeplink. @nanddeepn @waldekmastykarz do you agree?

@waldekmastykarz
Copy link
Copy Markdown
Member

If we can get the url using 'teams tab get' then it would have my preference because we'd be getting the URL directly from the service rather than trying to generate it ourselves.

@nanddeepn
Copy link
Copy Markdown
Contributor Author

Hi @waldekmastykarz, @garrytrinder
Agree with you on this. We can get URL directly from the teams tab get

@waldekmastykarz
Copy link
Copy Markdown
Member

@garrytrinder what's the best way forward: update the existing spec or shall we close this PR, close the related issue and create a whole new issue? Sorry for the trouble @nanddeepn and appreciate you sticking with us 😊

@nanddeepn
Copy link
Copy Markdown
Contributor Author

@garrytrinder what's the best way forward: update the existing spec or shall we close this PR, close the related issue and create a whole new issue? Sorry for the trouble @nanddeepn and appreciate you sticking with us 😊

Happy to help, anytime 😊

@garrytrinder
Copy link
Copy Markdown
Member

@garrytrinder what's the best way forward: update the existing spec or shall we close this PR, close the related issue and create a whole new issue? Sorry for the trouble @nanddeepn and appreciate you sticking with us 😊

I think it would be best to close the PR and related issue.

I'll raise a new issue with the teams tab get spec.

Apologies for the trouble on this @nanddeepn, really appreciate your patience on this one 👍🏻

@garrytrinder
Copy link
Copy Markdown
Member

@nanddeepn I have raised the new issue for teams tab get command and assigned it to you, so I will now close this PR.

@nanddeepn nanddeepn deleted the deeplink branch September 17, 2020 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New command: teams deeplink tab generate

6 participants