From 80164d32d339daa44b5fa250e4a4d790c579cdc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:21:08 +0100 Subject: [PATCH] Remove filter.name: it is taken from the field --- packages/edit-site/src/components/dataviews/README.md | 5 +---- packages/edit-site/src/components/dataviews/filters.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/edit-site/src/components/dataviews/README.md b/packages/edit-site/src/components/dataviews/README.md index f2b7718ca0ea1c..e627950fcf7bbb 100644 --- a/packages/edit-site/src/components/dataviews/README.md +++ b/packages/edit-site/src/components/dataviews/README.md @@ -174,7 +174,6 @@ const field = [ A filter is an object that may contain the following properties: -- `name`: nice looking name for the filter. Field filters may omit it, in which case the field's `header` will be used. - `type`: the type of filter. Only `enumeration` is supported at the moment. - `elements`: for filters of type `enumeration`, the list of options to show. A one-dimensional array of object with value/label keys, as in `[ { value: 1, label: "Value name" } ]`. - `value`: what's serialized into the view's filters. @@ -193,9 +192,7 @@ const field = [ filters: [ 'enumeration', { type: 'enumeration' }, - { type: 'enumeration' }, - { type: 'enumeration', name: __( 'Author' ) }, - { type: 'enumeration', name: __( 'Author' ), elements: authors }, + { type: 'enumeration', elements: authors }, ], } ]; diff --git a/packages/edit-site/src/components/dataviews/filters.js b/packages/edit-site/src/components/dataviews/filters.js index 6937554fce4989..18c5bc158e2447 100644 --- a/packages/edit-site/src/components/dataviews/filters.js +++ b/packages/edit-site/src/components/dataviews/filters.js @@ -28,7 +28,7 @@ export default function Filters( { fields, view, onChangeView } ) { if ( 'object' === typeof filter ) { filterIndex[ id ] = { id, - name: filter.name || field.header, + name: field.header, type: filter.type, }; }