mirror of
https://github.com/fleetdm/fleet
synced 2026-05-06 06:48:54 +00:00
Fleet UI: Fix bug to view more than 20 teams (#7623)
This commit is contained in:
parent
df014bd508
commit
cd8e42ba82
3 changed files with 9 additions and 13 deletions
1
changes/issue-7622-more-than-20-teams-in-ui
Normal file
1
changes/issue-7622-more-than-20-teams-in-ui
Normal file
|
|
@ -0,0 +1 @@
|
|||
* UI supports more than 20 teams
|
||||
|
|
@ -253,7 +253,7 @@ const TeamManagementPage = (): JSX.Element => {
|
|||
showMarkAllPages={false}
|
||||
isAllPagesSelected={false}
|
||||
searchable={teams && teams.length > 0 && searchString !== ""}
|
||||
disablePagination
|
||||
isClientSidePagination
|
||||
/>
|
||||
)}
|
||||
{showCreateTeamModal && (
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import sendRequest from "services";
|
|||
import endpoints from "utilities/endpoints";
|
||||
import { pick } from "lodash";
|
||||
|
||||
import { buildQueryStringFromParams } from "utilities/url";
|
||||
import { IEnrollSecret } from "interfaces/enroll_secret";
|
||||
import {
|
||||
INewMembersBody,
|
||||
|
|
@ -51,21 +52,15 @@ export default {
|
|||
return sendRequest("GET", path);
|
||||
},
|
||||
loadAll: ({
|
||||
page = 0,
|
||||
perPage = 20,
|
||||
globalFilter = "",
|
||||
}: ILoadTeamsParams = {}): Promise<ILoadTeamsResponse> => {
|
||||
const { TEAMS } = endpoints;
|
||||
const queryParams = {
|
||||
query: globalFilter,
|
||||
};
|
||||
|
||||
// TODO: add this query param logic to client class
|
||||
const pagination = `page=${page}&per_page=${perPage}`;
|
||||
|
||||
let searchQuery = "";
|
||||
if (globalFilter !== "") {
|
||||
searchQuery = `&query=${globalFilter}`;
|
||||
}
|
||||
|
||||
const path = `${TEAMS}?${pagination}${searchQuery}`;
|
||||
const queryString = buildQueryStringFromParams(queryParams);
|
||||
const endpoint = endpoints.TEAMS;
|
||||
const path = `${endpoint}?${queryString}`;
|
||||
|
||||
return sendRequest("GET", path);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue