Fix short id form field

This commit is contained in:
Sam Becker 2023-09-18 16:50:40 -05:00
parent d86b00476d
commit aa43ee3012

View File

@ -19,11 +19,21 @@ type FormMeta = {
hideTemporarily?: boolean
};
const FORM_METADATA: Record<keyof PhotoFormData, FormMeta> = {
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 },