From aa43ee3012b595691f1e62376556ae6ef2e0bb8f Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 18 Sep 2023 16:50:40 -0500 Subject: [PATCH] Fix short id form field --- src/photo/form.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/photo/form.ts b/src/photo/form.ts index 21326a49..ca4bc056 100644 --- a/src/photo/form.ts +++ b/src/photo/form.ts @@ -19,11 +19,21 @@ type FormMeta = { hideTemporarily?: boolean }; -const FORM_METADATA: Record = { +const FORM_METADATA: Record< + // Display short ids as a convenience + // even though they're not part of form data + keyof PhotoFormData & { idShort?: string }, + FormMeta +> = { title: { label: 'title' }, tags: { label: 'tags', note: 'comma-separated values' }, id: { label: 'id', readOnly: true, hideIfEmpty: true }, - idShort: { label: 'short id', readOnly: true, hideIfEmpty: true }, + idShort: { + label: 'short id', + readOnly: true, + hideIfEmpty: true, + note: 'Auto-generated by id', + }, url: { label: 'url', readOnly: true }, extension: { label: 'extension', readOnly: true }, aspectRatio: { label: 'aspect ratio', readOnly: true },