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 React from "react";
|
||||||
import { Form } from "react-bootstrap";
|
import { Form } from "react-bootstrap";
|
||||||
import { FolderSelect } from "src/components/Shared/FolderSelect/FolderSelect";
|
import { FolderSelect } from "src/components/Shared/FolderSelect/FolderSelect";
|
||||||
|
import { CriterionModifier } from "src/core/generated-graphql";
|
||||||
import { ConfigurationContext } from "src/hooks/Config";
|
import { ConfigurationContext } from "src/hooks/Config";
|
||||||
import {
|
import {
|
||||||
Criterion,
|
Criterion,
|
||||||
@@ -19,14 +20,28 @@ export const PathFilter: React.FC<IInputFilterProps> = ({
|
|||||||
const { configuration } = React.useContext(ConfigurationContext);
|
const { configuration } = React.useContext(ConfigurationContext);
|
||||||
const libraryPaths = configuration?.general.stashes.map((s) => s.path);
|
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 (
|
return (
|
||||||
<Form.Group>
|
<Form.Group>
|
||||||
<FolderSelect
|
{regex ? (
|
||||||
currentDirectory={criterion.value ? criterion.value.toString() : ""}
|
<Form.Control
|
||||||
setCurrentDirectory={(v) => onValueChanged(v)}
|
className="btn-secondary"
|
||||||
collapsible
|
type={criterion.criterionOption.inputType}
|
||||||
defaultDirectories={libraryPaths}
|
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>
|
</Form.Group>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user