Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pagination control in environment list #4470

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions chaoscenter/web/src/controllers/Environments/Environment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const EnvironmentController: React.FC = () => {

// State for pagination
const page = parseInt(searchParams.get('page') ?? '0');
const limit = parseInt(searchParams.get('limit') ?? '15');
const limit = parseInt(searchParams.get('limit') ?? '5');

const setPage = (newPage: number): void => updateSearchParams({ page: newPage.toString() });
const setLimit = (newLimit: number): void => updateSearchParams({ limit: newLimit.toString() });
Expand All @@ -27,7 +27,7 @@ const EnvironmentController: React.FC = () => {
} = listEnvironment({
projectID: scope.projectID,
environmentIDs: [],
pagination: { page, limit: 5 },
pagination: { page, limit },
options: {
onError: err => showError(err.message),
fetchPolicy: 'cache-first'
Expand Down Expand Up @@ -57,7 +57,6 @@ const EnvironmentController: React.FC = () => {

const environments = envData?.listEnvironments.environments;
const totalEnvironments = envData?.listEnvironments.totalNoOfEnvironments;

const environmentTableData: EnvironmentDetailsTableProps | undefined = environments && {
content: generateEnvironmentTableContent(environments),
pagination: {
Expand Down
Loading