Update scene filename parser input styling (#1956)

* update scene filename parser input styling
* update parser field rating classnames
This commit is contained in:
7dJx1qP
2021-11-07 19:41:47 -05:00
committed by GitHub
parent ffc8043273
commit bcd6d4fb46
3 changed files with 42 additions and 18 deletions

View File

@@ -11,6 +11,7 @@ import {
StudioSelect,
} from "src/components/Shared";
import { TextUtils } from "src/utils";
import cx from "classnames";
class ParserResult<T> {
public value?: T;
@@ -121,7 +122,7 @@ function SceneParserStringField(props: ISceneParserFieldProps<string>) {
<td>
<Form.Group>
<Form.Control
readOnly
disabled
className={props.className}
defaultValue={result.originalValue || ""}
/>
@@ -164,13 +165,13 @@ function SceneParserRatingField(
<td>
<Form.Group>
<Form.Control
readOnly
className={props.className}
disabled
className={cx("input-control text-input", props.className)}
defaultValue={result.originalValue || ""}
/>
<Form.Control
as="select"
className={props.className}
className={cx("input-control", props.className)}
disabled={!props.parserResult.isSet}
value={props.parserResult.value?.toString()}
onChange={(event: React.ChangeEvent<HTMLSelectElement>) =>
@@ -216,8 +217,14 @@ function SceneParserPerformerField(props: ISceneParserFieldProps<string[]>) {
</td>
<td>
<Form.Group className={props.className}>
<PerformerSelect isDisabled isMulti ids={originalPerformers} />
<PerformerSelect
isDisabled
isMulti
ids={originalPerformers}
className="parser-field-performers-select"
/>
<PerformerSelect
className="parser-field-performers-select"
isMulti
isDisabled={!props.parserResult.isSet}
onSelect={(items) => {
@@ -253,8 +260,14 @@ function SceneParserTagField(props: ISceneParserFieldProps<string[]>) {
</td>
<td>
<Form.Group className={props.className}>
<TagSelect isDisabled isMulti ids={originalTags} />
<TagSelect
isDisabled
isMulti
ids={originalTags}
className="parser-field-tags-select"
/>
<TagSelect
className="parser-field-tags-select"
isMulti
isDisabled={!props.parserResult.isSet}
onSelect={(items) => {
@@ -292,8 +305,13 @@ function SceneParserStudioField(props: ISceneParserFieldProps<string>) {
</td>
<td>
<Form.Group className={props.className}>
<StudioSelect isDisabled ids={originalStudio} />
<StudioSelect
isDisabled
ids={originalStudio}
className="parser-field-studio-select"
/>
<StudioSelect
className="parser-field-studio-select"
isDisabled={!props.parserResult.isSet}
onSelect={(items) => {
maybeValueChanged(items[0].id);
@@ -390,7 +408,7 @@ export const SceneParserRow = (props: ISceneParserRowProps) => {
{props.showFields.get("Rating") && (
<SceneParserRatingField
key="rating"
className="parser-field-rating input-control text-input"
className="parser-field-rating"
parserResult={props.scene.rating}
onSetChanged={(isSet) =>
onRatingChanged(isSet, props.scene.rating.value ?? undefined)
@@ -403,7 +421,7 @@ export const SceneParserRow = (props: ISceneParserRowProps) => {
{props.showFields.get("Performers") && (
<SceneParserPerformerField
key="performers"
className="parser-field-performers input-control text-input"
className="parser-field-performers"
parserResult={props.scene.performers}
originalParserResult={props.scene.performers}
onSetChanged={(set) =>
@@ -417,7 +435,7 @@ export const SceneParserRow = (props: ISceneParserRowProps) => {
{props.showFields.get("Tags") && (
<SceneParserTagField
key="tags"
className="parser-field-tags input-control text-input"
className="parser-field-tags"
parserResult={props.scene.tags}
originalParserResult={props.scene.tags}
onSetChanged={(isSet) =>
@@ -431,7 +449,7 @@ export const SceneParserRow = (props: ISceneParserRowProps) => {
{props.showFields.get("Studio") && (
<SceneParserStudioField
key="studio"
className="parser-field-studio input-control text-input"
className="parser-field-studio"
parserResult={props.scene.studio}
originalParserResult={props.scene.studio}
onSetChanged={(set) =>