Skip to content

Commit f13d6a3

Browse files
authored
New Control MyTeams (#874)
* new Control MyTeams * commit changes new Control MyTeams * commit chnages My Teams * update docs * update docs * update serve.json * commit changes fixes * commit changes * commit changes on myteams * commit changes * update changes * commit update changes TeamPicker * commit changes * commit changes * commit controlstest changes
1 parent 7caf1f0 commit f13d6a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1817
-233
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- `ListView`: Use new DragDropFiles control [#861](https://github.com/pnp/sp-dev-fx-controls-react/issues/861)
1616
- `FilePicker`: Use new DragDropFiles control [#861](https://github.com/pnp/sp-dev-fx-controls-react/issues/861)
1717
- SharePoint Framework v1.12.1 support
18+
- `ListView`: Ability to provide custom sorting function [#880](https://github.com/pnp/sp-dev-fx-controls-react/issues/880)
1819

1920
### Fixes
2021

@@ -25,6 +26,7 @@
2526
- `FilePicker`: React crash on large folders [#826](https://github.com/pnp/sp-dev-fx-controls-react/issues/826)
2627
- `ListItemAttachments`: updated filename replacement logic [#873](https://github.com/pnp/sp-dev-fx-controls-react/pull/873)
2728
- `RichText`: Adding a link does not work [#875](https://github.com/pnp/sp-dev-fx-controls-react/issues/875)
29+
- `FilePicker`: Stock images url is getting a 404 server error [#882](https://github.com/pnp/sp-dev-fx-controls-react/issues/882)
2830

2931
### Contributors
3032

config/serve.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
33
"port": 4321,
4-
"initialPage": "https://localhost:5432/workbench",
4+
"initialPage": "https://localhost:5432/workbench",
55
"https": true,
66
"api": {
77
"port": 5432,

docs/documentation/docs/about/release-notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- `ListView`: Use new DragDropFiles control [#861](https://github.com/pnp/sp-dev-fx-controls-react/issues/861)
1616
- `FilePicker`: Use new DragDropFiles control [#861](https://github.com/pnp/sp-dev-fx-controls-react/issues/861)
1717
- SharePoint Framework v1.12.1 support
18+
- `ListView`: Ability to provide custom sorting function [#880](https://github.com/pnp/sp-dev-fx-controls-react/issues/880)
1819

1920
### Fixes
2021

@@ -25,6 +26,7 @@
2526
- `FilePicker`: React crash on large folders [#826](https://github.com/pnp/sp-dev-fx-controls-react/issues/826)
2627
- `ListItemAttachments`: updated filename replacement logic [#873](https://github.com/pnp/sp-dev-fx-controls-react/pull/873)
2728
- `RichText`: Adding a link does not work [#875](https://github.com/pnp/sp-dev-fx-controls-react/issues/875)
29+
- `FilePicker`: Stock images url is getting a 404 server error [#882](https://github.com/pnp/sp-dev-fx-controls-react/issues/882)
2830

2931
### Contributors
3032

2.33 MB
Loading
219 KB
Loading
2.27 MB
Loading
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# MyTeams control
2+
3+
This control show all Teams the user has access (joined),and for each Team the user can see the channels has permissions and quick open the channel or if callback is specified can return the Team Id and Channel Id for use in App.
4+
5+
The user can quick see the members and owner of group.
6+
This control use [mgt-toolkit](https://docs.microsoft.com/en-us/graph/toolkit/overview) component [People](https://docs.microsoft.com/en-us/graph/toolkit/components/people) that can be configured to show Person Card on hover.
7+
8+
Here is an example of the control:
9+
10+
![myTeams](../assets/myteams01.gif)
11+
12+
![myTeams](../assets/myteams02.gif)
13+
14+
![myTeams](../assets/myteams01.png)
15+
16+
## How to use this control in your solutions
17+
18+
- Check that you installed the `@pnp/spfx-controls-react` dependency. Check out the [getting started](../../#getting-started) page for more information about installing the dependency.
19+
- Import the control into your component:
20+
21+
```TypeScript
22+
import { MyTeams } from "@pnp/spfx-controls-react/lib/MyTeams";
23+
```
24+
25+
- Use the `MyTeams` control in your code as follows:
26+
27+
```TypeScript
28+
<MyTeams
29+
title="My Teams"
30+
webPartContext={context}
31+
themeVariant={themeVariant}/>
32+
```
33+
34+
```TypeScript
35+
<MyTeams
36+
title="My Teams"
37+
webPartContext={context}
38+
themeVariant={themeVariant}
39+
enablePersonCardInteraction={true}
40+
onSelectedChannel={onSelectedChannel}
41+
/>
42+
```
43+
44+
45+
- The `onSelectedChannel` callback returns the teamId and ChannelId and can be implemented as follows:
46+
47+
```TypeScript
48+
const onSelectedChannel = (teamsId: string, channelId: string) => {
49+
console.log("TeamsId", teamsId);
50+
console.log("ChannelId", channelId);
51+
};
52+
```
53+
54+
## Implementation
55+
56+
57+
The `MyTeams` control can be configured with the following properties:
58+
59+
| Property | Type | Required | Description |
60+
| ---- | ---- | ---- | ---- |
61+
| webPartContext | WebPartContext | yes | The context object of the SPFx loaded webpart |
62+
| title | string | no | Title of WebPart |
63+
| themeVariant |IReadonlyTheme | no | themeVariant |
64+
| enablePersonCardInteraction | boolean | no | Show Person Card on hover |
65+
| onSelectedChannel | (teamId:string,channelId:string) => void; | no | callBack with TeamId and ChannelId Selected |
66+
67+
68+
## MSGraph Permissions required
69+
70+
This control required the flowing scopes :
71+
72+
at least : Team.ReadBasic.All, Channel.ReadBasic.All,
73+
and all Scopes used by [mgt-people](https://docs.microsoft.com/en-us/graph/toolkit/components/people),
74+
and [Person-Card](https://docs.microsoft.com/en-us/graph/toolkit/components/person-card) components

package-lock.json

Lines changed: 212 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"prepare": "husky install"
2020
},
2121
"dependencies": {
22+
"@microsoft/mgt": "^2.1.0",
23+
"@microsoft/mgt-react": "^2.1.0",
2224
"@fluentui/react-northstar": "0.51.3",
2325
"@microsoft/decorators": "1.12.1",
2426
"@microsoft/sp-core-library": "1.12.1",

src/MyTeams.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./controls/MyTeams";

0 commit comments

Comments
 (0)