mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Fix custom field between filter tag
This commit is contained in:
@@ -6,6 +6,11 @@ import {
|
|||||||
} from "src/core/generated-graphql";
|
} from "src/core/generated-graphql";
|
||||||
import { cloneDeep } from "@apollo/client/utilities";
|
import { cloneDeep } from "@apollo/client/utilities";
|
||||||
|
|
||||||
|
function valueToString(value: unknown[] | undefined | null) {
|
||||||
|
if (!value) return "";
|
||||||
|
return value.map((v) => v as string).join(", ");
|
||||||
|
}
|
||||||
|
|
||||||
export const CustomFieldsCriterionOption = new CriterionOption({
|
export const CustomFieldsCriterionOption = new CriterionOption({
|
||||||
type: "custom_fields",
|
type: "custom_fields",
|
||||||
messageID: "custom_fields.title",
|
messageID: "custom_fields.title",
|
||||||
@@ -46,7 +51,7 @@ export class CustomFieldsCriterion extends Criterion {
|
|||||||
first.modifier !== CriterionModifier.NotNull &&
|
first.modifier !== CriterionModifier.NotNull &&
|
||||||
(first.value?.length ?? 0) > 0
|
(first.value?.length ?? 0) > 0
|
||||||
) {
|
) {
|
||||||
valueString = (first.value![0] as string) ?? "";
|
valueString = valueToString(first.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const modifierString = ModifierCriterion.getModifierLabel(
|
const modifierString = ModifierCriterion.getModifierLabel(
|
||||||
@@ -78,7 +83,7 @@ export class CustomFieldsCriterion extends Criterion {
|
|||||||
v.modifier !== CriterionModifier.NotNull &&
|
v.modifier !== CriterionModifier.NotNull &&
|
||||||
(v.value?.length ?? 0) > 0
|
(v.value?.length ?? 0) > 0
|
||||||
) {
|
) {
|
||||||
valueString = (v.value![0] as string) ?? "";
|
valueString = valueToString(v.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const modifierString = ModifierCriterion.getModifierLabel(intl, v.modifier);
|
const modifierString = ModifierCriterion.getModifierLabel(intl, v.modifier);
|
||||||
@@ -86,7 +91,6 @@ export class CustomFieldsCriterion extends Criterion {
|
|||||||
criterion: v.field,
|
criterion: v.field,
|
||||||
modifierString,
|
modifierString,
|
||||||
valueString,
|
valueString,
|
||||||
others: "",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return intl.formatMessage(
|
return intl.formatMessage(
|
||||||
|
|||||||
Reference in New Issue
Block a user