|
@@ -159,7 +159,7 @@ const resolveType = (metaFoG: StringMap): string => {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
-const buildFieldClassName = (t = 'text') => {
|
|
|
+const buildFieldClassName = (t: string): string => {
|
|
|
const start = t[0].toUpperCase() + t.slice(1);
|
|
|
if (start === 'Container' || start === 'RepeatingContainer' || start === 'Heading' || t.slice(-5) === 'Group') {
|
|
|
return start;
|
|
@@ -168,8 +168,7 @@ const buildFieldClassName = (t = 'text') => {
|
|
|
};
|
|
|
|
|
|
const buildModeledField = metaFoG => {
|
|
|
- const type = resolveType(metaFoG);
|
|
|
- console.log('Type is', type);
|
|
|
+ const type = resolveType(metaFoG) || 'text';
|
|
|
const className = buildFieldClassName(type);
|
|
|
if (!fmdModels[className]) {
|
|
|
throw new Error(`No metadata model "${className}" for type "${type}"`);
|