Preferences: Add pagination to org configuration page (#60896)

* Add auth labels and access control metadata to org users search results

* Fix search result JSON model

* Org users: Use API for pagination

* Fix default page size

* Refactor: UsersListPage to functional component

* Refactor: update UsersTable component code style

* Add pagination to the /orgs/{org_id}/users endpoint

* Use pagination on the AdminEditOrgPage

* Add /orgs/{org_id}/users/search endpoint to prevent breaking API

* Use existing search store method

* Remove unnecessary error

* Remove unused

* Add query param to search endpoint

* Fix endpoint docs

* Minor refactor

* Fix number of pages calculation

* Use SearchOrgUsers for all org users methods

* Refactor: GetOrgUsers as a service method

* Minor refactor: rename orgId => orgID

* Fix integration tests

* Fix tests
This commit is contained in:
Alexander Zobnin
2023-01-09 11:54:33 +03:00
committed by GitHub
parent d44de7f20a
commit f1b5014efd
22 changed files with 454 additions and 410 deletions
+13 -1
View File
@@ -194,7 +194,19 @@ func (s *Service) RemoveOrgUser(ctx context.Context, cmd *org.RemoveOrgUserComma
// TODO: refactor service to call store CRUD method
func (s *Service) GetOrgUsers(ctx context.Context, query *org.GetOrgUsersQuery) ([]*org.OrgUserDTO, error) {
return s.store.GetOrgUsers(ctx, query)
result, err := s.store.SearchOrgUsers(ctx, &org.SearchOrgUsersQuery{
UserID: query.UserID,
OrgID: query.OrgID,
Query: query.Query,
Page: query.Page,
Limit: query.Limit,
DontEnforceAccessControl: query.DontEnforceAccessControl,
User: query.User,
})
if err != nil {
return nil, err
}
return result.OrgUsers, nil
}
// TODO: refactor service to call store CRUD method