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

NV 2613 - Tenant Page Pagination #3859

Merged

Conversation

djabarovgeorge
Copy link
Contributor

What change does this PR introduce?

Created the same pagination we have on the subscriber list page in order to reuse existing components.

Why was this change needed?

in order to check long lists of tenants.

Other information (Screenshots)

https://www.loom.com/share/f8e823495fe34c2d9fa542da79b60f0f

@linear
Copy link

linear bot commented Jul 26, 2023

NV-2613 Tenant Page Pagination

  • No pagination

@djabarovgeorge djabarovgeorge changed the title Nv 2613 - Tenant Page Pagination NV 2613 - Tenant Page Pagination Jul 26, 2023

export class PaginatedResponseDto<T> {
export class PaginatedResponseDto<T> implements IPaginatedResponseDto<T> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added new Shared IPaginatedResponseDto as an interface for the API DTO

export function getTenants() {
return api.get('/v1/tenants');
export function getTenants({ page = 0, limit = 10 } = {}) {
return api.getFullResponse('/v1/tenants', { page, limit });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to get the hasMore and other pagination data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refactored to get the full response of the pagination and return from the hook.

page,
limit,
}: {
options?: UseQueryOptions<IPaginatedResponseDto<ITenantEntity>, any>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the place where i wanted to reuse the IPaginatedResponseDto interface.

Comment on lines +42 to +48
pagination={{
pageSize: pageSize,
current: page,
hasMore,
minimalPagination: true,
onPageChange: handleTableChange,
}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the pagination prop data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new interface that i used in the useTenant hook and API DTO

…ge-pagination

# Conflicts:
#	apps/web/src/pages/tenants/components/list/TenantsList.tsx
Base automatically changed from NV-2612-tenant-page-empty-state to stacked-tenants-support July 26, 2023 15:50
Copy link
Contributor

@ainouzgali ainouzgali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐️

@djabarovgeorge djabarovgeorge merged commit eb55742 into stacked-tenants-support Jul 27, 2023
@djabarovgeorge djabarovgeorge deleted the NV-2613-tenant-page-pagination branch July 27, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants