mirror of https://github.com/stashapp/stash.git
Hide legacy groups criterion option (#5521)
This commit is contained in:
parent
7f8349469a
commit
60bb6bf50b
|
@ -243,11 +243,13 @@ export const EditFilterDialog: React.FC<IEditFilterProps> = ({
|
|||
}, [currentFilter.mode]);
|
||||
|
||||
const criterionOptions = useMemo(() => {
|
||||
return [...filterOptions.criterionOptions].sort((a, b) => {
|
||||
return intl
|
||||
.formatMessage({ id: a.messageID })
|
||||
.localeCompare(intl.formatMessage({ id: b.messageID }));
|
||||
});
|
||||
return [...filterOptions.criterionOptions]
|
||||
.filter((c) => !c.hidden)
|
||||
.sort((a, b) => {
|
||||
return intl
|
||||
.formatMessage({ id: a.messageID })
|
||||
.localeCompare(intl.formatMessage({ id: b.messageID }));
|
||||
});
|
||||
}, [intl, filterOptions.criterionOptions]);
|
||||
|
||||
const optionSelected = useCallback(
|
||||
|
|
|
@ -192,6 +192,7 @@ interface ICriterionOptionsParams {
|
|||
modifierOptions?: CriterionModifier[];
|
||||
defaultModifier?: CriterionModifier;
|
||||
options?: Option[];
|
||||
hidden?: boolean;
|
||||
makeCriterion: (
|
||||
o: CriterionOption,
|
||||
config?: ConfigDataFragment
|
||||
|
@ -204,6 +205,10 @@ export class CriterionOption {
|
|||
public readonly defaultModifier: CriterionModifier;
|
||||
public readonly options: Option[] | undefined;
|
||||
public readonly inputType: InputType;
|
||||
|
||||
// used for legacy criteria that are not shown in the UI
|
||||
public readonly hidden: boolean = false;
|
||||
|
||||
public readonly makeCriterionFn: (
|
||||
o: CriterionOption,
|
||||
config?: ConfigDataFragment
|
||||
|
@ -216,6 +221,7 @@ export class CriterionOption {
|
|||
this.defaultModifier = options.defaultModifier ?? CriterionModifier.Equals;
|
||||
this.options = options.options;
|
||||
this.inputType = options.inputType;
|
||||
this.hidden = options.hidden ?? false;
|
||||
this.makeCriterionFn = options.makeCriterion;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,5 +50,6 @@ export const LegacyMoviesCriterionOption = new CriterionOption({
|
|||
modifierOptions,
|
||||
defaultModifier,
|
||||
inputType,
|
||||
hidden: true,
|
||||
makeCriterion: () => new GroupsCriterion(GroupsCriterionOption),
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue