mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
Normalize Prettier formatting in cover image UI flow.
Apply style-only formatting changes in Scene cover source/update files to satisfy validate-ui format checks without behavioral changes. Made-with: Cursor
This commit is contained in:
parent
543ceef777
commit
457cc611d4
5 changed files with 30 additions and 14 deletions
|
|
@ -391,7 +391,8 @@ const ScenePage: React.FC<IProps> = PatchComponent("ScenePage", (props) => {
|
|||
async function onGenerateScreenshot(at?: number) {
|
||||
const input: SceneUpdateInputWithCoverSource = {
|
||||
id: scene.id,
|
||||
cover_image_source: typeof at === "number" ? `timestamp:${at}` : "default",
|
||||
cover_image_source:
|
||||
typeof at === "number" ? `timestamp:${at}` : "default",
|
||||
};
|
||||
|
||||
await generateScreenshot({
|
||||
|
|
|
|||
|
|
@ -190,7 +190,8 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||
custom_fields: formatCustomFieldInput(isNew, values.custom_fields),
|
||||
};
|
||||
if (!coverImageSourceDirty) {
|
||||
delete (input as { cover_image_source?: string | null }).cover_image_source;
|
||||
delete (input as { cover_image_source?: string | null })
|
||||
.cover_image_source;
|
||||
}
|
||||
onSave(input);
|
||||
}
|
||||
|
|
@ -224,7 +225,11 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||
return formImage;
|
||||
}
|
||||
return sceneImage;
|
||||
}, [coverImageRefreshToken, formik.values.cover_image, scene.paths?.screenshot]);
|
||||
}, [
|
||||
coverImageRefreshToken,
|
||||
formik.values.cover_image,
|
||||
scene.paths?.screenshot,
|
||||
]);
|
||||
|
||||
const groupEntries = useMemo(() => {
|
||||
return formik.values.groups
|
||||
|
|
@ -353,10 +358,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
|||
}
|
||||
}
|
||||
|
||||
function onImageURLSource(
|
||||
source: "url" | "clipboard",
|
||||
value?: string
|
||||
) {
|
||||
function onImageURLSource(source: "url" | "clipboard", value?: string) {
|
||||
if (source === "clipboard") {
|
||||
setCoverImageSource("clipboard");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -310,8 +310,8 @@ const _SceneFileInfoPanel: React.FC<ISceneFileInfoPanelProps> = (
|
|||
) => {
|
||||
const Toast = useToast();
|
||||
const coverImageSource =
|
||||
(props.scene as { cover_image_source?: string | null }).cover_image_source ??
|
||||
null;
|
||||
(props.scene as { cover_image_source?: string | null })
|
||||
.cover_image_source ?? null;
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [deletingFile, setDeletingFile] = useState<GQL.VideoFileDataFragment>();
|
||||
|
|
@ -430,7 +430,14 @@ const _SceneFileInfoPanel: React.FC<ISceneFileInfoPanelProps> = (
|
|||
))}
|
||||
</Accordion>
|
||||
);
|
||||
}, [props.scene, loading, Toast, deletingFile, reassigningFile, coverImageSource]);
|
||||
}, [
|
||||
props.scene,
|
||||
loading,
|
||||
Toast,
|
||||
deletingFile,
|
||||
reassigningFile,
|
||||
coverImageSource,
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -632,7 +632,7 @@ const SceneMergeDetails: React.FC<ISceneMergeDetailsProps> = ({
|
|||
)?.cover_image_source;
|
||||
const coverImageSource = image.useNewValue
|
||||
? coverImage
|
||||
? (sourceCoverImageSource ?? null)
|
||||
? sourceCoverImageSource ?? null
|
||||
: null
|
||||
: undefined;
|
||||
|
||||
|
|
|
|||
|
|
@ -176,13 +176,17 @@ export const ImageInput: React.FC<IImageInput> = PatchComponent(
|
|||
</Button>
|
||||
</div>
|
||||
)}
|
||||
{(onGenerateDefault || onGenerateCurrent) && <hr className="my-2" />}
|
||||
{(onGenerateDefault || onGenerateCurrent) && (
|
||||
<hr className="my-2" />
|
||||
)}
|
||||
{onGenerateDefault && (
|
||||
<div>
|
||||
<Button className="minimal" onClick={onGenerateDefault}>
|
||||
<Icon icon={faPhotoFilm} className="fa-fw" />
|
||||
<span>
|
||||
{intl.formatMessage({ id: "actions.generate_thumb_default" })}
|
||||
{intl.formatMessage({
|
||||
id: "actions.generate_thumb_default",
|
||||
})}
|
||||
</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
|
@ -205,7 +209,9 @@ export const ImageInput: React.FC<IImageInput> = PatchComponent(
|
|||
<div>
|
||||
<Button className="minimal" onClick={onReset}>
|
||||
<Icon icon={faCirclePlay} className="fa-solid" />
|
||||
<span>{intl.formatMessage({ id: "actions.clear_image" })}</span>
|
||||
<span>
|
||||
{intl.formatMessage({ id: "actions.clear_image" })}
|
||||
</span>
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
|||
Loading…
Reference in a new issue