Skip to content

Commit

Permalink
fix: dimensionality per data type blob and be disabled in UI (#371)
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Jahn <[email protected]>
  • Loading branch information
eugenejahn authored Apr 12, 2022
1 parent 3569594 commit dc38ae3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/Launch/LaunchForm/BlobInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<InputProps> = (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;

Expand Down Expand Up @@ -102,6 +108,7 @@ export const BlobInput: React.FC<InputProps> = (props) => {
id={selectId}
value={blobValue.dimensionality}
onChange={handleDimensionalityChange}
disabled
>
<MenuItem value={BlobDimensionality.SINGLE}>Single (File)</MenuItem>
<MenuItem value={BlobDimensionality.MULTIPART}>Multipart (Directory)</MenuItem>
Expand Down

0 comments on commit dc38ae3

Please sign in to comment.