Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SmitaNachan committed Sep 12, 2024
1 parent fc09973 commit 60c2c30
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 12 deletions.
6 changes: 4 additions & 2 deletions docs/docs/cmd/teams/tab/tab-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ m365 teams tab list --teamId 00000000-0000-0000-0000-000000000000 --channelId 19
``` text
displayName : My Contoso Tab
id : 34991fbf-59f4-48d9-b094-b9d64d550e23
teamsAppTabId: 1542629c-01b3-4a6d-8f76-1938b779e48d
```

</TabItem>
<TabItem value="CSV">

``` text
id,displayName
34991fbf-59f4-48d9-b094-b9d64d550e23,My Contoso Tab
id,displayName,teamsAppTabId
34991fbf-59f4-48d9-b094-b9d64d550e23,My Contoso Tab,1542629c-01b3-4a6d-8f76-1938b779e48d
```

</TabItem>
Expand All @@ -103,6 +104,7 @@ m365 teams tab list --teamId 00000000-0000-0000-0000-000000000000 --channelId 19
id | 34991fbf-59f4-48d9-b094-b9d64d550e23
displayName | My Contoso Tab
webUrl | https://teams.microsoft.com/l/entity/1542629c-01b3-4a6d-8f76-1938b779e48d/_djb2_msteams_prefix_34991fbf-59f4-48d9-b094-b9d64d550e23?webUrl=https%3a%2f%2fteams.contoso.ai%2fmsteams%2fcontent%2ftab%2fteam%3ftheme%3d%7btheme%7d&label=My%20Contoso%20Tab&context=%7b%0d%0a++%22canvasUrl%22%3a+%22https%3a%2f%2fteams.contoso.ai%2fmsteams%2fcontent%2ftab%2fteam%3ftheme%3d%7btheme%7d%22%2c%0d%0a++%22channelId%22%3a+%2219%3aB3nCnLKwwCoGDEADyUgQ5kJ5Pkekujyjmwxp7uhQeAE1%40thread.tacv2%22%2c%0d%0a++%22subEntityId%22%3a+null%0d%0a%7d&groupId=aee5a2c9-b1df-45ac-9964-c708e760a045&tenantId=92e59666-257b-49c3-b1fa-1bae8107f6ba
teamsAppTabId | 1542629c-01b3-4a6d-8f76-1938b779e48d
```

</TabItem>
Expand Down
10 changes: 10 additions & 0 deletions docs/docs/v10-upgrade-guidance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ Overwriting the SPFx package should be the default behavior of the continuous de

Please update your scripts not to use the `overwrite` option.

## Teams

### Removes duplicate property from 'teams tab list' command.

In the [teams tab list](./cmd/teams/tab/tab-list.mdx) we removed the `teamsAppTabId` from the command output as it was a duplicate of the `teamsApp/id` property.

#### What action do I need to take?

Please update your scripts not to use the `teamsAppTabId` property from the command output.

## Yammer (Viva Engage)

### Removal of deprecated Yammer aliases
Expand Down
62 changes: 52 additions & 10 deletions src/m365/teams/commands/tab/tab-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ describe(commands.TAB_LIST, () => {
} as any), new CommandError('Channel id is not in a valid format: 29:d09d9792d59544af846fa19c98b6acc6@thread.skype'));
});

it('correctly lists all tabs in a Microsoft Teams channel', async () => {
it('correctly lists all tabs in a Microsoft Teams channel in text format', async () => {
sinon.stub(request, 'get').callsFake(async (opts) => {
if (opts.url === `https://graph.microsoft.com/v1.0/teams/00000000-0000-0000-0000-000000000000/channels/19%3A00000000000000000000000000000000%40thread.skype/tabs?$expand=teamsApp`) {
return {
Expand Down Expand Up @@ -175,9 +175,11 @@ describe(commands.TAB_LIST, () => {
await command.action(logger, {
options: {
teamId: '00000000-0000-0000-0000-000000000000',
channelId: '19:00000000000000000000000000000000@thread.skype'
channelId: '19:00000000000000000000000000000000@thread.skype',
output: 'text'
}
});

assert(loggerLogSpy.calledWith([{
"id": "e7cb46d2-b291-409a-b4bc-f5bdd26f10d4",
"displayName": "Document%20Library",
Expand All @@ -193,7 +195,8 @@ describe(commands.TAB_LIST, () => {
"externalId": null,
"displayName": "Document Library",
"distributionMethod": "store"
}
},
"teamsAppTabId": "com.microsoft.teamspace.tab.files.sharepoint"
},
{
"id": "ba38f554-9ce6-4719-bc9b-e38e4ca16860",
Expand All @@ -211,7 +214,8 @@ describe(commands.TAB_LIST, () => {
"externalId": null,
"displayName": "Website",
"distributionMethod": "store"
}
},
"teamsAppTabId": "com.microsoft.teamspace.tab.web"
},
{
"id": "b6c511f1-3ad7-4111-8a82-36b13aad4c9e",
Expand All @@ -228,7 +232,8 @@ describe(commands.TAB_LIST, () => {
"externalId": null,
"displayName": "Word",
"distributionMethod": "store"
}
},
"teamsAppTabId": "com.microsoft.teamspace.tab.file.staticviewer.word"
},
{
"id": "d9e972d8-e93d-4b87-beb2-3698912398ea",
Expand All @@ -248,21 +253,58 @@ describe(commands.TAB_LIST, () => {
"externalId": null,
"displayName": "Wiki",
"distributionMethod": "store"
}
},
"teamsAppTabId": "com.microsoft.teamspace.tab.wiki"
}]));
});

it('correctly lists all tabs in a Microsoft Teams channel (debug)', async () => {
it('correctly lists all tabs in a Microsoft Teams channel in json format', async () => {
sinon.stub(request, 'get').callsFake(async (opts) => {
if (opts.url === `https://graph.microsoft.com/v1.0/teams/00000000-0000-0000-0000-000000000000/channels/19%3A00000000000000000000000000000000%40thread.skype/tabs?$expand=teamsApp`) {
return {
value: [{ "id": "e7cb46d2-b291-409a-b4bc-f5bdd26f10d4", "displayName": "Document%20Library", "webUrl": "https://teams.microsoft.com/l/channel/19%3a552b7125655c46d5b5b86db02ee7bfdf%40thread.skype/tab%3a%3afbd8cf48-e450-463a-8636-231307dda5f6?label=Document%2520Library&groupId=aa5cf078-46e3-4bcf-9e02-e15ff6efe889&tenantId=a1d5f937-b756-46d7-b92f-464629a6d985", "configuration": { "entityId": null, "contentUrl": "https://contoso.sharepoint.com/sites/MoCaDeSyMo/Freigegebene Dokumente", "removeUrl": null, "websiteUrl": null }, "teamsApp": { "id": "com.microsoft.teamspace.tab.files.sharepoint", "externalId": null, "displayName": "Document Library", "distributionMethod": "store" } }, { "id": "ba38f554-9ce6-4719-bc9b-e38e4ca16860", "displayName": "CLI-Microsoft365", "webUrl": "https://teams.microsoft.com/l/channel/19%3a552b7125655c46d5b5b86db02ee7bfdf%40thread.skype/tab%3a%3a5a2f05cf-0b6d-4012-b296-342d89158248?webUrl=https%3a%2f%2fgithub.com%2fpnp%2fcli-microsoft365&label=CLI-Microsoft365&groupId=aa5cf078-46e3-4bcf-9e02-e15ff6efe889&tenantId=a1d5f937-b756-46d7-b92f-464629a6d985", "configuration": { "entityId": null, "contentUrl": "https://github.com/pnp/cli-microsoft365", "removeUrl": null, "websiteUrl": "https://github.com/pnp/cli-microsoft365", "dateAdded": "2019-03-28T18:35:53.81Z" }, "teamsApp": { "id": "com.microsoft.teamspace.tab.web", "externalId": null, "displayName": "Website", "distributionMethod": "store" } }, { "id": "b6c511f1-3ad7-4111-8a82-36b13aad4c9e", "displayName": "Word", "webUrl": "https://teams.microsoft.com/l/channel/19%3a552b7125655c46d5b5b86db02ee7bfdf%40thread.skype/tab%3a%3a00b9c26c-b0f4-4c1a-98fa-426aded95ca3?label=Word&groupId=aa5cf078-46e3-4bcf-9e02-e15ff6efe889&tenantId=a1d5f937-b756-46d7-b92f-464629a6d985", "configuration": { "entityId": "C6DBBF49-0290-4194-B3DA-319A72014FD6", "contentUrl": "https://contoso.sharepoint.com/sites/MoCaDeSyMo/Freigegebene Dokumente/General/Kopieren und Verschieben von Dateien in Office365.docx", "removeUrl": null, "websiteUrl": null }, "teamsApp": { "id": "com.microsoft.teamspace.tab.file.staticviewer.word", "externalId": null, "displayName": "Word", "distributionMethod": "store" } }, { "id": "d9e972d8-e93d-4b87-beb2-3698912398ea", "displayName": "Wiki", "webUrl": "https://teams.microsoft.com/l/channel/19%3a552b7125655c46d5b5b86db02ee7bfdf%40thread.skype/tab%3a%3a9d44e015-ae5c-47dc-9577-5af76609e2b0?label=Wiki&groupId=aa5cf078-46e3-4bcf-9e02-e15ff6efe889&tenantId=a1d5f937-b756-46d7-b92f-464629a6d985", "configuration": { "entityId": null, "contentUrl": null, "removeUrl": null, "websiteUrl": null, "wikiTabName": "Wiki", "wikiTabId": 1, "wikiDefaultTab": true }, "teamsApp": { "id": "com.microsoft.teamspace.tab.wiki", "externalId": null, "displayName": "Wiki", "distributionMethod": "store" } }]
value: [
{
"id": "e7cb46d2-b291-409a-b4bc-f5bdd26f10d4",
"displayName": "Document%20Library",
"webUrl": "https://teams.microsoft.com/l/channel/19%3a552b7125655c46d5b5b86db02ee7bfdf%40thread.skype/tab%3a%3afbd8cf48-e450-463a-8636-231307dda5f6?label=Document%2520Library&groupId=aa5cf078-46e3-4bcf-9e02-e15ff6efe889&tenantId=a1d5f937-b756-46d7-b92f-464629a6d985",
"configuration": { "entityId": null, "contentUrl": "https://contoso.sharepoint.com/sites/MoCaDeSyMo/Freigegebene Dokumente", "removeUrl": null, "websiteUrl": null },
"teamsApp": { "id": "com.microsoft.teamspace.tab.files.sharepoint", "externalId": null, "displayName": "Document Library", "distributionMethod": "store" }
},
{
"id": "ba38f554-9ce6-4719-bc9b-e38e4ca16860",
"displayName": "CLI-Microsoft365",
"webUrl": "https://teams.microsoft.com/l/channel/19%3a552b7125655c46d5b5b86db02ee7bfdf%40thread.skype/tab%3a%3a5a2f05cf-0b6d-4012-b296-342d89158248?webUrl=https%3a%2f%2fgithub.com%2fpnp%2fcli-microsoft365&label=CLI-Microsoft365&groupId=aa5cf078-46e3-4bcf-9e02-e15ff6efe889&tenantId=a1d5f937-b756-46d7-b92f-464629a6d985",
"configuration": { "entityId": null, "contentUrl": "https://github.com/pnp/cli-microsoft365", "removeUrl": null, "websiteUrl": "https://github.com/pnp/cli-microsoft365", "dateAdded": "2019-03-28T18:35:53.81Z" },
"teamsApp": { "id": "com.microsoft.teamspace.tab.web", "externalId": null, "displayName": "Website", "distributionMethod": "store" }
},
{
"id": "b6c511f1-3ad7-4111-8a82-36b13aad4c9e",
"displayName": "Word",
"webUrl": "https://teams.microsoft.com/l/channel/19%3a552b7125655c46d5b5b86db02ee7bfdf%40thread.skype/tab%3a%3a00b9c26c-b0f4-4c1a-98fa-426aded95ca3?label=Word&groupId=aa5cf078-46e3-4bcf-9e02-e15ff6efe889&tenantId=a1d5f937-b756-46d7-b92f-464629a6d985",
"configuration": { "entityId": "C6DBBF49-0290-4194-B3DA-319A72014FD6", "contentUrl": "https://contoso.sharepoint.com/sites/MoCaDeSyMo/Freigegebene Dokumente/General/Kopieren und Verschieben von Dateien in Office365.docx", "removeUrl": null, "websiteUrl": null },
"teamsApp": { "id": "com.microsoft.teamspace.tab.file.staticviewer.word", "externalId": null, "displayName": "Word", "distributionMethod": "store" }
},
{
"id": "d9e972d8-e93d-4b87-beb2-3698912398ea",
"displayName": "Wiki",
"webUrl": "https://teams.microsoft.com/l/channel/19%3a552b7125655c46d5b5b86db02ee7bfdf%40thread.skype/tab%3a%3a9d44e015-ae5c-47dc-9577-5af76609e2b0?label=Wiki&groupId=aa5cf078-46e3-4bcf-9e02-e15ff6efe889&tenantId=a1d5f937-b756-46d7-b92f-464629a6d985",
"configuration": { "entityId": null, "contentUrl": null, "removeUrl": null, "websiteUrl": null, "wikiTabName": "Wiki", "wikiTabId": 1, "wikiDefaultTab": true },
"teamsApp": { "id": "com.microsoft.teamspace.tab.wiki", "externalId": null, "displayName": "Wiki", "distributionMethod": "store" }
}
]
};
}
throw 'Invalid request';
});

await command.action(logger, { options: { debug: true, teamId: "00000000-0000-0000-0000-000000000000", channelId: "19:00000000000000000000000000000000@thread.skype" } });
await command.action(logger, {
options: {
teamId: '00000000-0000-0000-0000-000000000000',
channelId: '19:00000000000000000000000000000000@thread.skype',
output: 'json'
}
});

assert(loggerLogSpy.calledWith([{
"id": "e7cb46d2-b291-409a-b4bc-f5bdd26f10d4",
"displayName": "Document%20Library",
Expand Down Expand Up @@ -336,4 +378,4 @@ describe(commands.TAB_LIST, () => {
}
}]));
});
});
});
7 changes: 7 additions & 0 deletions src/m365/teams/commands/tab/tab-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ class TeamsTabListCommand extends GraphCommand {

try {
const items = await odata.getAllItems<TeamsTab>(endpoint);

if (args.options.output !== 'json') {
items.forEach(i => {
(i as any).teamsAppTabId = i.teamsApp!.id;
});
}

await logger.log(items);
}
catch (err: any) {
Expand Down

0 comments on commit 60c2c30

Please sign in to comment.