mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Don't use folder select for regex (#3586)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import { Form } from "react-bootstrap";
|
||||
import { FolderSelect } from "src/components/Shared/FolderSelect/FolderSelect";
|
||||
import { CriterionModifier } from "src/core/generated-graphql";
|
||||
import { ConfigurationContext } from "src/hooks/Config";
|
||||
import {
|
||||
Criterion,
|
||||
@@ -19,14 +20,28 @@ export const PathFilter: React.FC<IInputFilterProps> = ({
|
||||
const { configuration } = React.useContext(ConfigurationContext);
|
||||
const libraryPaths = configuration?.general.stashes.map((s) => s.path);
|
||||
|
||||
// don't show folder select for regex
|
||||
const regex =
|
||||
criterion.modifier === CriterionModifier.MatchesRegex ||
|
||||
criterion.modifier === CriterionModifier.NotMatchesRegex;
|
||||
|
||||
return (
|
||||
<Form.Group>
|
||||
{regex ? (
|
||||
<Form.Control
|
||||
className="btn-secondary"
|
||||
type={criterion.criterionOption.inputType}
|
||||
onChange={(v) => onValueChanged(v.target.value)}
|
||||
value={criterion.value ? criterion.value.toString() : ""}
|
||||
/>
|
||||
) : (
|
||||
<FolderSelect
|
||||
currentDirectory={criterion.value ? criterion.value.toString() : ""}
|
||||
setCurrentDirectory={(v) => onValueChanged(v)}
|
||||
collapsible
|
||||
defaultDirectories={libraryPaths}
|
||||
/>
|
||||
)}
|
||||
</Form.Group>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user