Skip to content

Commit

Permalink
fix: address icon regression
Browse files Browse the repository at this point in the history
  • Loading branch information
Hein Jeong authored and hein-j committed Apr 19, 2023
1 parent 1898a2f commit d913b93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,12 @@ export function buildFixedLiteralExpression(
const { value, type } = prop;
switch (typeof value) {
case 'number':
return factory.createNumericLiteral(value as number, undefined);
return factory.createNumericLiteral(value, undefined);
case 'boolean':
return value ? factory.createTrue() : factory.createFalse();
case 'string':
return fixedPropertyWithTypeToLiteral(value, type);
case 'object':
if (type !== 'object') {
return fixedPropertyWithTypeToLiteral(value as string, type);
}
if (value instanceof Date) {
throw new Error('Date object is not currently supported for fixed literal expression.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ export const renderStorageFieldComponent = (
if (isStorageManagerKey(key)) {
let storageManagerValue = value;

if (key === 'acceptedFileTypes') {
storageManagerValue = { ...value, value: (value as any).value.split(',') };
}
if (key === 'maxFileCount' && !fieldConfigs[componentName].isArray) {
storageManagerValue = { ...value, value: 1 };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ import { ctaButtonMapper, addCTAPosition } from './helpers/map-cta-buttons';
const mapFormElementProps = (element: FormDefinitionElement) => {
const props: StudioComponentProperties = {};
Object.entries(element.props).forEach(([key, value]) => {
props[key] = { value: `${value}`, type: `${typeof value}` };
if (Array.isArray(value)) {
props[key] = { value: JSON.stringify(value), type: 'object' };
} else {
props[key] = { value: `${value}`, type: `${typeof value}` };
}
});
return props;
};
Expand Down

0 comments on commit d913b93

Please sign in to comment.