Skip to content

Commit

Permalink
DataViews: implement NOT IN operator for author filter in templates (
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal authored Dec 5, 2023
1 parent 6305cf7 commit 308fc42
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
TEMPLATE_POST_TYPE,
ENUMERATION_TYPE,
OPERATOR_IN,
OPERATOR_NOT_IN,
LAYOUT_GRID,
LAYOUT_TABLE,
} from '../../utils/constants';
Expand Down Expand Up @@ -266,6 +267,14 @@ export default function DataviewsTemplates() {
filteredTemplates = filteredTemplates.filter( ( item ) => {
return item.author_text === filter.value;
} );
} else if (
filter.field === 'author' &&
filter.operator === OPERATOR_NOT_IN &&
!! filter.value
) {
filteredTemplates = filteredTemplates.filter( ( item ) => {
return item.author_text !== filter.value;
} );
}
} );
}
Expand Down

1 comment on commit 308fc42

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 308fc42.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7098347048
📝 Reported issues:

Please sign in to comment.