mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-13 01:38:35 +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 isShowNavBarRedesign = useShowNavBarRedesign();
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
|
const [pageSize, setPageSize] = useState(PAGE_SIZE);
|
||||||
const [debouncedSearchQuery, setDebouncedSearchQuery] = useState('*');
|
const [debouncedSearchQuery, setDebouncedSearchQuery] = useState('*');
|
||||||
const entityRegistry = useEntityRegistry();
|
const entityRegistry = useEntityRegistry();
|
||||||
const [showCreateTagModal, setShowCreateTagModal] = useState(false);
|
const [showCreateTagModal, setShowCreateTagModal] = useState(false);
|
||||||
@ -78,11 +79,11 @@ const ManageTags = () => {
|
|||||||
() => ({
|
() => ({
|
||||||
types: [EntityType.Tag],
|
types: [EntityType.Tag],
|
||||||
query: debouncedSearchQuery,
|
query: debouncedSearchQuery,
|
||||||
start: (currentPage - 1) * PAGE_SIZE,
|
start: (currentPage - 1) * pageSize,
|
||||||
count: PAGE_SIZE,
|
count: pageSize,
|
||||||
filters: [],
|
filters: [],
|
||||||
}),
|
}),
|
||||||
[currentPage, debouncedSearchQuery],
|
[currentPage, debouncedSearchQuery, pageSize],
|
||||||
);
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -182,10 +183,17 @@ const ManageTags = () => {
|
|||||||
/>
|
/>
|
||||||
<Pagination
|
<Pagination
|
||||||
currentPage={currentPage}
|
currentPage={currentPage}
|
||||||
itemsPerPage={PAGE_SIZE}
|
itemsPerPage={pageSize}
|
||||||
totalPages={totalTags}
|
totalPages={totalTags}
|
||||||
loading={searchLoading}
|
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