From 14b12c107eb9f8a0a8723a3a4f68934925650b4b Mon Sep 17 00:00:00 2001 From: Eugene Jahn Date: Mon, 11 Apr 2022 22:21:11 -0700 Subject: [PATCH] fix: dimensionality per data type blob and be disabled in UI Signed-off-by: Eugene Jahn --- src/components/Launch/LaunchForm/BlobInput.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/Launch/LaunchForm/BlobInput.tsx b/src/components/Launch/LaunchForm/BlobInput.tsx index ea3a38773..4f18dcb26 100644 --- a/src/components/Launch/LaunchForm/BlobInput.tsx +++ b/src/components/Launch/LaunchForm/BlobInput.tsx @@ -37,8 +37,14 @@ const useStyles = makeStyles((theme: Theme) => ({ /** A micro form for entering the values related to a Blob Literal */ export const BlobInput: React.FC = (props) => { const styles = useStyles(); - const { error, label, name, onChange, value: propValue } = props; - const blobValue = isBlobValue(propValue) ? propValue : defaultBlobValue; + const { error, label, name, onChange, value: propValue, typeDefinition } = props; + const dimensionality = typeDefinition?.literalType?.blob?.dimensionality; + const blobValue = isBlobValue(propValue) + ? propValue + : { + uri: '', + dimensionality: dimensionality ?? BlobDimensionality.SINGLE, + }; const hasError = !!error; const helperText = hasError ? error : props.helperText; @@ -102,6 +108,7 @@ export const BlobInput: React.FC = (props) => { id={selectId} value={blobValue.dimensionality} onChange={handleDimensionalityChange} + disabled > Single (File) Multipart (Directory)