Browse Source

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
tags/3.7.0
James E. Blair 2 months ago
parent
commit
a88aad3423
2 changed files with 9 additions and 5 deletions
  1. 8
    4
      web/src/containers/jobs/Jobs.jsx
  2. 1
    1
      web/src/containers/status/Pipeline.jsx

+ 8
- 4
web/src/containers/jobs/Jobs.jsx View File

@@ -102,11 +102,15 @@ class JobsList extends React.Component {
102 102
     let filtered = false
103 103
     if (filter) {
104 104
       filtered = true
105
+      let filters = filter.replace(/ +/, ',').split(',')
105 106
       for (let job of jobs) {
106
-        if (job.name.indexOf(filter) !== -1 ||
107
-            (job.description && job.description.indexOf(filter) !== -1)) {
108
-          getNode(job, !filtered)
109
-        }
107
+        filters.forEach(jobFilter => {
108
+         if (jobFilter && (
109
+              (job.name.indexOf(jobFilter) !== -1) ||
110
+              (job.description && job.description.indexOf(jobFilter) !== -1))) {
111
+            getNode(job, !filtered)
112
+         }
113
+        })
110 114
       }
111 115
     }
112 116
     // process job list

+ 1
- 1
web/src/containers/status/Pipeline.jsx View File

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

Loading…
Cancel
Save