From ee12060c5c9fe6b381bfba910c9bf49b3b214cb2 Mon Sep 17 00:00:00 2001 From: VonnyJap Date: Fri, 6 Dec 2024 11:17:26 -0800 Subject: [PATCH 1/8] stage changed components --- .../pipeline-list-view/component.js | 27 +++++++++++++++++-- .../pipeline-list-view/template.hbs | 1 - 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/app/components/pipeline-list-view/component.js b/app/components/pipeline-list-view/component.js index afbd8e7e2..619be1b10 100644 --- a/app/components/pipeline-list-view/component.js +++ b/app/components/pipeline-list-view/component.js @@ -29,23 +29,42 @@ export default Component.extend({ title: 'JOB', propertyName: 'job', component: 'pipeline-list-job-cell', - sortFunction: (a, b) => collator.compare(a.jobName, b.jobName) + sortFunction: (a, b) => collator.compare(a.jobName, b.jobName), + filterFunction: (val, filterVal, row) => { + const _val = row.age; + + if (filterVal === '< 34') { + return _val < 34; + } + if (filterVal === '= 34') { + return _val === 34; + } + if (filterVal === '> 34') { + return _val > 34; + } + + return true; + }, + filterWithSelect: true, + predefinedFilterOptions: ['< 34', '= 34', '> 34'] }, { title: 'HISTORY', propertyName: 'history', + disableFiltering: true, disableSorting: true, component: 'pipeline-list-history-cell' }, { title: 'DURATION', propertyName: 'duration', - disableSorting: true + disableFiltering: true }, { title: 'START TIME', propertyName: 'startTime', sortedBy: 'history', + disableFiltering: true, sortFunction: (a, b) => { const aStartTime = get(a, 'lastObject.startTime'); const bStartTime = get(b, 'lastObject.startTime'); @@ -57,24 +76,28 @@ export default Component.extend({ title: 'COVERAGE', propertyName: 'coverage', disableSorting: true, + disableFiltering: true, component: 'pipeline-list-coverage-cell' }, { title: 'STAGE', propertyName: 'job', component: 'pipeline-list-stage-cell', + disableFiltering: true, sortFunction: (a, b) => collator.compare(a.stageName, b.stageName) }, { title: 'METRICS', propertyName: 'job', disableSorting: true, + disableFiltering: true, component: 'pipeline-list-metrics-cell' }, { title: 'ACTIONS', propertyName: 'actions', disableSorting: true, + disableFiltering: true, component: 'pipeline-list-actions-cell' } ], diff --git a/app/components/pipeline-list-view/template.hbs b/app/components/pipeline-list-view/template.hbs index 5de99e185..4bf5d08e7 100644 --- a/app/components/pipeline-list-view/template.hbs +++ b/app/components/pipeline-list-view/template.hbs @@ -34,7 +34,6 @@ @themeInstance={{this.theme}} @showComponentFooter={{false}} @showColumnsDropdown={{false}} - @useFilteringByColumns={{false}} @showGlobalFilter={{false}} @showCurrentPageNumberSelect={{false}} @multipleColumnsSorting={{false}} From b670af31c19b94b1b5422b410b0519fc5d2c523d Mon Sep 17 00:00:00 2001 From: VonnyJap Date: Fri, 6 Dec 2024 15:10:19 -0800 Subject: [PATCH 2/8] add filter for jobs --- app/components/pipeline-list-view/component.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/app/components/pipeline-list-view/component.js b/app/components/pipeline-list-view/component.js index 619be1b10..ab9b9c0a8 100644 --- a/app/components/pipeline-list-view/component.js +++ b/app/components/pipeline-list-view/component.js @@ -30,23 +30,7 @@ export default Component.extend({ propertyName: 'job', component: 'pipeline-list-job-cell', sortFunction: (a, b) => collator.compare(a.jobName, b.jobName), - filterFunction: (val, filterVal, row) => { - const _val = row.age; - - if (filterVal === '< 34') { - return _val < 34; - } - if (filterVal === '= 34') { - return _val === 34; - } - if (filterVal === '> 34') { - return _val > 34; - } - - return true; - }, - filterWithSelect: true, - predefinedFilterOptions: ['< 34', '= 34', '> 34'] + filteredBy: 'job.jobName' }, { title: 'HISTORY', From c2f2e37a6cc29003d148decd4fbf366e322bff32 Mon Sep 17 00:00:00 2001 From: VonnyJap Date: Mon, 9 Dec 2024 13:59:20 -0800 Subject: [PATCH 3/8] fix lint --- app/components/pipeline/jobs/table/component.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/components/pipeline/jobs/table/component.js b/app/components/pipeline/jobs/table/component.js index a05a25886..89a4b227a 100644 --- a/app/components/pipeline/jobs/table/component.js +++ b/app/components/pipeline/jobs/table/component.js @@ -111,6 +111,8 @@ export default class PipelineJobsTableComponent extends Component { const theme = this.emberModelTableBootstrapTheme; theme.table = 'table table-condensed table-hover table-sm'; + theme.sortAscIcon = 'fa fa-fw fa-sort-up'; // FontAwesome up arrow + theme.sortDescIcon = 'fa fa-fw fa-sort-down'; // FontAwesome down arrow return theme; } From eb3b94fa203355db31033c384cb7c2608d8039fd Mon Sep 17 00:00:00 2001 From: VonnyJap Date: Mon, 9 Dec 2024 14:04:22 -0800 Subject: [PATCH 4/8] changed the v1 back to previous --- app/components/pipeline-list-view/component.js | 11 ++--------- app/components/pipeline-list-view/template.hbs | 1 + 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/components/pipeline-list-view/component.js b/app/components/pipeline-list-view/component.js index ab9b9c0a8..afbd8e7e2 100644 --- a/app/components/pipeline-list-view/component.js +++ b/app/components/pipeline-list-view/component.js @@ -29,26 +29,23 @@ export default Component.extend({ title: 'JOB', propertyName: 'job', component: 'pipeline-list-job-cell', - sortFunction: (a, b) => collator.compare(a.jobName, b.jobName), - filteredBy: 'job.jobName' + sortFunction: (a, b) => collator.compare(a.jobName, b.jobName) }, { title: 'HISTORY', propertyName: 'history', - disableFiltering: true, disableSorting: true, component: 'pipeline-list-history-cell' }, { title: 'DURATION', propertyName: 'duration', - disableFiltering: true + disableSorting: true }, { title: 'START TIME', propertyName: 'startTime', sortedBy: 'history', - disableFiltering: true, sortFunction: (a, b) => { const aStartTime = get(a, 'lastObject.startTime'); const bStartTime = get(b, 'lastObject.startTime'); @@ -60,28 +57,24 @@ export default Component.extend({ title: 'COVERAGE', propertyName: 'coverage', disableSorting: true, - disableFiltering: true, component: 'pipeline-list-coverage-cell' }, { title: 'STAGE', propertyName: 'job', component: 'pipeline-list-stage-cell', - disableFiltering: true, sortFunction: (a, b) => collator.compare(a.stageName, b.stageName) }, { title: 'METRICS', propertyName: 'job', disableSorting: true, - disableFiltering: true, component: 'pipeline-list-metrics-cell' }, { title: 'ACTIONS', propertyName: 'actions', disableSorting: true, - disableFiltering: true, component: 'pipeline-list-actions-cell' } ], diff --git a/app/components/pipeline-list-view/template.hbs b/app/components/pipeline-list-view/template.hbs index 4bf5d08e7..5de99e185 100644 --- a/app/components/pipeline-list-view/template.hbs +++ b/app/components/pipeline-list-view/template.hbs @@ -34,6 +34,7 @@ @themeInstance={{this.theme}} @showComponentFooter={{false}} @showColumnsDropdown={{false}} + @useFilteringByColumns={{false}} @showGlobalFilter={{false}} @showCurrentPageNumberSelect={{false}} @multipleColumnsSorting={{false}} From ec417a28936e2938bcf2f7be0a7826ea70141d87 Mon Sep 17 00:00:00 2001 From: Vonny Jap Date: Mon, 9 Dec 2024 21:22:42 -0800 Subject: [PATCH 5/8] Update app/components/pipeline/jobs/table/component.js Co-authored-by: Ming-Hay <157658916+minghay@users.noreply.github.com> --- app/components/pipeline/jobs/table/component.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/components/pipeline/jobs/table/component.js b/app/components/pipeline/jobs/table/component.js index 89a4b227a..a05a25886 100644 --- a/app/components/pipeline/jobs/table/component.js +++ b/app/components/pipeline/jobs/table/component.js @@ -111,8 +111,6 @@ export default class PipelineJobsTableComponent extends Component { const theme = this.emberModelTableBootstrapTheme; theme.table = 'table table-condensed table-hover table-sm'; - theme.sortAscIcon = 'fa fa-fw fa-sort-up'; // FontAwesome up arrow - theme.sortDescIcon = 'fa fa-fw fa-sort-down'; // FontAwesome down arrow return theme; } From bb6f625ab17048da7c47b0a77796574f00e1ae8c Mon Sep 17 00:00:00 2001 From: VonnyJap Date: Wed, 11 Dec 2024 16:59:34 -0800 Subject: [PATCH 6/8] add history filter for new jobs list view interface --- app/components/pipeline/jobs/table/component.js | 8 +++++++- app/components/pipeline/jobs/table/dataReloader.js | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/components/pipeline/jobs/table/component.js b/app/components/pipeline/jobs/table/component.js index a05a25886..d0355ebe7 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 function (_, filterVal) { + this.dataReloader.setNumBuilds(filterVal); + }.bind(this), + 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..9a4cbdaa4 100644 --- a/app/components/pipeline/jobs/table/dataReloader.js +++ b/app/components/pipeline/jobs/table/dataReloader.js @@ -98,7 +98,11 @@ export default class DataReloader { } setNumBuilds(numBuilds) { + if (this.numBuilds === numBuilds) { + return; + } this.numBuilds = numBuilds; + this.fetchBuildsForJobs(this.jobIdsMatchingFilter).then(() => {}); } start() { From 64d84c49e62e365f4128f02a961197bdda9d71b6 Mon Sep 17 00:00:00 2001 From: Vonny Jap Date: Thu, 12 Dec 2024 13:21:49 -0800 Subject: [PATCH 7/8] Update app/components/pipeline/jobs/table/component.js Co-authored-by: Ming-Hay <157658916+minghay@users.noreply.github.com> --- app/components/pipeline/jobs/table/component.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/pipeline/jobs/table/component.js b/app/components/pipeline/jobs/table/component.js index d0355ebe7..25ed24e7f 100644 --- a/app/components/pipeline/jobs/table/component.js +++ b/app/components/pipeline/jobs/table/component.js @@ -29,9 +29,9 @@ export default class PipelineJobsTableComponent extends Component { propertyName: 'history', className: 'history-column', component: 'historyCell', - filterFunction: async function (_, filterVal) { - this.dataReloader.setNumBuilds(filterVal); - }.bind(this), + filterFunction: async (_, filterVal) => { + await this.dataReloader.setNumBuilds(filterVal); + }, filterWithSelect: true, predefinedFilterOptions: ['5', '10', '15', '20', '25', '30'] }, From 852b729e959046db898f771bccacd4aa654c53b8 Mon Sep 17 00:00:00 2001 From: Vonny Jap Date: Thu, 12 Dec 2024 13:22:03 -0800 Subject: [PATCH 8/8] Update app/components/pipeline/jobs/table/dataReloader.js Co-authored-by: Ming-Hay <157658916+minghay@users.noreply.github.com> --- app/components/pipeline/jobs/table/dataReloader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/pipeline/jobs/table/dataReloader.js b/app/components/pipeline/jobs/table/dataReloader.js index 9a4cbdaa4..33edc59dc 100644 --- a/app/components/pipeline/jobs/table/dataReloader.js +++ b/app/components/pipeline/jobs/table/dataReloader.js @@ -97,12 +97,12 @@ export default class DataReloader { }); } - setNumBuilds(numBuilds) { + async setNumBuilds(numBuilds) { if (this.numBuilds === numBuilds) { return; } this.numBuilds = numBuilds; - this.fetchBuildsForJobs(this.jobIdsMatchingFilter).then(() => {}); + await this.fetchBuildsForJobs(this.jobIdsMatchingFilter); } start() {