Bug 1453757 - Add table size option to Intermittent Failures View (#3446)

This commit is contained in:
Sarah Clements 2018-04-16 16:35:24 -07:00 коммит произвёл Cameron Dawson
Родитель 5feade9bc9
Коммит 2a17adc113
2 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -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 : () => ({})}