mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-03 04:10:43 +00:00
fix(ui): Fix non-functional page size in tags page (#13891)
This commit is contained in:
parent
1345e63977
commit
fa7b4132d2
@ -56,6 +56,7 @@ const ManageTags = () => {
|
||||
const isShowNavBarRedesign = useShowNavBarRedesign();
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(PAGE_SIZE);
|
||||
const [debouncedSearchQuery, setDebouncedSearchQuery] = useState('*');
|
||||
const entityRegistry = useEntityRegistry();
|
||||
const [showCreateTagModal, setShowCreateTagModal] = useState(false);
|
||||
@ -78,11 +79,11 @@ const ManageTags = () => {
|
||||
() => ({
|
||||
types: [EntityType.Tag],
|
||||
query: debouncedSearchQuery,
|
||||
start: (currentPage - 1) * PAGE_SIZE,
|
||||
count: PAGE_SIZE,
|
||||
start: (currentPage - 1) * pageSize,
|
||||
count: pageSize,
|
||||
filters: [],
|
||||
}),
|
||||
[currentPage, debouncedSearchQuery],
|
||||
[currentPage, debouncedSearchQuery, pageSize],
|
||||
);
|
||||
|
||||
const {
|
||||
@ -182,10 +183,17 @@ const ManageTags = () => {
|
||||
/>
|
||||
<Pagination
|
||||
currentPage={currentPage}
|
||||
itemsPerPage={PAGE_SIZE}
|
||||
itemsPerPage={pageSize}
|
||||
totalPages={totalTags}
|
||||
loading={searchLoading}
|
||||
onPageChange={(page) => setCurrentPage(page)}
|
||||
onPageChange={(newPage, newPageSize) => {
|
||||
if (newPageSize !== pageSize) {
|
||||
setCurrentPage(1);
|
||||
setPageSize(newPageSize);
|
||||
} else {
|
||||
setCurrentPage(newPage);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user