Browse Source

Test 3 fixed

Richard Knight 6 years ago
parent
commit
1c3d06c907
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/app/dynaform/services/_formdata-utils.ts

+ 2 - 3
src/app/dynaform/services/_formdata-utils.ts

@@ -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}"`);