Fix filtering on status page
The status page filter is missing support for the new refs format introduced by the circular dependency refactor. Change-Id: I0324619a1a80ef99d7383549fd70823043d0c331
This commit is contained in:
parent
24e1cbc26d
commit
a4b5394085
@ -66,6 +66,11 @@ const PIPELINE_ICONS = {
|
||||
|
||||
const DEFAULT_PIPELINE_ICON = PIPELINE_ICONS['unknown']
|
||||
|
||||
function getRefs(item) {
|
||||
// Backwards compat
|
||||
return 'refs' in item ? item.refs : [item]
|
||||
}
|
||||
|
||||
class Pipeline extends React.Component {
|
||||
static propTypes = {
|
||||
expanded: PropTypes.bool.isRequired,
|
||||
@ -138,15 +143,17 @@ class Pipeline extends React.Component {
|
||||
filterQueue(queue, filter) {
|
||||
let found = false
|
||||
let filters = filter.replace(/ +/g, ',').split(',')
|
||||
queue.heads.forEach(changes => {
|
||||
changes.forEach(change => {
|
||||
filters.forEach(changeFilter => {
|
||||
if (changeFilter && (
|
||||
(change.project && change.project.indexOf(changeFilter) !== -1) ||
|
||||
(change.id && change.id.indexOf(changeFilter) !== -1))) {
|
||||
found = true
|
||||
return
|
||||
}
|
||||
queue.heads.forEach(itemList => {
|
||||
itemList.forEach(item => {
|
||||
getRefs(item).forEach(ref => {
|
||||
filters.forEach(changeFilter => {
|
||||
if (changeFilter && (
|
||||
(ref.project && ref.project.indexOf(changeFilter) !== -1) ||
|
||||
(ref.id && ref.id.indexOf(changeFilter) !== -1))) {
|
||||
found = true
|
||||
return
|
||||
}
|
||||
})
|
||||
})
|
||||
if (found) {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user