Skip to content

Commit 3b4a59b

Browse files
committed
Remove isNotAll operator
1 parent b50f2b9 commit 3b4a59b

File tree

13 files changed

+10
-88
lines changed

13 files changed

+10
-88
lines changed

packages/dataviews/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ Or multi-selection operators:
18031803
{ value: 'd', label: 'Product D' },
18041804
],
18051805
filterBy: {
1806-
operators: [ `isAny`, `isNone`, `isAll`, `isNotAll` ];
1806+
operators: [ `isAny`, `isNone`, `isAll` ];
18071807
}
18081808
}
18091809
```
@@ -1822,7 +1822,6 @@ The next table lists all available operators:
18221822
| `greaterThanOrEqual` | The result is numerically greater than or equal to a single value. | Age is greater than or equal to: 65 |
18231823
| `inThePast` | The result is within the last N units (days, weeks, months, or years) from now. | Orders in the past: 7 days |
18241824
| `isAll` | The result includes all values in the list. | Category includes all: Book, Review, Science Fiction |
1825-
| `isNotAll` | The result does not include all values in the list. | Category is not all: Book, Review, Science Fiction |
18261825
| `isAny` | The result includes some values in the list. | Author includes: Admin, Editor |
18271826
| `isNone` | The result does not include some values in the list. | Author excludes: Admin, Editor |
18281827
| `is` | The result is equal to a single value. | Author is: Admin |
@@ -1835,23 +1834,23 @@ The next table lists all available operators:
18351834
| `over` | The result is older than N units (days, weeks, months, or years) from now. | Orders over: 7 days ago |
18361835
| `startsWith` | The result starts with the given substring. | Title starts with: Mar |
18371836
1838-
Some operators are single-selection: `is`, `isNot`, `on`, `notOn`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `before`, `after`, `beforeInc`, `afterInc`, `contains`, `notContains`, and `startsWith`. Others are multi-selection: `isAny`, `isNone`, `isAll`, and `isNotAll`. A filter cannot mix single-selection & multi-selection operators; if a single-selection operator is present in the list of valid operators, the multi-selection ones will be discarded, and the filter won't allow selecting more than one item.
1837+
Some operators are single-selection: `is`, `isNot`, `on`, `notOn`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `before`, `after`, `beforeInc`, `afterInc`, `contains`, `notContains`, and `startsWith`. Others are multi-selection: `isAny`, `isNone`, `isAll`. A filter cannot mix single-selection & multi-selection operators; if a single-selection operator is present in the list of valid operators, the multi-selection ones will be discarded, and the filter won't allow selecting more than one item.
18391838
18401839
Valid operators per field type:
18411840
1842-
- array: `isAny`, `isNone`, `isAll`, `isNotAll`.
1841+
- array: `isAny`, `isNone`, `isAll`.
18431842
- boolean: `is`, `isNot`.
18441843
- color: `is`, `isNot`, `isAny`, `isNone`.
18451844
- date: `on`, `notOn`, `before`, `beforeInc`, `after`, `afterInc`, `inThePast`, `over`, `between`.
18461845
- datetime: `on`, `notOn`, `before`, `beforeInc`, `after`, `afterInc`, `inThePast`, `over`.
1847-
- email: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1848-
- integer: `is`, `isNot`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `between`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1846+
- email: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`.
1847+
- integer: `is`, `isNot`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `between`, `isAny`, `isNone`, `isAll`.
18491848
- media: none.
1850-
- number: `is`, `isNot`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `between`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1849+
- number: `is`, `isNot`, `lessThan`, `greaterThan`, `lessThanOrEqual`, `greaterThanOrEqual`, `between`, `isAny`, `isNone`, `isAll`.
18511850
- password: none.
1852-
- email: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1853-
- text: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1854-
- url: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`, `isNotAll`.
1851+
- email: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`.
1852+
- text: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`.
1853+
- url: `is`, `isNot`, `contains`, `notContains`, `startsWith`, `isAny`, `isNone`, `isAll`.
18551854
- fields with no type: any operator.
18561855
18571856
### `format`

packages/dataviews/src/components/dataviews-filters/filter.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {
3333
OPERATOR_IS_ANY,
3434
OPERATOR_IS_NONE,
3535
OPERATOR_IS_ALL,
36-
OPERATOR_IS_NOT_ALL,
3736
OPERATOR_LESS_THAN,
3837
OPERATOR_GREATER_THAN,
3938
OPERATOR_LESS_THAN_OR_EQUAL,
@@ -136,18 +135,6 @@ const FilterText = ( {
136135
);
137136
}
138137

139-
if ( filterInView?.operator === OPERATOR_IS_NOT_ALL ) {
140-
return createInterpolateElement(
141-
sprintf(
142-
/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */
143-
__( '<Name>%1$s is not all: </Name><Value>%2$s</Value>' ),
144-
filter.name,
145-
activeElements.map( ( element ) => element.label ).join( ', ' )
146-
),
147-
filterTextWrappers
148-
);
149-
}
150-
151138
if ( filterInView?.operator === OPERATOR_IS ) {
152139
return createInterpolateElement(
153140
sprintf(

packages/dataviews/src/constants.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const OPERATOR_IS_NOT = 'isNot';
1515
export const OPERATOR_IS_ANY = 'isAny';
1616
export const OPERATOR_IS_NONE = 'isNone';
1717
export const OPERATOR_IS_ALL = 'isAll';
18-
export const OPERATOR_IS_NOT_ALL = 'isNotAll';
1918
export const OPERATOR_LESS_THAN = 'lessThan';
2019
export const OPERATOR_GREATER_THAN = 'greaterThan';
2120
export const OPERATOR_LESS_THAN_OR_EQUAL = 'lessThanOrEqual';
@@ -39,7 +38,6 @@ export const ALL_OPERATORS: Operator[] = [
3938
OPERATOR_IS_ANY,
4039
OPERATOR_IS_NONE,
4140
OPERATOR_IS_ALL,
42-
OPERATOR_IS_NOT_ALL,
4341
OPERATOR_LESS_THAN,
4442
OPERATOR_GREATER_THAN,
4543
OPERATOR_LESS_THAN_OR_EQUAL,
@@ -97,10 +95,6 @@ export const OPERATORS: Record< Operator, { key: string; label: string } > = {
9795
key: 'is-all-filter',
9896
label: __( 'Is all' ),
9997
},
100-
[ OPERATOR_IS_NOT_ALL ]: {
101-
key: 'is-not-all-filter',
102-
label: __( 'Is not all' ),
103-
},
10498
[ OPERATOR_LESS_THAN ]: {
10599
key: 'less-than-filter',
106100
label: __( 'Less than' ),

packages/dataviews/src/field-types/array.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
OPERATOR_IS_ALL,
1313
OPERATOR_IS_ANY,
1414
OPERATOR_IS_NONE,
15-
OPERATOR_IS_NOT_ALL,
1615
} from '../constants';
1716

1817
function render( { item, field }: DataViewRenderFieldProps< any > ) {
@@ -67,11 +66,6 @@ export default {
6766
enableSorting: true,
6867
enableGlobalSearch: false,
6968
defaultOperators: [ OPERATOR_IS_ANY, OPERATOR_IS_NONE ],
70-
validOperators: [
71-
OPERATOR_IS_ANY,
72-
OPERATOR_IS_NONE,
73-
OPERATOR_IS_ALL,
74-
OPERATOR_IS_NOT_ALL,
75-
],
69+
validOperators: [ OPERATOR_IS_ANY, OPERATOR_IS_NONE, OPERATOR_IS_ALL ],
7670
getFormat: () => ( {} ),
7771
} satisfies FieldType< any >;

packages/dataviews/src/field-types/email.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import type { FieldType } from '../types/private';
1111
import {
1212
OPERATOR_IS,
1313
OPERATOR_IS_ALL,
14-
OPERATOR_IS_NOT_ALL,
1514
OPERATOR_IS_ANY,
1615
OPERATOR_IS_NONE,
1716
OPERATOR_IS_NOT,
@@ -62,7 +61,6 @@ export default {
6261
OPERATOR_IS_ANY,
6362
OPERATOR_IS_NONE,
6463
OPERATOR_IS_ALL,
65-
OPERATOR_IS_NOT_ALL,
6664
],
6765
getFormat: () => ( {} ),
6866
} satisfies FieldType< any >;

packages/dataviews/src/field-types/integer.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
OPERATOR_IS_ANY,
1919
OPERATOR_IS_NONE,
2020
OPERATOR_IS_ALL,
21-
OPERATOR_IS_NOT_ALL,
2221
OPERATOR_BETWEEN,
2322
} from '../constants';
2423
import render from './utils/render-default';
@@ -69,7 +68,6 @@ export default {
6968
OPERATOR_IS_ANY,
7069
OPERATOR_IS_NONE,
7170
OPERATOR_IS_ALL,
72-
OPERATOR_IS_NOT_ALL,
7371
],
7472
getFormat: () => ( {} ),
7573
} satisfies FieldType< any >;

packages/dataviews/src/field-types/number.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
OPERATOR_IS_ANY,
1919
OPERATOR_IS_NONE,
2020
OPERATOR_IS_ALL,
21-
OPERATOR_IS_NOT_ALL,
2221
OPERATOR_BETWEEN,
2322
} from '../constants';
2423
import RenderFromElements from './utils/render-from-elements';
@@ -84,7 +83,6 @@ export default {
8483
OPERATOR_IS_ANY,
8584
OPERATOR_IS_NONE,
8685
OPERATOR_IS_ALL,
87-
OPERATOR_IS_NOT_ALL,
8886
],
8987
getFormat: () => ( {} ),
9088
} satisfies FieldType< any >;

packages/dataviews/src/field-types/telephone.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { FieldType } from '../types/private';
55
import {
66
OPERATOR_IS,
77
OPERATOR_IS_ALL,
8-
OPERATOR_IS_NOT_ALL,
98
OPERATOR_IS_ANY,
109
OPERATOR_IS_NONE,
1110
OPERATOR_IS_NOT,
@@ -38,7 +37,6 @@ export default {
3837
OPERATOR_IS_ANY,
3938
OPERATOR_IS_NONE,
4039
OPERATOR_IS_ALL,
41-
OPERATOR_IS_NOT_ALL,
4240
],
4341
getFormat: () => ( {} ),
4442
} satisfies FieldType< any >;

packages/dataviews/src/field-types/text.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
OPERATOR_IS_ANY,
1010
OPERATOR_IS_NONE,
1111
OPERATOR_IS_NOT,
12-
OPERATOR_IS_NOT_ALL,
1312
OPERATOR_NOT_CONTAINS,
1413
OPERATOR_STARTS_WITH,
1514
} from '../constants';
@@ -39,7 +38,6 @@ export default {
3938
OPERATOR_IS_ANY,
4039
OPERATOR_IS_NONE,
4140
OPERATOR_IS_ALL,
42-
OPERATOR_IS_NOT_ALL,
4341
],
4442
getFormat: () => ( {} ),
4543
} satisfies FieldType< any >;

packages/dataviews/src/field-types/url.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { FieldType } from '../types/private';
55
import {
66
OPERATOR_IS,
77
OPERATOR_IS_ALL,
8-
OPERATOR_IS_NOT_ALL,
98
OPERATOR_IS_ANY,
109
OPERATOR_IS_NONE,
1110
OPERATOR_IS_NOT,
@@ -38,7 +37,6 @@ export default {
3837
OPERATOR_IS_ANY,
3938
OPERATOR_IS_NONE,
4039
OPERATOR_IS_ALL,
41-
OPERATOR_IS_NOT_ALL,
4240
],
4341
getFormat: () => ( {} ),
4442
} satisfies FieldType< any >;

0 commit comments

Comments
 (0)