diff --git a/src/components/custom/edit/dataset/DatasetType.jsx b/src/components/custom/edit/dataset/DatasetType.jsx index 2e3189143..3ee767c56 100644 --- a/src/components/custom/edit/dataset/DatasetType.jsx +++ b/src/components/custom/edit/dataset/DatasetType.jsx @@ -3,16 +3,17 @@ import {Col, Form, Row} from 'react-bootstrap'; import SenNetPopover from "../../../SenNetPopover"; import {getUBKGFullName} from "../../js/functions"; -export default function DatasetType({datasetTypes, data, onChange}) { +export default function DatasetType({datasetTypes, data, label, labelDescription, dataValue, onChange}) { + console.log(datasetTypes) return ( //Data Types <> - Dataset Type {label ? label : `Dataset Type` }* The type of data contained in this Dataset. Choose from one + text={labelDescription ? labelDescription : <>The type of data contained in this Dataset. Choose from one of the available options.}> @@ -23,13 +24,13 @@ export default function DatasetType({datasetTypes, data, onChange}) { ( + value={data.dataset_type}>{getUBKGFullName(dataValue ? data[dataValue] : data.dataset_type)} ) : ( onChange(e, 'dataset_type', e.target.value)} - name={'dataset_type'} - defaultValue={data?.dataset_type}> + onChange={(e) => onChange(e, dataValue ? dataValue : 'dataset_type', e.target.value)} + name={dataValue ? dataValue : 'dataset_type'} + defaultValue={dataValue ? data?.[dataValue] : data?.dataset_type}> {datasetTypes.map(data_type => { return ( diff --git a/src/pages/edit/dataset.jsx b/src/pages/edit/dataset.jsx index e7b479628..d76b8c0d4 100644 --- a/src/pages/edit/dataset.jsx +++ b/src/pages/edit/dataset.jsx @@ -533,7 +533,7 @@ export default function EditDataset() { } - {/*/!*Data Types*!/*/} + {/*/!*Dataset Type*!/*/} {editMode && import("../../components/custom/layout/AppFooter")) -const AppNavbar = dynamic(() => import("../../components/custom/layout/AppNavbar")) -const DatasetSubmissionButton = dynamic(() => import("../../components/custom/edit/dataset/DatasetSubmissionButton")) -const EntityHeader = dynamic(() => import('../../components/custom/layout/entity/Header')) -const EntityFormGroup = dynamic(() => import('../../components/custom/layout/entity/FormGroup')) -const GroupSelect = dynamic(() => import("../../components/custom/edit/GroupSelect")) -const Header = dynamic(() => import("../../components/custom/layout/Header")) -const SenNetAlert = dynamic(() => import("../../components/SenNetAlert")) -const SenNetPopover = dynamic(() => import("../../components/SenNetPopover")) +const AppFooter = dynamic(() => import("@/components/custom/layout/AppFooter")) +const AppNavbar = dynamic(() => import("@/components/custom/layout/AppNavbar")) +const DatasetSubmissionButton = dynamic(() => import("@/components/custom/edit/dataset/DatasetSubmissionButton")) +const DatasetType = dynamic(() => import("@/components/custom/edit/dataset/DatasetType")) +const EntityHeader = dynamic(() => import('@/components/custom/layout/entity/Header')) +const EntityFormGroup = dynamic(() => import('@/components/custom/layout/entity/FormGroup')) +const GroupSelect = dynamic(() => import("@/components/custom/edit/GroupSelect")) +const Header = dynamic(() => import("@/components/custom/layout/Header")) +const SenNetAlert = dynamic(() => import("@/components/SenNetAlert")) +const SenNetPopover = dynamic(() => import("@/components/SenNetPopover")) function EditUpload() { @@ -41,7 +42,6 @@ function EditUpload() { getCancelBtn, isAdminOrHasValue, getAssignedToGroupNames } = useContext(EntityContext) const {_t, cache, adminGroup, getBusyOverlay, toggleBusyOverlay, getPreviewView} = useContext(AppContext) - const router = useRouter() const [source, setSource] = useState(null) @@ -286,6 +286,44 @@ function EditUpload() { text={<>Free text field to enter a description of the Upload.}/> + {/*/!*Intended Dataset Type*!/*/} + The dataset type of the intended datasets that will be + uploaded as part of this Upload.} + dataValue={'intended_dataset_type'} + values={values} data={data} onChange={onChange}/> + + {/*/!*Intended Organ*!/*/} + + Intended Organ* + The organ that the data contained in + this Upload will be + registered/associated with.}> + + + + + { + onChange(e, e.target.id, e.target.value) + }} + defaultValue={data.intended_organ}> + + {Object.entries(cache.organTypes).map(op => { + return ( + + ); + + })} + + + +
{getCancelBtn('upload')}