From 15e7bfc835098e62c00ddda04b1704033dce4629 Mon Sep 17 00:00:00 2001 From: Zhu Liang Date: Wed, 13 Feb 2019 11:25:59 +0800 Subject: [PATCH] fix(pagination): fix missing job name filter (#61) --- ...20180815172240-add-seed-to-table-builds.js | 19 ++++++++++++++++--- view/src/components/BuildsTable.js | 2 +- view/src/components/BuildsTabs.js | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/database/seeders/20180815172240-add-seed-to-table-builds.js b/database/seeders/20180815172240-add-seed-to-table-builds.js index 4528334..316af66 100644 --- a/database/seeders/20180815172240-add-seed-to-table-builds.js +++ b/database/seeders/20180815172240-add-seed-to-table-builds.js @@ -8,10 +8,23 @@ module.exports = { let baseId = 1000; const uidPrefix = '00000000-0000-0000-0000-00000000'; const insertData = []; - for (let i = 0; i < 5; i++) { + for (let i = 0; i < 10; i++) { + insertData.push({ + jobName: 'qux', + buildNumber: '1074395' + baseId, + gitBranch: 'master', + data, + uniqId: uidPrefix + baseId, + createdAt: new Date(), + updatedAt: new Date(), + finishedAt: new Date(Date.now() + 60 * 1000), + }); + baseId++; + } + for (let i = 0; i < 25; i++) { insertData.push({ jobName: 'foo', - buildNumber: '1074395', + buildNumber: '1074395' + baseId, gitBranch: 'master', data, uniqId: uidPrefix + baseId, @@ -22,7 +35,7 @@ module.exports = { baseId++; insertData.push({ jobName: 'bar', - buildNumber: '1074395', + buildNumber: '1074395' + baseId, gitBranch: 'master', data, uniqId: uidPrefix + baseId, diff --git a/view/src/components/BuildsTable.js b/view/src/components/BuildsTable.js index 79374c8..f2ed150 100644 --- a/view/src/components/BuildsTable.js +++ b/view/src/components/BuildsTable.js @@ -23,7 +23,7 @@ export default class BuildsTable extends React.Component { handleTableChange = (pagination, filters, sorter) => { const pager = { ...this.props.pagination }; pager.current = pagination.current; - this.props.updatePagination(pager); + this.props.updatePagination(pager, this.props.jobName); } columns = [{ title: , diff --git a/view/src/components/BuildsTabs.js b/view/src/components/BuildsTabs.js index e816d5a..c877f31 100644 --- a/view/src/components/BuildsTabs.js +++ b/view/src/components/BuildsTabs.js @@ -155,6 +155,7 @@ class BuildsTabs extends React.Component { updatePagination={this.updatePagination} pagination={this.state.pagination} loading={this.state.loading} + jobName={this.state.jobName} /> );