Browse Source

Merge "web: support more than one job in the filter"

tags/3.7.0
Zuul 2 months ago
parent
commit
a095e41e91
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