Skip to content

Commit 3383216

Browse files
Merge pull request SharePoint#6395 from waldekmastykarz/fix-me-experience-images
Updates images in the 'Me-experience' article to match MSDocs guidelines
2 parents ee68b20 + 34b0053 commit 3383216

10 files changed

+115
-7
lines changed
Loading
Binary file not shown.
Loading
Binary file not shown.
Loading
Loading
Binary file not shown.
Loading
Loading

docs/spfx/build-for-teams-me-experience.md

Lines changed: 115 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,79 @@ In this approach, you would start by putting all web parts that you want to expo
8383

8484
![SharePoint Framework project with the different web parts that make up the Me-experience](../images/me-experience/me-experience-spfx-project.png)
8585

86-
Next, you'd update the Teams manifest, referencing the different web parts as tabs to the personal app.
87-
88-
![Teams manifest with a multi-tab personal app using the different SharePoint Framework web parts in the project](../images/me-experience/me-experience-manifest.png)
86+
Next, you'd update the Teams manifest, referencing the different web parts as tabs to the personal app, for example:
87+
88+
```json
89+
{
90+
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
91+
"manifestVersion": "1.5",
92+
"packageName": "MyContoso",
93+
"id": "e81a1b68-686e-412f-90ac-cb80f2544398",
94+
// ... trimmed for readability
95+
"staticTabs": [
96+
{
97+
"entityId": "com.contoso.my.meetings",
98+
"name": "Meetings",
99+
"contentUrl": "https://{teamSiteDomain}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/_layouts/15/teamshostedapp.aspx%3Fteams%26personal%26componentId=e81a1b68-686e-412f-90ac-cb80f2544398%26forceLocale={locale}",
100+
"scopes": [
101+
"personal"
102+
]
103+
},
104+
{
105+
"entityId": "com.contoso.my.mail",
106+
"name": "Mail",
107+
"contentUrl": "https://{teamSiteDomain}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/_layouts/15/teamshostedapp.aspx%3Fteams%26personal%26componentId=e81a1b68-686e-412f-90ac-cb80f2544398%26forceLocale={locale}",
108+
"scopes": [
109+
"personal"
110+
]
111+
},
112+
{
113+
"entityId": "com.contoso.my.files",
114+
"name": "Files",
115+
"contentUrl": "https://{teamSiteDomain}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/_layouts/15/teamshostedapp.aspx%3Fteams%26personal%26componentId=e81a1b68-686e-412f-90ac-cb80f2544398%26forceLocale={locale}",
116+
"scopes": [
117+
"personal"
118+
]
119+
},
120+
{
121+
"entityId": "com.contoso.my.settings",
122+
"name": "Settings",
123+
"contentUrl": "https://{teamSiteDomain}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/_layouts/15/teamshostedapp.aspx%3Fteams%26personal%26componentId=e81a1b68-686e-412f-90ac-cb80f2544398%26forceLocale={locale}",
124+
"scopes": [
125+
"personal"
126+
]
127+
}
128+
],
129+
// ...trimmed for readability
130+
}
131+
```
89132

90133
> [!IMPORTANT]
91134
> Ensure that the web parts that you want to expose in the personal Teams app, have in their manifest, in the `supportedHosts` property the `TeamsPersonalApp` value specified.
92135
93136
To let users configure web parts exposed on the different tabs, you could build a separate Settings web part and expose it as a tab.
94137

95-
![Settings web part exposed as a tab in the Me personal Teams app](../images/me-experience/me-experience-settings.png)
138+
```json
139+
{
140+
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
141+
"manifestVersion": "1.5",
142+
"packageName": "MyContoso",
143+
"id": "e81a1b68-686e-412f-90ac-cb80f2544398",
144+
// ... trimmed for readability
145+
"staticTabs": [
146+
// ... trimmed for readability
147+
{
148+
"entityId": "com.contoso.my.settings",
149+
"name": "Settings",
150+
"contentUrl": "https://{teamSiteDomain}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/_layouts/15/teamshostedapp.aspx%3Fteams%26personal%26componentId=e81a1b68-686e-412f-90ac-cb80f2544398%26forceLocale={locale}",
151+
"scopes": [
152+
"personal"
153+
]
154+
}
155+
],
156+
// ...trimmed for readability
157+
}
158+
```
96159

97160
### Advantages of building multi-tab personal Teams apps
98161

@@ -152,9 +215,54 @@ To put it in practice, let's say you have a project with the following web parts
152215

153216
![Multiple web parts grouped on a single tab](../images/me-experience/me-experience-container-webpart.png)
154217

155-
To simplify the user-experience, you can build a new web part and have its root React component reference React components of each of these web parts.
156-
157-
![React components of personal web parts referenced in a new web part](../images/me-experience/me-experience-container-webpart-code.png)
218+
To simplify the user-experience, you can build a new web part and have its root React component reference React components of each of these web parts, for example:
219+
220+
```tsx
221+
import { WebPartTitle } from '@pnp/spfx-controls-react/lib/WebPartTitle';
222+
import * as React from 'react';
223+
import { IPlanningProps } from '.';
224+
import PersonalCalendar from '../../personalCalendar/components/PersonalCalendar';
225+
import { PersonalTasks } from '../../personalTasks/components';
226+
import RecentlyUsedDocuments from '../../recentlyUsedDocuments/components/RecentlyUsedDocuments';
227+
import styles from './Planning.module.scss';
228+
229+
export default class Planning extends React.Component<IPlanningProps, {}> {
230+
public render(): React.ReactElement<IPlanningProps> {
231+
return (
232+
<div className={styles.planning}>
233+
<WebPartTitle displayMode={this.props.displayMode}
234+
title='Planning'
235+
updateProperty={this.props.updateProperty} />
236+
<div className={styles.column}>
237+
<PersonalCalendar displayMode={this.props.displayMode}
238+
graphClient={this.props.graphClient}
239+
title='Upcoming meetings'
240+
daysInAdvance={4}
241+
numMeetings={0}
242+
refreshInterval={5}
243+
updateProperty={this.props.updateProperty} />
244+
</div>
245+
<div className={styles.column}>
246+
<PersonalTasks displayMode={this.props.displayMode}
247+
graphClient={this.props.graphClient}
248+
updateProperty={this.props.updateProperty}
249+
title='My tasks'
250+
showCompleted={false}
251+
userName={this.props.pageContext.user.loginName} />
252+
</div>
253+
<div className={styles.column}>
254+
<RecentlyUsedDocuments context={this.props.pageContext}
255+
title='My recent documents'
256+
displayMode={this.props.displayMode}
257+
graphClient={this.props.graphClient}
258+
updateProperty={this.props.updateProperty}
259+
nrOfItems={10} />
260+
</div>
261+
</div>
262+
);
263+
}
264+
}
265+
```
158266

159267
Such container web part allows you to reuse your existing code without duplicating it. Additionally, you will improve the user experience by combining related information and decrease the number of different tabs exposed.
160268

0 commit comments

Comments
 (0)