Skip to content

Commit

Permalink
Update image 'edit' form title, as form isn't actually editable (#2312)
Browse files Browse the repository at this point in the history
Update image 'edit' form title, as it isn't editable
  • Loading branch information
charliepark authored Jul 3, 2024
1 parent 3a2e3e1 commit 00b7602
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/forms/image-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { PropertiesTable } from '~/ui/lib/PropertiesTable'
import { ResourceLabel } from '~/ui/lib/SideModal'
import { Truncate } from '~/ui/lib/Truncate'
import { pb } from '~/util/path-builder'
import { capitalize } from '~/util/str'
import { bytesToGiB } from '~/util/units'

EditProjectImageSideModalForm.loader = async ({ params }: LoaderFunctionArgs) => {
Expand Down Expand Up @@ -69,12 +70,14 @@ export function EditImageSideModalForm({
}) {
const navigate = useNavigate()
const form = useForm({ defaultValues: image })
const resourceName = type === 'Project' ? 'project image' : 'silo image'

return (
<SideModalForm
title={capitalize(resourceName)}
form={form}
formType="edit"
resourceName={type === 'Project' ? 'project image' : 'silo image'}
resourceName={resourceName}
onDismiss={() => navigate(dismissLink)}
subtitle={
<ResourceLabel>
Expand All @@ -100,7 +103,6 @@ export function EditImageSideModalForm({
<DateTime date={image.timeModified} />
</PropertiesTable.Row>
</PropertiesTable>

<NameField name="name" control={form.control} disabled />
<DescriptionField name="description" control={form.control} required disabled />
<TextField name="os" label="OS" control={form.control} required disabled />
Expand Down

0 comments on commit 00b7602

Please sign in to comment.