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
This commit is contained in:
James E. Blair 2019-03-14 09:06:01 -07:00 committed by James E. Blair
parent 88b16685a3
commit a88aad3423
2 changed files with 9 additions and 5 deletions

View File

@ -102,11 +102,15 @@ class JobsList extends React.Component {
let filtered = false
if (filter) {
filtered = true
let filters = filter.replace(/ +/, ',').split(',')
for (let job of jobs) {
if (job.name.indexOf(filter) !== -1 ||
(job.description && job.description.indexOf(filter) !== -1)) {
getNode(job, !filtered)
}
filters.forEach(jobFilter => {
if (jobFilter && (
(job.name.indexOf(jobFilter) !== -1) ||
(job.description && job.description.indexOf(jobFilter) !== -1))) {
getNode(job, !filtered)
}
})
}
}
// process job list

View File

@ -90,7 +90,7 @@ class Pipeline extends React.Component {
filterQueue(queue, filter) {
let found = false
let filters = filter.replace(' ', ',').split(',')
let filters = filter.replace(/ +/, ',').split(',')
queue.heads.forEach(changes => {
changes.forEach(change => {
filters.forEach(changeFilter => {