File tree 3 files changed +14
-5
lines changed
models/list-filter/criteria
3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -243,11 +243,13 @@ export const EditFilterDialog: React.FC<IEditFilterProps> = ({
243
243
} , [ currentFilter . mode ] ) ;
244
244
245
245
const criterionOptions = useMemo ( ( ) => {
246
- return [ ...filterOptions . criterionOptions ] . sort ( ( a , b ) => {
247
- return intl
248
- . formatMessage ( { id : a . messageID } )
249
- . localeCompare ( intl . formatMessage ( { id : b . messageID } ) ) ;
250
- } ) ;
246
+ return [ ...filterOptions . criterionOptions ]
247
+ . filter ( ( c ) => ! c . hidden )
248
+ . sort ( ( a , b ) => {
249
+ return intl
250
+ . formatMessage ( { id : a . messageID } )
251
+ . localeCompare ( intl . formatMessage ( { id : b . messageID } ) ) ;
252
+ } ) ;
251
253
} , [ intl , filterOptions . criterionOptions ] ) ;
252
254
253
255
const optionSelected = useCallback (
Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ interface ICriterionOptionsParams {
192
192
modifierOptions ?: CriterionModifier [ ] ;
193
193
defaultModifier ?: CriterionModifier ;
194
194
options ?: Option [ ] ;
195
+ hidden ?: boolean ;
195
196
makeCriterion : (
196
197
o : CriterionOption ,
197
198
config ?: ConfigDataFragment
@@ -204,6 +205,10 @@ export class CriterionOption {
204
205
public readonly defaultModifier : CriterionModifier ;
205
206
public readonly options : Option [ ] | undefined ;
206
207
public readonly inputType : InputType ;
208
+
209
+ // used for legacy criteria that are not shown in the UI
210
+ public readonly hidden : boolean = false ;
211
+
207
212
public readonly makeCriterionFn : (
208
213
o : CriterionOption ,
209
214
config ?: ConfigDataFragment
@@ -216,6 +221,7 @@ export class CriterionOption {
216
221
this . defaultModifier = options . defaultModifier ?? CriterionModifier . Equals ;
217
222
this . options = options . options ;
218
223
this . inputType = options . inputType ;
224
+ this . hidden = options . hidden ?? false ;
219
225
this . makeCriterionFn = options . makeCriterion ;
220
226
}
221
227
Original file line number Diff line number Diff line change @@ -50,5 +50,6 @@ export const LegacyMoviesCriterionOption = new CriterionOption({
50
50
modifierOptions,
51
51
defaultModifier,
52
52
inputType,
53
+ hidden : true ,
53
54
makeCriterion : ( ) => new GroupsCriterion ( GroupsCriterionOption ) ,
54
55
} ) ;
You can’t perform that action at this time.
0 commit comments