From 31c19e3314d92a66bd78f733f05c0ad118a3a558 Mon Sep 17 00:00:00 2001 From: Vonny Jap Date: Thu, 12 Dec 2024 13:58:22 -0800 Subject: [PATCH] feat(3200): incorporating selection to render number of historical builds in jobs list view (#1291) Co-authored-by: Ming-Hay <157658916+minghay@users.noreply.github.com> --- app/components/pipeline/jobs/table/component.js | 8 +++++++- app/components/pipeline/jobs/table/dataReloader.js | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/components/pipeline/jobs/table/component.js b/app/components/pipeline/jobs/table/component.js index a05a25886..25ed24e7f 100644 --- a/app/components/pipeline/jobs/table/component.js +++ b/app/components/pipeline/jobs/table/component.js @@ -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', diff --git a/app/components/pipeline/jobs/table/dataReloader.js b/app/components/pipeline/jobs/table/dataReloader.js index 863846293..33edc59dc 100644 --- a/app/components/pipeline/jobs/table/dataReloader.js +++ b/app/components/pipeline/jobs/table/dataReloader.js @@ -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() {