Skip to content

Commit c971c3a

Browse files
committed
Merge branch 'tsekityam-patch-4' into dev
2 parents 4bb9b09 + 267db1a commit c971c3a

File tree

6 files changed

+23
-7
lines changed

6 files changed

+23
-7
lines changed

docs/documentation/docs/controls/PeoplePicker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ The People picker control can be configured with the following properties:
7272
| webAbsoluteUrl | string | no | Specify the site URL on which you want to perform the user query call. Default is the current site URL. |
7373
| showHiddenInUI | boolean | no | Show users which are hidden from the UI. By default these users/groups hidden for the UI will not be shown. |
7474
| principleTypes | PrincipleType[] | no | Define which type of data you want to retrieve: User, SharePoint groups, Security groups. Multiple are possible. |
75+
| resultsMaximumNumber | number | no | Maximum number of suggestions to show in the full suggestion list. Default is 5. |
7576

7677
Enum `PrincipalType`
7778

src/controls/peoplepicker/IPeoplePicker.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export interface IPeoplePickerProps {
2828
* Name of SharePoint Group
2929
*/
3030
groupName?: string;
31+
/**
32+
* Maximum number of suggestions to show in the full suggestion list. (default: 5)
33+
*/
34+
resultsMaximumNumber?: number;
3135
/**
3236
* Selection Limit of Control
3337
*/

src/controls/peoplepicker/PeoplePickerComponent.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ import { IPersonaProps } from "office-ui-fabric-react/lib/components/Persona/Per
1717
import { MessageBarType } from "office-ui-fabric-react/lib/components/MessageBar";
1818
import { ValidationState } from 'office-ui-fabric-react/lib/components/pickers/BasePicker.types';
1919

20-
const suggestionProps: IBasePickerSuggestionsProps = {
21-
suggestionsHeaderText: 'Suggested People',
22-
noResultsFoundText: 'No results found',
23-
loadingText: 'Loading'
24-
};
25-
2620
/**
2721
* PeoplePicker component
2822
*/
@@ -367,6 +361,14 @@ export class PeoplePicker extends React.Component<IPeoplePickerProps, IPeoplePic
367361
* Default React component render method
368362
*/
369363
public render(): React.ReactElement<IPeoplePickerProps> {
364+
const suggestionProps: IBasePickerSuggestionsProps = {
365+
suggestionsHeaderText: strings.peoplePickerSuggestionsHeaderText,
366+
noResultsFoundText: strings.peoplePickerNoResultsFoundText,
367+
loadingText: strings.peoplePickerLoadingText,
368+
resultsMaximumNumber: this.props.resultsMaximumNumber ? this.props.resultsMaximumNumber : 5
369+
};
370+
371+
370372
const peoplepicker = (
371373
<div id="people" className={`${styles.defaultClass} ${this.props.peoplePickerWPclassName ? this.props.peoplePickerWPclassName : ''}`}>
372374
<Label>{this.props.titleText || strings.peoplePickerComponentTitleText}</Label>

src/loc/en-us.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,8 @@ define([], () => {
4949
peoplePickerComponentTooltipMessage: "People Picker",
5050
peoplePickerComponentErrorMessage: "People picker is mandatory",
5151
peoplePickerComponentTitleText: "Pick the user(s)",
52+
peoplePickerSuggestionsHeaderText: 'Suggested People',
53+
peoplePickerNoResultsFoundText: 'No results found',
54+
peoplePickerLoadingText: 'Loading'
5255
};
5356
});

src/loc/mystrings.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ declare interface IControlStrings {
22
peoplePickerComponentTooltipMessage: string;
33
peoplePickerComponentErrorMessage: string;
44
peoplePickerComponentTitleText: string;
5+
peoplePickerSuggestionsHeaderText: string;
6+
peoplePickerNoResultsFoundText: string;
7+
peoplePickerLoadingText: string;
8+
9+
510
SiteBreadcrumbLabel: string;
611
ListViewGroupEmptyLabel: string;
712
WebPartTitlePlaceholder: string;

src/webparts/controlsTest/components/ControlsTest.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ private onServicePickerChange(terms: IPickerTerms): void {
350350
defaultSelectedUsers={["[email protected]", "[email protected]"]}
351351
selectedItems={this._getPeoplePickerItems}
352352
showHiddenInUI={false}
353-
principleTypes={[PrincipalType.User]} />
353+
principleTypes={[PrincipalType.User]}
354+
resultsMaximumNumber={2} />
354355

355356
<PeoplePicker
356357
context={this.props.context}

0 commit comments

Comments
 (0)