message-table-pagination-fix (#1343)
* respect message list pagination options on the message instance list table w/ burnettk * code rabbit suggestion w/ burnettk --------- Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
parent
dc3e009446
commit
18edf627db
|
@ -19,6 +19,8 @@ type OwnProps = {
|
|||
processInstanceId?: number;
|
||||
};
|
||||
|
||||
const paginationQueryParamPrefix = 'message-list';
|
||||
|
||||
export default function MessageInstanceList({ processInstanceId }: OwnProps) {
|
||||
const [messageIntances, setMessageInstances] = useState([]);
|
||||
const [pagination, setPagination] = useState(null);
|
||||
|
@ -32,7 +34,12 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
|
|||
setMessageInstances(result.results);
|
||||
setPagination(result.pagination);
|
||||
};
|
||||
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
|
||||
const { page, perPage } = getPageInfoFromSearchParams(
|
||||
searchParams,
|
||||
undefined,
|
||||
undefined,
|
||||
paginationQueryParamPrefix
|
||||
);
|
||||
let queryParamString = `per_page=${perPage}&page=${page}`;
|
||||
if (processInstanceId) {
|
||||
queryParamString += `&process_instance_id=${processInstanceId}`;
|
||||
|
@ -155,7 +162,12 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
|
|||
};
|
||||
|
||||
if (pagination) {
|
||||
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
|
||||
const { page, perPage } = getPageInfoFromSearchParams(
|
||||
searchParams,
|
||||
undefined,
|
||||
undefined,
|
||||
paginationQueryParamPrefix
|
||||
);
|
||||
let breadcrumbElement = null;
|
||||
if (searchParams.get('process_instance_id')) {
|
||||
breadcrumbElement = (
|
||||
|
@ -187,7 +199,7 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
|
|||
perPage={perPage}
|
||||
pagination={pagination}
|
||||
tableToDisplay={buildTable()}
|
||||
paginationQueryParamPrefix="message-list"
|
||||
paginationQueryParamPrefix={paginationQueryParamPrefix}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue