Skip to content

Commit

Permalink
feat(3200): incorporating selection to render number of historical bu…
Browse files Browse the repository at this point in the history
…ilds in jobs list view (#1291)

Co-authored-by: Ming-Hay <[email protected]>
  • Loading branch information
VonnyJap and minghay authored Dec 12, 2024
1 parent 725f299 commit 31c19e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app/components/pipeline/jobs/table/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ export default class PipelineJobsTableComponent extends Component {
},
{
title: 'HISTORY',
propertyName: 'history',
className: 'history-column',
component: 'historyCell'
component: 'historyCell',
filterFunction: async (_, filterVal) => {
await this.dataReloader.setNumBuilds(filterVal);
},
filterWithSelect: true,
predefinedFilterOptions: ['5', '10', '15', '20', '25', '30']
},
{
title: 'DURATION',
Expand Down
6 changes: 5 additions & 1 deletion app/components/pipeline/jobs/table/dataReloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ export default class DataReloader {
});
}

setNumBuilds(numBuilds) {
async setNumBuilds(numBuilds) {
if (this.numBuilds === numBuilds) {
return;
}
this.numBuilds = numBuilds;
await this.fetchBuildsForJobs(this.jobIdsMatchingFilter);
}

start() {
Expand Down

0 comments on commit 31c19e3

Please sign in to comment.