Skip to content

Commit

Permalink
fix(pagination): fix missing job name filter (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
paradite authored and xudafeng committed Feb 13, 2019
1 parent 05e7f13 commit 15e7bfc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
19 changes: 16 additions & 3 deletions database/seeders/20180815172240-add-seed-to-table-builds.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -22,7 +35,7 @@ module.exports = {
baseId++;
insertData.push({
jobName: 'bar',
buildNumber: '1074395',
buildNumber: '1074395' + baseId,
gitBranch: 'master',
data,
uniqId: uidPrefix + baseId,
Expand Down
2 changes: 1 addition & 1 deletion view/src/components/BuildsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: <FormattedMessage id='builds.jobName' />,
Expand Down
1 change: 1 addition & 0 deletions view/src/components/BuildsTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class BuildsTabs extends React.Component {
updatePagination={this.updatePagination}
pagination={this.state.pagination}
loading={this.state.loading}
jobName={this.state.jobName}
/>
</div>
);
Expand Down

0 comments on commit 15e7bfc

Please sign in to comment.