From 541c09c5515df0160744d2c5b8e42e42abc49b93 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 24 Feb 2025 17:28:37 -0600 Subject: [PATCH] Allow editing recipe data, protect manually configured fuji fields --- app/admin/uploads/[uploadPath]/page.tsx | 6 ++--- src/components/FieldSetWithStatus.tsx | 5 ++++ src/photo/PhotoLarge.tsx | 14 ++++++---- src/photo/UploadPageClient.tsx | 10 +++---- src/photo/actions.ts | 36 +++++++++++++++---------- src/photo/form/PhotoForm.tsx | 2 ++ src/photo/form/index.ts | 28 ++++++++++++++++--- src/photo/server.ts | 4 +-- 8 files changed, 72 insertions(+), 33 deletions(-) diff --git a/app/admin/uploads/[uploadPath]/page.tsx b/app/admin/uploads/[uploadPath]/page.tsx index 100913af..cf0b1765 100644 --- a/app/admin/uploads/[uploadPath]/page.tsx +++ b/app/admin/uploads/[uploadPath]/page.tsx @@ -21,7 +21,7 @@ export default async function UploadPage({ params }: Params) { const { blobId, - photoFormExif, + formDataFromExif, imageResizedBase64: imageThumbnailBase64, shouldStripGpsData, error, @@ -32,7 +32,7 @@ export default async function UploadPage({ params }: Params) { }); const isDataMissing = - !photoFormExif || + !formDataFromExif || (AI_TEXT_GENERATION_ENABLED && !imageThumbnailBase64); if (isDataMissing && !error) { @@ -50,7 +50,7 @@ export default async function UploadPage({ params }: Params) { !isDataMissing ? @@ -140,6 +142,8 @@ export default function FieldSetWithStatus({ placeholder={placeholder} onChange={e => onChange?.(e.target.value)} readOnly={readOnly || pending || loading} + spellCheck={spellCheck} + autoCapitalize={!capitalize ? 'off' : undefined} className={clsx( 'w-full h-24 resize-none', Boolean(error) && 'error', @@ -156,6 +160,7 @@ export default function FieldSetWithStatus({ ? e.target.value === 'true' ? 'false' : 'true' : e.target.value)} type={type} + spellCheck={spellCheck} autoComplete="off" autoCapitalize={!capitalize ? 'off' : undefined} readOnly={readOnly || pending || loading} diff --git a/src/photo/PhotoLarge.tsx b/src/photo/PhotoLarge.tsx index b6f859e4..0949b316 100644 --- a/src/photo/PhotoLarge.tsx +++ b/src/photo/PhotoLarge.tsx @@ -307,12 +307,16 @@ export default function PhotoLarge({
  • {photo.isoFormatted}
  • {photo.exposureCompensationFormatted ?? '0ev'}
  • - {showSimulation && photo.filmSimulation && + {( + (showSimulation && photo.filmSimulation) + || photo.fujifilmRecipe + ) &&
    - + {showSimulation && photo.filmSimulation && + } {photo.fujifilmRecipe &&