mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Identify: Select existing value on edit (#3696)
* Select field option on edit * Fix create missing display --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -96,17 +96,13 @@ const FieldOptionsEditor: React.FC<IFieldOptionsEditor> = ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!localOptions) {
|
|
||||||
return <></>;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form.Group>
|
<Form.Group>
|
||||||
{allowSetDefault ? (
|
{allowSetDefault ? (
|
||||||
<Form.Check
|
<Form.Check
|
||||||
type="radio"
|
type="radio"
|
||||||
id={`${field}-strategy-default`}
|
id={`${field}-strategy-default`}
|
||||||
checked={localOptions.strategy === undefined}
|
checked={strategy === undefined}
|
||||||
onChange={() =>
|
onChange={() =>
|
||||||
setLocalOptions({
|
setLocalOptions({
|
||||||
...localOptions,
|
...localOptions,
|
||||||
@@ -122,7 +118,7 @@ const FieldOptionsEditor: React.FC<IFieldOptionsEditor> = ({
|
|||||||
type="radio"
|
type="radio"
|
||||||
key={f[0]}
|
key={f[0]}
|
||||||
id={`${field}-strategy-${f[0]}`}
|
id={`${field}-strategy-${f[0]}`}
|
||||||
checked={localOptions.strategy === f[1]}
|
checked={strategy === f[1]}
|
||||||
onChange={() =>
|
onChange={() =>
|
||||||
setLocalOptions({
|
setLocalOptions({
|
||||||
...localOptions,
|
...localOptions,
|
||||||
@@ -168,7 +164,9 @@ const FieldOptionsEditor: React.FC<IFieldOptionsEditor> = ({
|
|||||||
(f) => f.field === localOptions.field
|
(f) => f.field === localOptions.field
|
||||||
)?.createMissing;
|
)?.createMissing;
|
||||||
|
|
||||||
if (localOptions.strategy === undefined) {
|
// if allowSetDefault is false, then strategy is considered merge
|
||||||
|
// if its true, then its using the default value and should not be shown here
|
||||||
|
if (localOptions.strategy === undefined && allowSetDefault) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user