зеркало из https://github.com/mozilla/treeherder.git
Bug 1453757 - Add table size option to Intermittent Failures View (#3446)
This commit is contained in:
Родитель
5feade9bc9
Коммит
2a17adc113
|
@ -10,6 +10,7 @@ class IdPagination(pagination.CursorPagination):
|
|||
class CustomPagePagination(pagination.PageNumberPagination):
|
||||
page_query_param = 'page'
|
||||
page_size = 20
|
||||
page_size_query_param = 'page_size'
|
||||
|
||||
def get_paginated_response(self, data):
|
||||
return Response({
|
||||
|
|
|
@ -9,8 +9,12 @@ import { fetchBugData, fetchBugsThenBugzilla } from './redux/actions';
|
|||
import { createApiUrl } from '../helpers/urlHelper';
|
||||
|
||||
function GenericTable({ fetchData, fetchFullBugData, name, params, tableApi, bugs, columns, trStyling, totalPages }) {
|
||||
const updateData = (page) => {
|
||||
params.page = page;
|
||||
|
||||
const updateData = (state) => {
|
||||
// table's page count starts at 0
|
||||
params.page = state.page + 1;
|
||||
params.page_size = state.pageSize;
|
||||
|
||||
if (name === 'BUGS') {
|
||||
fetchFullBugData(createApiUrl(tableApi, params), name);
|
||||
} else {
|
||||
|
@ -18,12 +22,6 @@ function GenericTable({ fetchData, fetchFullBugData, name, params, tableApi, bug
|
|||
}
|
||||
};
|
||||
|
||||
const updateTable = (state) => {
|
||||
// table's page count starts at 0
|
||||
const page = state.page + 1;
|
||||
updateData(page);
|
||||
};
|
||||
|
||||
const bugRowStyling = (state, bug) => {
|
||||
if (bug) {
|
||||
const style = { color: '#aaa' };
|
||||
|
@ -44,9 +42,9 @@ function GenericTable({ fetchData, fetchFullBugData, name, params, tableApi, bug
|
|||
<ReactTable
|
||||
manual
|
||||
data={bugs}
|
||||
onFetchData={updateTable}
|
||||
onFetchData={updateData}
|
||||
pages={totalPages}
|
||||
showPageSizeOptions={false}
|
||||
showPageSizeOptions
|
||||
columns={columns}
|
||||
className="-striped"
|
||||
getTrProps={trStyling ? bugRowStyling : () => ({})}
|
||||
|
|
Загрузка…
Ссылка в новой задаче