mirror of
https://github.com/stashapp/stash.git
synced 2026-01-02 13:42:31 +01:00
Don't use folder select for regex (#3586)
This commit is contained in:
parent
0841d6877a
commit
6a1458fb2c
1 changed files with 21 additions and 6 deletions
|
|
@ -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>
|
||||
<FolderSelect
|
||||
currentDirectory={criterion.value ? criterion.value.toString() : ""}
|
||||
setCurrentDirectory={(v) => onValueChanged(v)}
|
||||
collapsible
|
||||
defaultDirectories={libraryPaths}
|
||||
/>
|
||||
{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>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue