From b691f6a826df04027f2330e1c1898d907fab8bd9 Mon Sep 17 00:00:00 2001 From: Derek Leadbetter Date: Tue, 4 Apr 2023 06:35:46 -0400 Subject: [PATCH] IIIF Cloud #28 - Adding sort_by attribute to modal dropdowns --- client/src/components/OrganizationModal.js | 2 +- client/src/components/UserModal.js | 2 +- client/src/pages/Project.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/components/OrganizationModal.js b/client/src/components/OrganizationModal.js index 8cafda0..910b05f 100644 --- a/client/src/components/OrganizationModal.js +++ b/client/src/components/OrganizationModal.js @@ -26,7 +26,7 @@ const OrganizationModal: ComponentType = withTranslation()((props) => ( > OrganizationsService.fetchAll({ search })} + onSearch={(search) => OrganizationsService.fetchAll({ search, sort_by: 'name' })} onSelection={props.onAssociationInputChange.bind(this, 'organization_id', 'organization')} renderOption={(organization) => Organization.toDropdown(organization)} searchQuery={props.item.organization && props.item.organization.name} diff --git a/client/src/components/UserModal.js b/client/src/components/UserModal.js index c4e2703..f4c4bdd 100644 --- a/client/src/components/UserModal.js +++ b/client/src/components/UserModal.js @@ -26,7 +26,7 @@ const UserModal: ComponentType = withTranslation()((props) => ( > UsersService.fetchAll({ search })} + onSearch={(search) => UsersService.fetchAll({ search, sort_by: 'name' })} onSelection={props.onAssociationInputChange.bind(this, 'user_id', 'user')} renderOption={(user) => User.toDropdown(user)} searchQuery={props.item.user && props.item.user.name} diff --git a/client/src/pages/Project.js b/client/src/pages/Project.js index 061e698..f275e29 100644 --- a/client/src/pages/Project.js +++ b/client/src/pages/Project.js @@ -83,7 +83,7 @@ const ProjectForm = withTranslation()((props) => { > OrganizationsService.fetchAll({ search })} + onSearch={(search) => OrganizationsService.fetchAll({ search, sort_by: 'name' })} onSelection={props.onAssociationInputChange.bind(this, 'organization_id', 'organization')} renderOption={(organization) => Organization.toDropdown(organization)} searchQuery={props.item.organization && props.item.organization.name}