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:
James E. Blair 2024-02-12 06:52:20 -08:00
parent 24e1cbc26d
commit a4b5394085
1 changed files with 16 additions and 9 deletions

View File

@ -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