Skip to content

Commit 8ea2806

Browse files
committed
Merge branch 'Octavie-dev' into dev
2 parents 7725c27 + 576ded9 commit 8ea2806

File tree

9 files changed

+34
-6
lines changed

9 files changed

+34
-6
lines changed

CHANGELOG.JSON

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
"new": [],
77
"enhancements": [],
88
"fixes": [
9-
"New telemetry approach which allows you to use Application Insights [#81](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/81)"
9+
"New telemetry approach which allows you to use Application Insights [#81](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/81)",
10+
"Disabled property for PeoplePicker [#88](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/88)",
11+
"PeoplePicker property selectedItems not implemented? [#90](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/90)"
1012
]
1113
},
12-
"contributions": []
14+
"contributions": ["Octavie van Haaften"]
1315
},
1416
{
1517
"version": "1.5.0",

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
**Fixes**
66

77
- New telemetry approach which allows you to use Application Insights [#81](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/81)
8+
- Disabled property for PeoplePicker [#88](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/88)
9+
- PeoplePicker property selectedItems not implemented? [#90](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/90)
810

911
## 1.5.0
1012

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
**Fixes**
66

77
- New telemetry approach which allows you to use Application Insights [#81](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/81)
8+
- Disabled property for PeoplePicker [#88](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/88)
9+
- PeoplePicker property selectedItems not implemented? [#90](https://github.com/SharePoint/sp-dev-fx-controls-react/issues/90)
810

911
## 1.5.0
1012

docs/documentation/docs/controls/PeoplePicker.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { PeoplePicker } from "@pnp/spfx-controls-react/lib/PeoplePicker";
3434
groupName={"Team Site Owners"} // Leave this blank in case you want to filter from all users
3535
showtooltip={true}
3636
isRequired={true}
37+
disabled={true}
3738
selectedItems={this._getPeoplePickerItems} />
3839
```
3940

@@ -56,6 +57,7 @@ The People picker control can be configured with the following properties:
5657
| groupName | string | no | group from which users are fetched. Leave it blank if need to filter all users |
5758
| personSelectionLimit | number | no | Defines the limit of people that can be selected in the control|
5859
| isRequired | boolean | no | Set if the control is required or not |
60+
| disabled | boolean | no | Set if the control is disabled or not |
5961
| errorMessage | string | no | Specify the error message to display |
6062
| errorMessageclassName | string | no | applies custom styling to the error message section|
6163
| showtooltip | boolean | no | Defines if need a tooltip or not |

docs/documentation/docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ The following controls are currently available:
3636
- [ListView](./controls/ListView) (List view control)
3737
- [Placeholder](./controls/Placeholder) (Control that can be used to show an initial placeholder if the web part has to be configured)
3838
- [SiteBreadcrumb](./controls/SiteBreadcrumb) (Breadcrumb control)
39-
- [SiteBreadcrumb](./controls/TaxonomyPicker) (Taxonomy Picker)
39+
- [TaxonomyPicker](./controls/TaxonomyPicker) (Taxonomy Picker)
40+
- [PeoplePicker](./controls/PeoplePicker) (People Picker)
4041
- [WebPartTitle](./controls/WebPartTitle) (Customizable web part title control)
4142
- [IFrameDialog](./controls/IFrameDialog) (renders a Dialog with an iframe as a content)
4243

docs/documentation/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pages:
1111
- WebPartTitle: 'controls/WebPartTitle.md'
1212
- SecurityTrimmedControl: 'controls/SecurityTrimmedControl.md'
1313
- TaxonomyPicker: 'controls/TaxonomyPicker.md'
14+
- PeoplePicker: 'controls/PeoplePicker.md'
1415
- IFrameDialog: 'controls/IFrameDialog.md'
1516
- 'Field Controls':
1617
- 'Getting started': 'controls/fields/main.md'

src/controls/peoplepicker/IPeoplePicker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export interface IPeoplePickerProps {
1414
* Text of the Control
1515
*/
1616
titleText: string;
17+
/**
18+
* Whether the control is enabled or not
19+
*/
20+
disabled?: boolean;
1721
/**
1822
* Name of SharePoint Group
1923
*/

src/controls/peoplepicker/PeoplePickerComponent.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,16 @@ export class PeoplePicker extends React.Component<IPeoplePickerProps, IPeoplePic
154154
* On persona item changed event
155155
*/
156156
private _onPersonItemsChange = (items: any[]) => {
157+
const { selectedItems } = this.props;
158+
157159
this.setState({
158160
selectedPersons: items,
159161
showmessageerror: items.length > 0 ? false : true
160162
});
163+
164+
if (selectedItems) {
165+
selectedItems(items);
166+
}
161167
}
162168

163169
/**
@@ -248,8 +254,8 @@ export class PeoplePicker extends React.Component<IPeoplePickerProps, IPeoplePic
248254
}
249255

250256
/**
251-
* Default React component render method
252-
*/
257+
* Default React component render method
258+
*/
253259
public render(): React.ReactElement<IPeoplePickerProps> {
254260
const peoplepicker = (
255261
<div id="people" className={`${styles.defaultClass} ${this.props.peoplePickerWPclassName ? this.props.peoplePickerWPclassName : ''}`}>
@@ -267,6 +273,7 @@ export class PeoplePicker extends React.Component<IPeoplePickerProps, IPeoplePic
267273
'aria-label': 'People Picker'
268274
}}
269275
itemLimit={this.props.personSelectionLimit || 1}
276+
disabled={this.props.disabled}
270277
onChange={this._onPersonItemsChange} />
271278
</div>
272279
);

src/webparts/controlsTest/components/ControlsTest.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,18 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
304304
<PeoplePicker
305305
context={this.props.context}
306306
titleText="People Picker"
307-
// personSelectionLimit={3}
307+
personSelectionLimit={5}
308308
// groupName={"Team Site Owners"}
309309
showtooltip={true}
310310
isRequired={true}
311311
selectedItems={this._getPeoplePickerItems} />
312+
313+
<PeoplePicker
314+
context={this.props.context}
315+
titleText="People Picker (disabled)"
316+
disabled={true}
317+
showtooltip={true}
318+
/>
312319
</div>
313320
);
314321
}

0 commit comments

Comments
 (0)