summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2019-03-14 09:06:01 -0700
committerJames E. Blair <corvus@inaugust.com>2019-03-14 17:16:15 +0000
commita88aad34236d64eebdc286f5a6072f84ced7809b (patch)
tree894e28271f2d7aeb761901b6495a357cab1466f2
parent88b16685a3177eecba3eb46c880b2aabac22d23e (diff)
web: support more than one job in the filter
This allows you to enter: requirements-tox-py35-check-uc cross-cinder-py35 In the job filter and see the common ancestry in the tree view. The status page filter is also updated to support multiple spaces between items. Both filters now support this in order to deal with common copy/paste errors. Depends-On: https://review.openstack.org/643397 Change-Id: I38cc6cdc8b5373dc8f29804f5bb35e9594a000bf
Notes
Notes (review): Code-Review+2: Monty Taylor <mordred@inaugust.com> Code-Review+2: Joshua Hesketh <josh@nitrotech.org> Workflow+1: James E. Blair <corvus@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 15 Mar 2019 15:15:43 +0000 Reviewed-on: https://review.openstack.org/643385 Project: openstack-infra/zuul Branch: refs/heads/master
-rw-r--r--web/src/containers/jobs/Jobs.jsx12
-rw-r--r--web/src/containers/status/Pipeline.jsx2
2 files changed, 9 insertions, 5 deletions
diff --git a/web/src/containers/jobs/Jobs.jsx b/web/src/containers/jobs/Jobs.jsx
index fd7cd8d..7f28433 100644
--- a/web/src/containers/jobs/Jobs.jsx
+++ b/web/src/containers/jobs/Jobs.jsx
@@ -102,11 +102,15 @@ class JobsList extends React.Component {
102 let filtered = false 102 let filtered = false
103 if (filter) { 103 if (filter) {
104 filtered = true 104 filtered = true
105 let filters = filter.replace(/ +/, ',').split(',')
105 for (let job of jobs) { 106 for (let job of jobs) {
106 if (job.name.indexOf(filter) !== -1 || 107 filters.forEach(jobFilter => {
107 (job.description && job.description.indexOf(filter) !== -1)) { 108 if (jobFilter && (
108 getNode(job, !filtered) 109 (job.name.indexOf(jobFilter) !== -1) ||
109 } 110 (job.description && job.description.indexOf(jobFilter) !== -1))) {
111 getNode(job, !filtered)
112 }
113 })
110 } 114 }
111 } 115 }
112 // process job list 116 // process job list
diff --git a/web/src/containers/status/Pipeline.jsx b/web/src/containers/status/Pipeline.jsx
index 7b585ee..b6ce648 100644
--- a/web/src/containers/status/Pipeline.jsx
+++ b/web/src/containers/status/Pipeline.jsx
@@ -90,7 +90,7 @@ class Pipeline extends React.Component {
90 90
91 filterQueue(queue, filter) { 91 filterQueue(queue, filter) {
92 let found = false 92 let found = false
93 let filters = filter.replace(' ', ',').split(',') 93 let filters = filter.replace(/ +/, ',').split(',')
94 queue.heads.forEach(changes => { 94 queue.heads.forEach(changes => {
95 changes.forEach(change => { 95 changes.forEach(change => {
96 filters.forEach(changeFilter => { 96 filters.forEach(changeFilter => {