From 213686b13819d1be8e89678eed6c18679e861ea9 Mon Sep 17 00:00:00 2001 From: Chase Martin Date: Fri, 1 Aug 2025 13:27:07 -0700 Subject: [PATCH 1/8] feat: move asset logic into createeditasset form component --- src/components/form/asset/CreateEditAsset.tsx | 245 ++++++++++++++++++ src/pages/dataforge/asset/create.tsx | 213 +-------------- .../dataforge/well-inventory-form/index.tsx | 98 ++++--- .../well_inventory.service.ts | 1 + 4 files changed, 314 insertions(+), 243 deletions(-) create mode 100644 src/components/form/asset/CreateEditAsset.tsx diff --git a/src/components/form/asset/CreateEditAsset.tsx b/src/components/form/asset/CreateEditAsset.tsx new file mode 100644 index 00000000..05c7da56 --- /dev/null +++ b/src/components/form/asset/CreateEditAsset.tsx @@ -0,0 +1,245 @@ +import { + HttpError, + useDataProvider, +} from '@refinedev/core' +import { useForm } from '@refinedev/react-hook-form' +import { Controller as RHController } from 'react-hook-form' +import { + Box, + TextField, + Stack, + Typography, + Input, + Button, +} from '@mui/material' +import { LoadingButton } from '@mui/lab' +import FileUploadIcon from '@mui/icons-material/FileUpload' +import { Add, Delete } from '@mui/icons-material' +import Grid from '@mui/material/Grid2' +import { useState } from 'react' + +import { Nullable } from '@/interfaces' +import { IAsset } from '@/interfaces/dataforge/IAsset' + +interface CreateEditAssetProps { + control: any + watch?: any + setValue?: any + setError?: any + register?: any + errors?: any + mode?: 'standalone' | 'step' + fieldPrefix?: string + // Asset-level array management (for multiple assets) + assetIndex?: number + onRemoveAsset?: (index: number) => void + onAddAsset?: (asset: any) => void + canRemoveAsset?: boolean + totalAssets?: number +} + +export const CreateEditAsset: React.FC = ({ + control, + watch, + setValue, + setError, + register, + errors, + mode = 'standalone', + fieldPrefix = '', + assetIndex, + onRemoveAsset, + onAddAsset, + canRemoveAsset = true, + totalAssets = 1 +}) => { + const [isUploadLoading, setIsUploadLoading] = useState(false) + + const getFieldName = (fieldName: string) => { + return mode === 'step' ? `${fieldPrefix}${fieldName}` : fieldName + } + + const dataProvider = useDataProvider() + const provider = dataProvider('dataforge') + + const onChangeHandler = async ( + event: React.ChangeEvent + ) => { + try { + setIsUploadLoading(true) + + const target = event.target + const file: File = (target.files as FileList)[0] + + const formData = new FormData() + formData.append('file', file) + + const asset = await provider + .custom({ + url: 'asset/upload', + method: 'post', + payload: formData, + headers: { + 'Content-Type': file.type, + }, + }) + .then((res) => { + if (res.data) { + return res.data + } else { + throw new Error('Upload failed') + } + }) + .catch((error) => { + setError('file', { message: error.message }) + setIsUploadLoading(false) + throw error + }) + + const { name, size, type, lastModified } = file + const imagePayload = [ + { + name, + size, + type, + lastModified, + url: asset.url, + }, + ] + setValue(getFieldName('file'), imagePayload, { shouldValidate: true }) + setValue(getFieldName('name'), name, { shouldValidate: true }) + setValue(getFieldName('storage_path'), asset.storage_path, { shouldValidate: true }) + setValue(getFieldName('mime_type'), type, { shouldValidate: true }) + setValue(getFieldName('size'), size, { shouldValidate: true }) + setValue(getFieldName('url'), asset.url, { shouldValidate: true }) + setIsUploadLoading(false) + } catch (error) { + console.log(error) + setError(getFieldName('file'), { message: 'Upload failed. Please try again.' }) + setIsUploadLoading(false) + } + } + + const imageInput = watch ? watch(getFieldName('file')) : null + + return ( + + {/* Asset Header with Remove Button */} + {assetIndex !== undefined && ( + + + Asset {assetIndex + 1} + {onRemoveAsset && ( + + )} + + + )} + + {/* Asset Label */} + + ( + + )} + /> + + + + + {/* File Upload Section */} + + + + {imageInput && ( + + )} + + + + {/* Add Asset Button - Show on last asset only */} + {onAddAsset && assetIndex === totalAssets - 1 && ( + + + + )} + + ) +} \ No newline at end of file diff --git a/src/pages/dataforge/asset/create.tsx b/src/pages/dataforge/asset/create.tsx index 169d99cc..2873fa9f 100644 --- a/src/pages/dataforge/asset/create.tsx +++ b/src/pages/dataforge/asset/create.tsx @@ -1,218 +1,31 @@ -import { - HttpError, - useApiUrl, - useCreate, - useDataProvider, -} from '@refinedev/core' -import { Create, useAutocomplete } from '@refinedev/mui' -import Box from '@mui/material/Box' -import TextField from '@mui/material/TextField' -import Autocomplete from '@mui/material/Autocomplete' +import type { HttpError } from '@refinedev/core' +import { Create } from '@refinedev/mui' import { useForm } from '@refinedev/react-hook-form' -import { Controller } from 'react-hook-form' import { Nullable } from '../../../interfaces' import { IAsset } from '@/interfaces/dataforge/IAsset' -import { useCallback, useState } from 'react' -import axios from 'axios' -import { Input, Stack, Typography } from '@mui/material' -import { LoadingButton } from '@mui/lab' -import FileUploadIcon from '@mui/icons-material/FileUpload' -import { IThing } from '@/interfaces/dataforge/IThing' +import { CreateEditAsset } from '@/components/form/asset/CreateEditAsset' export const AssetCreate: React.FC = () => { const { saveButtonProps, - register, control, - formState: { errors }, setValue, setError, - watch, + register, + formState: { errors }, } = useForm>() - const [isUploadLoading, setIsUploadLoading] = useState(false) - - const [thingValue, setThingValue] = useState(null) - const { autocompleteProps } = useAutocomplete({ - resource: 'thing', - dataProviderName: 'dataforge', - onSearch: (value) => [ - { - field: 'name', - operator: 'contains', - value, - }, - ], - }) - - const dataProvider = useDataProvider() - const provider = dataProvider('dataforge') - - const onChangeHandler = async ( - event: React.ChangeEvent - ) => { - try { - setIsUploadLoading(true) - - const target = event.target - const file: File = (target.files as FileList)[0] - - const formData = new FormData() - formData.append('file', file) - - const asset = await provider - .custom({ - url: 'asset/upload', - method: 'post', - payload: formData, - headers: { - 'Content-Type': file.type, - }, - }) - .then((res) => { - if (res.data) { - return res.data - } else { - throw new Error('Upload failed') - } - }) - .catch((error) => { - setError('file', { message: error.message }) - setIsUploadLoading(false) - throw error - }) - - const { name, size, type, lastModified } = file - const imagePayload = [ - { - name, - size, - type, - lastModified, - url: asset.url, - }, - ] - setValue('file', imagePayload, { shouldValidate: true }) - setValue('name', name, { shouldValidate: true }) - setValue('storage_path', asset.storage_path, { shouldValidate: true }) - setValue('mime_type', type, { shouldValidate: true }) - setValue('size', size, { shouldValidate: true }) - setValue('url', asset.url, { shouldValidate: true }) - setIsUploadLoading(false) - } catch (error) { - console.log(error) - setError('file', { message: 'Upload failed. Please try again.' }) - setIsUploadLoading(false) - } - } - - const imageInput = watch('file') return ( - - - ( - { - setThingValue(newValue) - field.onChange(newValue?.id || null) - }} - getOptionKey={(option) => option.id} - getOptionLabel={(option) => option.name || ''} - renderInput={(params) => ( - - )} - /> - )} - /> - - {/**/} - - - {imageInput && ( - - )} - + ) } diff --git a/src/pages/dataforge/well-inventory-form/index.tsx b/src/pages/dataforge/well-inventory-form/index.tsx index 6228c9bd..7ff8f2d3 100644 --- a/src/pages/dataforge/well-inventory-form/index.tsx +++ b/src/pages/dataforge/well-inventory-form/index.tsx @@ -25,6 +25,7 @@ import { createWellInventoryForm } from '@/pages/dataforge/well-inventory-form/w import { CreateEditLocation } from '@/components/form/location/CreateEditLocation' import { CreateEditWell } from '@/components/form/thing/CreateEditWell' import { CreateEditContact } from '@/components/form/contact/CreateEditContact' +import { CreateEditAsset } from '@/components/form/asset/CreateEditAsset' import { FormReview } from '@/components/form/stepper/FormReview' import { FormStepper } from '@/components/form/stepper/FormStepper' @@ -51,6 +52,8 @@ export const WellInventoryForm: React.FC = () => { handleSubmit, reset, setValue, + setError, + register, watch, trigger, formState: { errors }, @@ -165,8 +168,8 @@ export const WellInventoryForm: React.FC = () => { return case 2: return - case 3: - return + case 3: + return case 4: return default: @@ -371,11 +374,14 @@ const ContactsStep: React.FC<{ const AssetsStep: React.FC<{ control: any watch: any + setValue: any + setError: any + register: any errors: any assetFields: any appendAsset: any removeAsset: any -}> = ({ control, watch, errors, assetFields, appendAsset, removeAsset }) => ( +}> = ({ control, watch, setValue, setError, register, errors, assetFields, appendAsset, removeAsset }) => ( @@ -384,46 +390,52 @@ const AssetsStep: React.FC<{ {assetFields.map((field, index) => ( - - - - - - - - - - + + { + // Set the thing_id to the well that will be created + appendAsset({ + ...asset, + thing_id: null // This will be set after well creation in the service + }) + }} + canRemoveAsset={assetFields.length > 1} + totalAssets={assetFields.length} + /> ))} - - - + {/* Show Add Asset button when no assets exist */} + {assetFields.length === 0 && ( + + + + )} ) @@ -472,9 +484,9 @@ const ReviewStep: React.FC<{ }, { title: `Assets (${formData.assets?.length || 0})`, - items: formData.assets?.map((asset) => ({ - label: `Asset`, - value: `${asset.label || 'Not specified'} - ${asset.name || 'Not specified'}` + items: formData.assets?.map((asset, index) => ({ + label: `Asset ${index + 1}`, + value: `${asset.label || 'Not specified'} - ${asset.name || 'Not specified'} - ${asset.thing_id ? 'Thing Selected' : 'No Thing'}` })) || [] } ] diff --git a/src/pages/dataforge/well-inventory-form/well_inventory.service.ts b/src/pages/dataforge/well-inventory-form/well_inventory.service.ts index 2b1d17bd..b16a01cf 100644 --- a/src/pages/dataforge/well-inventory-form/well_inventory.service.ts +++ b/src/pages/dataforge/well-inventory-form/well_inventory.service.ts @@ -73,6 +73,7 @@ export const createWellInventoryForm = async (data: IWellInventoryForm) => { variables: { name: asset.name, label: asset.label, + thing_id: wellId, }, }) From d8e69841f362480abbfe888b0a5ae8c3ae1a1c01 Mon Sep 17 00:00:00 2001 From: Chase Martin Date: Fri, 1 Aug 2025 15:19:04 -0700 Subject: [PATCH 2/8] fix: update asset schema for well inventory form --- src/components/form/asset/CreateEditAsset.tsx | 4 +-- .../dataforge/IWellInventoryForm.ts | 6 ++++- .../dataforge/well-inventory-form/index.tsx | 6 ++++- .../well_inventory.schema.ts | 22 ++++++++++++++++ .../well_inventory.service.ts | 25 ++++++++++++------- 5 files changed, 50 insertions(+), 13 deletions(-) diff --git a/src/components/form/asset/CreateEditAsset.tsx b/src/components/form/asset/CreateEditAsset.tsx index 05c7da56..c193a2db 100644 --- a/src/components/form/asset/CreateEditAsset.tsx +++ b/src/components/form/asset/CreateEditAsset.tsx @@ -3,7 +3,7 @@ import { useDataProvider, } from '@refinedev/core' import { useForm } from '@refinedev/react-hook-form' -import { Controller as RHController } from 'react-hook-form' +import { Controller } from 'react-hook-form' import { Box, TextField, @@ -146,7 +146,7 @@ export const CreateEditAsset: React.FC = ({ {/* Asset Label */} - } \ No newline at end of file diff --git a/src/pages/dataforge/well-inventory-form/index.tsx b/src/pages/dataforge/well-inventory-form/index.tsx index 7ff8f2d3..37ef7fd5 100644 --- a/src/pages/dataforge/well-inventory-form/index.tsx +++ b/src/pages/dataforge/well-inventory-form/index.tsx @@ -406,7 +406,11 @@ const AssetsStep: React.FC<{ // Set the thing_id to the well that will be created appendAsset({ ...asset, - thing_id: null // This will be set after well creation in the service + thing_id: null, // This will be set after well creation in the service + storage_path: '', + mime_type: '', + size: 0, + url: '' }) }} canRemoveAsset={assetFields.length > 1} diff --git a/src/pages/dataforge/well-inventory-form/well_inventory.schema.ts b/src/pages/dataforge/well-inventory-form/well_inventory.schema.ts index fcfef070..0fe1f904 100644 --- a/src/pages/dataforge/well-inventory-form/well_inventory.schema.ts +++ b/src/pages/dataforge/well-inventory-form/well_inventory.schema.ts @@ -67,6 +67,28 @@ export const wellInventoryStepSchemas: Yup.ObjectSchema[] = [ Yup.object({ label: Yup.string().required('Asset label is required'), name: Yup.string().required('Asset name is required'), + storage_path: Yup.string().when('file', { + is: (file: any) => file !== null && file !== undefined, + then: (schema) => schema.required('Storage path is required'), + otherwise: (schema) => schema.nullable(), + }), + mime_type: Yup.string().when('file', { + is: (file: any) => file !== null && file !== undefined, + then: (schema) => schema.required('MIME type is required'), + otherwise: (schema) => schema.nullable(), + }), + size: Yup.number().when('file', { + is: (file: any) => file !== null && file !== undefined, + then: (schema) => schema.required('File size is required').min(0, 'File size must be non-negative'), + otherwise: (schema) => schema.nullable(), + }), + url: Yup.string().when('file', { + is: (file: any) => file !== null && file !== undefined, + then: (schema) => schema.required('File URL is required'), + otherwise: (schema) => schema.nullable(), + }), + file: Yup.mixed().nullable(), + thing_id: Yup.number().nullable(), }) ), }), diff --git a/src/pages/dataforge/well-inventory-form/well_inventory.service.ts b/src/pages/dataforge/well-inventory-form/well_inventory.service.ts index b16a01cf..09d9bdcb 100644 --- a/src/pages/dataforge/well-inventory-form/well_inventory.service.ts +++ b/src/pages/dataforge/well-inventory-form/well_inventory.service.ts @@ -68,16 +68,23 @@ export const createWellInventoryForm = async (data: IWellInventoryForm) => { const assetResponses = [] if (data.assets?.length) { for (const asset of data.assets) { - const assetResponse = await dataForgeDataProvider.create({ - resource: 'dataforge.asset', - variables: { - name: asset.name, - label: asset.label, - thing_id: wellId, - }, - }) + // Only create assets that have been properly uploaded + if (asset.storage_path && asset.mime_type && asset.size && asset.url) { + const assetResponse = await dataForgeDataProvider.create({ + resource: 'dataforge.asset', + variables: { + name: asset.name, + label: asset.label, + storage_path: asset.storage_path, + mime_type: asset.mime_type, + size: asset.size, + url: asset.url, + thing_id: wellId, + }, + }) - assetResponses.push(assetResponse.data) + assetResponses.push(assetResponse.data) + } } } From 337875815b5549b0cf437f100f5306f2d1e11ba3 Mon Sep 17 00:00:00 2001 From: Chase Martin Date: Mon, 4 Aug 2025 10:53:27 -0700 Subject: [PATCH 3/8] fix: update canremove asset to work with a single asset --- .../dataforge/well-inventory-form/index.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/pages/dataforge/well-inventory-form/index.tsx b/src/pages/dataforge/well-inventory-form/index.tsx index 37ef7fd5..15872d53 100644 --- a/src/pages/dataforge/well-inventory-form/index.tsx +++ b/src/pages/dataforge/well-inventory-form/index.tsx @@ -368,8 +368,7 @@ const ContactsStep: React.FC<{ //Assets Step #4 ----------------------------------------------- /** - * @TODO this step a placeholder right now - * @refactor + * @TODO Link asset to a well via thing_id in future API changes */ const AssetsStep: React.FC<{ control: any @@ -403,17 +402,19 @@ const AssetsStep: React.FC<{ assetIndex={index} onRemoveAsset={removeAsset} onAddAsset={(asset) => { - // Set the thing_id to the well that will be created appendAsset({ ...asset, - thing_id: null, // This will be set after well creation in the service + thing_id: null, + /** + * @TODO Link asset to a well via thing_id in future API changes + */ storage_path: '', mime_type: '', size: 0, url: '' }) }} - canRemoveAsset={assetFields.length > 1} + canRemoveAsset={assetFields.length >= 1} totalAssets={assetFields.length} /> @@ -427,7 +428,10 @@ const AssetsStep: React.FC<{ onClick={() => appendAsset({ label: '', name: '', - thing_id: null, // This will be set after well creation in the service + thing_id: null, + /** + * @TODO Link asset to a well via thing_id in future API changes + */ file: null, storage_path: '', mime_type: '', From 531f863ac5f783f25a8eb7fc18facad0576d75ef Mon Sep 17 00:00:00 2001 From: Chase Martin Date: Mon, 4 Aug 2025 10:54:29 -0700 Subject: [PATCH 4/8] fix: add watch param to the asset create page for photo preview --- src/pages/dataforge/asset/create.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/dataforge/asset/create.tsx b/src/pages/dataforge/asset/create.tsx index 2873fa9f..c72dc4c2 100644 --- a/src/pages/dataforge/asset/create.tsx +++ b/src/pages/dataforge/asset/create.tsx @@ -10,6 +10,7 @@ export const AssetCreate: React.FC = () => { const { saveButtonProps, control, + watch, setValue, setError, register, @@ -20,6 +21,7 @@ export const AssetCreate: React.FC = () => { Date: Mon, 4 Aug 2025 11:51:00 -0700 Subject: [PATCH 5/8] feat: add existing image prop and update asset edit page --- src/components/form/asset/CreateEditAsset.tsx | 21 ++++++-- src/pages/dataforge/asset/edit.tsx | 51 +++++-------------- 2 files changed, 31 insertions(+), 41 deletions(-) diff --git a/src/components/form/asset/CreateEditAsset.tsx b/src/components/form/asset/CreateEditAsset.tsx index c193a2db..da41f45c 100644 --- a/src/components/form/asset/CreateEditAsset.tsx +++ b/src/components/form/asset/CreateEditAsset.tsx @@ -36,6 +36,7 @@ interface CreateEditAssetProps { onAddAsset?: (asset: any) => void canRemoveAsset?: boolean totalAssets?: number + existingAsset?: any } export const CreateEditAsset: React.FC = ({ @@ -51,7 +52,8 @@ export const CreateEditAsset: React.FC = ({ onRemoveAsset, onAddAsset, canRemoveAsset = true, - totalAssets = 1 + totalAssets = 1, + existingAsset }) => { const [isUploadLoading, setIsUploadLoading] = useState(false) @@ -120,8 +122,19 @@ export const CreateEditAsset: React.FC = ({ } } + //handle create image input const imageInput = watch ? watch(getFieldName('file')) : null + //handle creating preview for existing asset + const existingAssetPreview = existingAsset ? { + name: existingAsset.name, + url: existingAsset.url, + mime_type: existingAsset.mime_type, + size: existingAsset.size + } : null + + const previewAsset = imageInput || (existingAssetPreview ? [existingAssetPreview] : null) + return ( {/* Asset Header with Remove Button */} @@ -204,7 +217,7 @@ export const CreateEditAsset: React.FC = ({ )} - {imageInput && ( + {previewAsset && ( = ({ maxHeight: '200px', objectFit: 'contain', }} - src={imageInput[0].url} - alt={imageInput[0].name} + src={previewAsset[0].url} + alt={previewAsset[0].name} /> )} diff --git a/src/pages/dataforge/asset/edit.tsx b/src/pages/dataforge/asset/edit.tsx index 65c2b9c1..ff7dedd1 100644 --- a/src/pages/dataforge/asset/edit.tsx +++ b/src/pages/dataforge/asset/edit.tsx @@ -7,20 +7,20 @@ import CircularProgress from '@mui/material/CircularProgress' import type { Nullable } from '@/interfaces' import { IAsset } from '@/interfaces/dataforge/IAsset' import { useState } from 'react' +import { CreateEditAsset } from '@/components/form/asset/CreateEditAsset' export const AssetEdit: React.FC = () => { const { saveButtonProps, refineCore: { query: queryResult }, - register, control, + watch, + setValue, + setError, + register, formState: { errors }, } = useForm>() - // const { autocompleteProps } = useAutocomplete({ - // resource: "categories", - // defaultValue: queryResult?.data?.data.category.id, - // }); const { data, isLoading, isError } = useOne({ resource: 'asset', id: queryResult?.data?.data.id, @@ -32,41 +32,18 @@ export const AssetEdit: React.FC = () => { }) const image = data?.data - // const [imgLoading, setImgLoading] = useState(true) return ( - - - - {isLoading && ( - - )} - ) From 5db94a4c92e6e935856e6405cb5ef6b711eaff04 Mon Sep 17 00:00:00 2001 From: Chase Martin Date: Mon, 4 Aug 2025 13:36:36 -0700 Subject: [PATCH 6/8] fix: remove cache from asset edit and fix input default --- src/components/form/asset/CreateEditAsset.tsx | 8 ++------ src/pages/dataforge/asset/edit.tsx | 4 ++-- src/pages/dataforge/well-inventory-form/index.tsx | 3 +++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/form/asset/CreateEditAsset.tsx b/src/components/form/asset/CreateEditAsset.tsx index da41f45c..2db28e47 100644 --- a/src/components/form/asset/CreateEditAsset.tsx +++ b/src/components/form/asset/CreateEditAsset.tsx @@ -1,8 +1,6 @@ import { - HttpError, useDataProvider, } from '@refinedev/core' -import { useForm } from '@refinedev/react-hook-form' import { Controller } from 'react-hook-form' import { Box, @@ -18,9 +16,6 @@ import { Add, Delete } from '@mui/icons-material' import Grid from '@mui/material/Grid2' import { useState } from 'react' -import { Nullable } from '@/interfaces' -import { IAsset } from '@/interfaces/dataforge/IAsset' - interface CreateEditAssetProps { control: any watch?: any @@ -132,7 +127,7 @@ export const CreateEditAsset: React.FC = ({ mime_type: existingAsset.mime_type, size: existingAsset.size } : null - + //determine which preview to use, upload or existing asset const previewAsset = imageInput || (existingAssetPreview ? [existingAssetPreview] : null) return ( @@ -163,6 +158,7 @@ export const CreateEditAsset: React.FC = ({ name={getFieldName('label')} control={control} rules={{ required: 'This field is required' }} + defaultValue={existingAsset?.label || ''} render={({ field, fieldState }) => ( { id: queryResult?.data?.data.id, dataProviderName: 'dataforge', queryOptions: { - cacheTime: 10 * 60 * 1000, // 10 minutes - staleTime: 5 * 60 * 1000, // 5 minutes + cacheTime: 0, + staleTime: 0 }, }) diff --git a/src/pages/dataforge/well-inventory-form/index.tsx b/src/pages/dataforge/well-inventory-form/index.tsx index 15872d53..9f7a010b 100644 --- a/src/pages/dataforge/well-inventory-form/index.tsx +++ b/src/pages/dataforge/well-inventory-form/index.tsx @@ -369,6 +369,9 @@ const ContactsStep: React.FC<{ //Assets Step #4 ----------------------------------------------- /** * @TODO Link asset to a well via thing_id in future API changes + * @TODO Create a new component that allows for multi-file selection without immediate upload, and + * change the asset step to use this new component + * @TODO change the well inventory form to only upload new asset on form submit, not on file selection */ const AssetsStep: React.FC<{ control: any From 1371beb74a43de5b1dfc154bebdf53ee2f38701f Mon Sep 17 00:00:00 2001 From: Chase Martin Date: Mon, 4 Aug 2025 13:59:31 -0700 Subject: [PATCH 7/8] fix: remove thing from asset review --- src/pages/dataforge/well-inventory-form/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/dataforge/well-inventory-form/index.tsx b/src/pages/dataforge/well-inventory-form/index.tsx index 9f7a010b..238592e9 100644 --- a/src/pages/dataforge/well-inventory-form/index.tsx +++ b/src/pages/dataforge/well-inventory-form/index.tsx @@ -497,7 +497,7 @@ const ReviewStep: React.FC<{ title: `Assets (${formData.assets?.length || 0})`, items: formData.assets?.map((asset, index) => ({ label: `Asset ${index + 1}`, - value: `${asset.label || 'Not specified'} - ${asset.name || 'Not specified'} - ${asset.thing_id ? 'Thing Selected' : 'No Thing'}` + value: `${asset.label || 'Not specified'} - ${asset.name || 'Not specified'}` })) || [] } ] From f5b51a540ca60d7620cbb77d8ee7dd7546be38f0 Mon Sep 17 00:00:00 2001 From: Chase Martin Date: Mon, 4 Aug 2025 14:21:02 -0700 Subject: [PATCH 8/8] fix: update default schema not that lexicon is enabled --- .../dataforge/well-inventory-form/well_inventory.schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/dataforge/well-inventory-form/well_inventory.schema.ts b/src/pages/dataforge/well-inventory-form/well_inventory.schema.ts index 0fe1f904..576d28d7 100644 --- a/src/pages/dataforge/well-inventory-form/well_inventory.schema.ts +++ b/src/pages/dataforge/well-inventory-form/well_inventory.schema.ts @@ -102,7 +102,7 @@ export const SchemaDefaults: Partial = { name: '', notes: '', point: '', - release_status: 'public', + release_status: '', }, well: { name: '', @@ -115,7 +115,7 @@ export const SchemaDefaults: Partial = { contacts: [ { name: '', - role: 'owner', + role: '', emails: [], phones: [], addresses: [],