Skip to content

Commit 52c39aa

Browse files
committed
Merge branch 'joaojmendes-master' into dev
2 parents b08f9a0 + 5e95d72 commit 52c39aa

35 files changed

+1289
-28525
lines changed
130 KB
Loading
9.9 MB
Loading
149 KB
Loading
95.7 KB
Loading
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# TeamChannelPicker control
2+
3+
This control allows you to select one or multiple Team Channel user has permissions.
4+
5+
!!! Note
6+
You can also check out [Microsoft Teams Channel Picker](https://docs.microsoft.com/en-us/graph/toolkit/components/teams-channel-picker) component in the [Microsoft Graph Toolkit](https://github.com/microsoftgraph/microsoft-graph-toolkit).
7+
8+
Here is an example of the control:
9+
10+
![TeamChannelPicker](../assets/SelectTeamPicker.gif)
11+
12+
`SelectTeamChannelPicker` single selection mode:
13+
14+
![Teamselection](../assets/SelectTeamChannelPicker.png)
15+
16+
17+
## How to use this control in your solutions
18+
19+
- 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.
20+
- Import the control into your component:
21+
22+
```TypeScript
23+
import { TeamChannelPicker } from "@pnp/spfx-controls-react/lib/TeamChannelPicker";
24+
```
25+
26+
- Use the `TeamChannelPicker` control in your code as follows:
27+
28+
```TypeScript
29+
<TeamChannelPicker label="Select Team channel"
30+
teamId={teamId}
31+
selectedChannels={selectedTeamChannels}
32+
appcontext={webpartContext}
33+
itemLimit={1}
34+
onSelectedChannels={_onSelectedTeamChannels}/>
35+
```
36+
37+
- The `_onSelectedTeamChannels` change event returns the team channel(s) and can be implemented as follows:
38+
39+
```TypeScript
40+
const _onSelectedTeamChannels ((tagList: ITag[]) => {
41+
console.log(tagList);
42+
}
43+
```
44+
45+
## Implementation
46+
47+
48+
The `SelectTeamChannelPicker` control can be configured with the following properties:
49+
50+
| Property | Type | Required | Description |
51+
| ---- | ---- | ---- | ---- |
52+
| teamId | string | yes | Id of Team to get channels |
53+
| appcontext | WebPartContext \| ExtensionContext | yes | The context object of the SPFx loaded webpart or customizer. |
54+
| selectedChannels | ITag[] | yes | Array with selected channels |
55+
| itemLimit | number | no | number of allowed selected channels |
56+
| label | string | no | Label of Picker |
57+
| styles | IBasePickerStyles | no | Customer Styles of Picker |
58+
| onSelectedChannels: | (tagsList:ITag[]) => void; | yes | callBack with channels Selected |
59+
60+
61+
## MSGraph Permissions required
62+
63+
This control required the flowing scopes :
64+
65+
at least : Team.ReadBasic.All, Channel.ReadBasic.All,
66+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# TeamPicker control
2+
3+
This control allows you to select one or multiple Team user has permissions.
4+
5+
Here is an example of the control:
6+
7+
![TeamPicker](../assets/SelectTeamPicker.gif)
8+
9+
`SelectTeamPicker` single selection mode:
10+
11+
![Teamselection](../assets/SelectTeamPicker_select.png)
12+
13+
14+
## How to use this control in your solutions
15+
16+
- 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.
17+
- Import the control into your component:
18+
19+
```TypeScript
20+
import { SelectTeamPicker } from "@pnp/spfx-controls-react/lib/TeamPicker";
21+
```
22+
23+
- Use the `SelectTeamPicker` control in your code as follows:
24+
25+
```TypeScript
26+
<TeamPicker label="Select Team"
27+
selectedTeams={selectedTeams}
28+
appcontext={webpartContext}
29+
itemLimit={1}
30+
onSelectedTeams={_onSelectedTeams}/>
31+
```
32+
33+
- The `_onSelectedTeams` change event returns the team(s) and can be implemented as follows:
34+
35+
```TypeScript
36+
const _onSelectedTeams ((tagList: ITag[]) => {
37+
console.log(tagList);
38+
}
39+
```
40+
41+
## Implementation
42+
43+
44+
The `TeamPicker` control can be configured with the following properties:
45+
46+
| Property | Type | Required | Description |
47+
| ---- | ---- | ---- | ---- |
48+
| appcontext | WebPartContext \| ExtensionContext | yes | The context object of the SPFx loaded webpart or customizer. |
49+
| selectedTeams | ITag[] | yes | Array with Selected Teams |
50+
| itemLimit | number | no | number of allowed selected items |
51+
| label | string | no | Label of Picker |
52+
| styles | IBasePickerStyles | no | Customer Styles of Picker |
53+
| onSelectedTeams: | (tagsList:ITag[]) => void; | yes | callBack with teams Selected |
54+
55+
56+
## MSGraph Permissions required
57+
58+
This control required the flowing scopes :
59+
60+
at least : Team.ReadBasic.All, Channel.ReadBasic.All,

docs/documentation/docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ The following controls are currently available:
8585
- [SiteBreadcrumb](./controls/SiteBreadcrumb) (Breadcrumb control)
8686
- [SecurityTrimmedControl](./controls/SecurityTrimmedControl) (intended to be used when you want to show or hide components based on the user permissions)
8787
- [TaxonomyPicker](./controls/TaxonomyPicker) (Taxonomy Picker)
88+
- [TeamChannelPicker](./controls/TeamChannelPicker) (Team Channel Picker)
89+
- [TeamPicker](./controls/TeamPicker) (Team Picker)
8890
- [Toolbar](./controls/Toolbar) (Control to render Toolbar in Microsoft Teams)
8991
- [TreeView](./controls/TreeView) (Tree View)
9092
- [WebPartTitle](./controls/WebPartTitle) (Customizable web part title control)

docs/documentation/mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ nav:
4949
- SiteBreadcrumb: 'controls/SiteBreadcrumb.md'
5050
- SecurityTrimmedControl: 'controls/SecurityTrimmedControl.md'
5151
- TaxonomyPicker: 'controls/TaxonomyPicker.md'
52+
- TeamChannelPicker: 'controls/TeamChannelPicker.md'
53+
- TeamPicker: 'controls/TeamPicker.md'
5254
- Toolbar: 'controls/Toolbar.md'
5355
- TreeView: 'controls/TreeView.md'
5456
- WebPartTitle: 'controls/WebPartTitle.md'

0 commit comments

Comments
 (0)