mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-07 13:38:39 +00:00
fix sort people by
This commit is contained in:
parent
71c62ef07d
commit
0b5a961d90
@ -60,6 +60,7 @@ Solution|Author(s)
|
||||
Directory Web Part|João Mendes
|
||||
Directory Web Part| Peter Paul Kirschner ([@petkir_at](https://twitter.com/petkir_at))
|
||||
Directory Web Part| Sudharsan K ([@sudharsank](https://twitter.com/sudharsank))
|
||||
Directory Web Part| Abderahman Moujahid
|
||||
|
||||
## Version history
|
||||
|
||||
@ -67,8 +68,9 @@ Version|Date|Comments
|
||||
-------|----|--------
|
||||
1.0.0|July 29, 2019|Initial release
|
||||
1.0.1|July 19, 2020|Bugfix and mock-service for workbench (```LivePersonaCard``` not supported in workbench)
|
||||
2.0.0.0|Sep 18 2020|React hooks, paging, dynamic search props, result alignment using office ui fabric stack.
|
||||
3.0.0.0|Oct 17 2020|Minor fixes and add the additional web part property.
|
||||
2.0.0|Sep 18 2020|React hooks, paging, dynamic search props, result alignment using office ui fabric stack.
|
||||
3.0.0|Oct 17 2020|Minor fixes and add the additional web part property.
|
||||
3.0.1|March 4 2021|Bugfix 'Sort People by'
|
||||
|
||||
|
||||
## Disclaimer
|
||||
|
@ -10,7 +10,7 @@
|
||||
},
|
||||
"name": "Search Directory",
|
||||
"id": "5b62bc16-3a71-461d-be2f-16bfcb011e8a",
|
||||
"version": "3.0.0.0",
|
||||
"version": "3.0.1.0",
|
||||
"includeClientSideAssets": true,
|
||||
"skipFeatureDeployment": true,
|
||||
"isDomainIsolated": false
|
||||
|
@ -5,7 +5,7 @@ interface MinimalMockUser {
|
||||
FirstName: string;
|
||||
LastName: string;
|
||||
Department: string;
|
||||
Location: string;
|
||||
BaseOfficeLocation: string;
|
||||
Title: string;
|
||||
PreferredName: string;
|
||||
WorkPhone: string;
|
||||
@ -68,7 +68,7 @@ export class spMockServices implements ISPServices {
|
||||
LastName: `${lastNameL}LastName${i}`,
|
||||
PreferredName: `${firstNameL}FirstName${i} ${lastNameL}LastName${i}`,
|
||||
Department: i % 2 === 0 ? `${lastNameL}Department` : `${firstNameL}Department`,
|
||||
Location: i % 3 === 0 ? `${lastNameL}Location` : `${firstNameL}Location`,
|
||||
BaseOfficeLocation: i % 3 === 0 ? `${lastNameL}Location` : `${firstNameL}Location`,
|
||||
Title: i % 2 === 0 ? `${lastNameL}JobTitle` : `${firstNameL}JobTitle`,
|
||||
WorkPhone: '' + Math.floor(Math.random() * 1234) + 54678900
|
||||
});
|
||||
|
@ -141,8 +141,7 @@ export default class Directory extends React.Component<
|
||||
const users = await this._services.searchUsers(
|
||||
searchText,
|
||||
this.props.searchFirstName
|
||||
);
|
||||
debugger;
|
||||
);
|
||||
if (users && users.PrimarySearchResults.length > 0) {
|
||||
for (let index = 0; index < users.PrimarySearchResults.length; index++) {
|
||||
let user: any = users.PrimarySearchResults[index];
|
||||
|
@ -192,7 +192,7 @@ const DirectoryHook: React.FC<IDirectoryProps> = (props) => {
|
||||
_searchUsers = debounce(500, _searchUsers);
|
||||
|
||||
const _sortPeople = async (sortField: string) => {
|
||||
let _users = state.users;
|
||||
let _users = [...state.users];
|
||||
_users = _users.sort((a: any, b: any) => {
|
||||
switch (sortField) {
|
||||
// Sorte by FirstName
|
||||
|
Loading…
x
Reference in New Issue
Block a user