diff --git a/src/ui/pages/dataset/BrowsePage.tsx b/src/ui/pages/dataset/BrowsePage.tsx index 3efcff5f08533a4cba74f2e5121643f4ad98c31c..97d88e0c651a9aeb839fa2412f714e1f15a09fd5 100644 --- a/src/ui/pages/dataset/BrowsePage.tsx +++ b/src/ui/pages/dataset/BrowsePage.tsx @@ -62,12 +62,19 @@ class BrowsePage extends React.Component { } public componentWillReceiveProps(nextProps) { - const {filterCodeToUrl} = this.props; - const {paged} = nextProps; + const {listDatasetsRequest, pagination: oldPagination, filterCodeToUrl} = this.props; + const {pagination, paged} = nextProps; + if (! oldPagination.equals(pagination)) { + log('Paginations differ!', pagination); + if (pagination.filterCode === oldPagination.filterCode) { + listDatasetsRequest(pagination.page, pagination.size, pagination.sort, pagination.filter, pagination.dir); + } + } else { if (paged) { filterCodeToUrl(paged.filterCode); } + } } protected onPaginationChange = (page, results, sortBy, dir) => { diff --git a/src/ui/pages/descriptor/BrowsePage.tsx b/src/ui/pages/descriptor/BrowsePage.tsx index 2d703789bb73c90677db12f12d92487a05ba7833..a3ddf624951aac7380f7aaead0bc81f39cb0893d 100644 --- a/src/ui/pages/descriptor/BrowsePage.tsx +++ b/src/ui/pages/descriptor/BrowsePage.tsx @@ -62,12 +62,19 @@ class BrowsePage extends React.Component { } public componentWillReceiveProps(nextProps) { - const {filterCodeToUrl} = this.props; - const {paged} = nextProps; + const {loadDescriptors, pagination: oldPagination, filterCodeToUrl} = this.props; + const {pagination, paged} = nextProps; - if (paged) { - filterCodeToUrl(paged.filterCode); - } + if (! oldPagination.equals(pagination)) { + log('Paginations differ!', pagination); + if (pagination.filterCode === oldPagination.filterCode) { + loadDescriptors(pagination.page, pagination.size, pagination.sort, pagination.filter, pagination.dir); + } + } else { + if (paged) { + filterCodeToUrl(paged.filterCode); + } + } } protected onPaginationChange = (page, results, sortBy, dir) => { diff --git a/src/ui/pages/descriptorlist/BrowsePage.tsx b/src/ui/pages/descriptorlist/BrowsePage.tsx index 26d3e7c31c999541c9402b17be402a2ab112eddd..62413089f853b83219d391df421d3e3c9d805cae 100644 --- a/src/ui/pages/descriptorlist/BrowsePage.tsx +++ b/src/ui/pages/descriptorlist/BrowsePage.tsx @@ -65,11 +65,18 @@ class BrowsePage extends React.Component { } public componentWillReceiveProps(nextProps) { - const {filterCodeToUrl} = this.props; - const {paged} = nextProps; - - if (paged) { - filterCodeToUrl(paged.filterCode); + const {listDescriptorLists, pagination: oldPagination, filterCodeToUrl} = this.props; + const {pagination, paged} = nextProps; + + if (! oldPagination.equals(pagination)) { + log('Paginations differ!', pagination); + if (pagination.filterCode === oldPagination.filterCode) { + listDescriptorLists(pagination.page, pagination.size, pagination.sort, pagination.filter, pagination.dir); + } + } else { + if (paged) { + filterCodeToUrl(paged.filterCode); + } } } diff --git a/src/ui/pages/partner/BrowsePage.tsx b/src/ui/pages/partner/BrowsePage.tsx index e3593c13b4d19261637408bb49e700ee2198a787..b52f095b40b9f52e8680dd72b6c8ed04a52f65ac 100644 --- a/src/ui/pages/partner/BrowsePage.tsx +++ b/src/ui/pages/partner/BrowsePage.tsx @@ -63,11 +63,18 @@ class PartnerListPage extends React.Component { } public componentWillReceiveProps(nextProps) { - const {filterCodeToUrl} = this.props; - const {paged} = nextProps; + const {loadPartners, pagination: oldPagination, filterCodeToUrl} = this.props; + const {pagination, paged} = nextProps; - if (paged) { - filterCodeToUrl(paged.filterCode); + if (! oldPagination.equals(pagination)) { + log('Paginations differ!', pagination); + if (pagination.filterCode === oldPagination.filterCode) { + loadPartners(pagination.page, pagination.size, pagination.sort, pagination.filter, pagination.dir); + } + } else { + if (paged) { + filterCodeToUrl(paged.filterCode); + } } }