55 *
66 * Copyright Oxide Computer Company
77 */
8- // Read-only disk creation is disabled pending a propolis fix. To re-enable:
9- // 1. Uncomment CheckboxField import and JSX in this file
10- // 2. Uncomment CheckboxField JSX in app/forms/instance-create.tsx
11- // 3. Use `values.bootDiskReadOnly` instead of hardcoded `false` in instance-create.tsx getBootDisk
12- // 4. Use `source.readOnly` instead of hardcoded `false` in the onSubmit handler below
13- // 5. Unskip e2e tests in test/e2e/disks.e2e.ts and test/e2e/instance-create.e2e.ts
14- // https://github.com/oxidecomputer/console/issues/3071
158import { useQuery } from '@tanstack/react-query'
169import { filesize } from 'filesize'
1710import { useMemo } from 'react'
@@ -30,7 +23,7 @@ import {
3023 type Image ,
3124} from '@oxide/api'
3225
33- // import { CheckboxField } from '~/components/form/fields/CheckboxField' // re-enable with #3071
26+ import { CheckboxField } from '~/components/form/fields/CheckboxField'
3427import { DescriptionField } from '~/components/form/fields/DescriptionField'
3528import { DiskSizeField } from '~/components/form/fields/DiskSizeField'
3629import { toImageComboboxItem } from '~/components/form/fields/ImageSelectField'
@@ -179,14 +172,14 @@ export function CreateDiskSideModalForm({
179172 // image ID is validated by the form: it's required when the
180173 // field is present (i.e., when image type is selected)
181174 imageId : source . imageId ! ,
182- readOnly : false ,
175+ readOnly : source . readOnly ,
183176 } ) )
184177 . with ( { type : 'snapshot' } , ( source ) => ( {
185178 type : 'snapshot' as const ,
186179 // snapshot ID is validated by the form: it's required when
187180 // the field is present (i.e., when snapshot type is selected)
188181 snapshotId : source . snapshotId ! ,
189- readOnly : false ,
182+ readOnly : source . readOnly ,
190183 } ) )
191184 . exhaustive ( ) ,
192185 } ) )
@@ -377,28 +370,22 @@ const DiskSourceField = ({
377370 }
378371 } }
379372 />
380- { /* Read-only disk creation disabled pending propolis fix
381- https://github.com/oxidecomputer/console/issues/3071
382373 < div className = "mt-2" >
383374 < CheckboxField name = "diskBackend.diskSource.readOnly" control = { control } >
384375 Make disk read-only
385376 </ CheckboxField >
386377 </ div >
387- */ }
388378 </ >
389379 ) }
390380
391381 { diskSource . type === 'snapshot' && (
392382 < >
393383 < SnapshotSelectField control = { control } />
394- { /* Read-only disk creation disabled pending propolis fix
395- https://github.com/oxidecomputer/console/issues/3071
396384 < div className = "mt-2" >
397385 < CheckboxField name = "diskBackend.diskSource.readOnly" control = { control } >
398386 Make disk read-only
399387 </ CheckboxField >
400388 </ div >
401- */ }
402389 </ >
403390 ) }
404391 </ div >
0 commit comments