Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
keenbed committed Dec 30, 2023
1 parent e830291 commit a357174
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion graphql/schema/types/filters.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ input ImageFilterType {
"Filter by resolution"
resolution: ResolutionCriterionInput
"Filter by orientation"
orientation:OrientationEnum
orientation: OrientationEnum
"Filter to only include images missing this property"
is_missing: String
"Filter to only include images with this studio"
Expand Down
17 changes: 5 additions & 12 deletions ui/v2.5/src/models/list-filter/criteria/orientation.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
import { orientationStrings } from "src/utils/orientation";
import { CriterionType } from "../types";
import {
CriterionOption,
StringCriterion,
} from "./criterion";
import {CriterionModifier} from "../../../core/generated-graphql";
import { CriterionOption, StringCriterion } from "./criterion";
import { CriterionModifier } from "../../../core/generated-graphql";

export class OrientationCriterion extends StringCriterion {
protected toCriterionInput(): string {
return this.value;
}
}


class BaseOrientationCriterionOption extends CriterionOption {
constructor(
value: CriterionType
) {
constructor(value: CriterionType) {
super({
messageID: value,
type: value,
modifierOptions: [],
options: orientationStrings,
defaultModifier: CriterionModifier.Equals,
makeCriterion: () => new OrientationCriterion(this)
makeCriterion: () => new OrientationCriterion(this),
});
}
}


export const OrientationCriterionOption = new BaseOrientationCriterionOption(
"orientation",
"orientation"
);
2 changes: 1 addition & 1 deletion ui/v2.5/src/utils/orientation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {OrientationEnum} from "src/core/generated-graphql";
import { OrientationEnum } from "src/core/generated-graphql";

const stringOrientationMap = new Map<string, OrientationEnum>([
["Landscape", OrientationEnum.Landscape],
Expand Down

0 comments on commit a357174

Please sign in to comment.