Skip to content

Commit 3a8da32

Browse files
Added comments to funcs
Signed-off-by: Natalia Luzuriaga <natalia.luzuriaga@cms.hhs.gov>
1 parent c2b131d commit 3a8da32

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

js/generateFormComponents.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,13 @@ function createComponent(fieldName, fieldObject) {
212212
}
213213
}
214214

215+
// Adds heading containing schema information
215216
function createFormHeading(title, description) {
216217
const container = document.getElementById('form-header');
217218
container.innerHTML = `<h1>${title}</h1>\n<h2>${description}</h2>`;
218219
}
219220

221+
// Iterates through each json field and creates component array for Form.io
220222
function createAllComponents(schema, prefix = ""){
221223
let components = [];
222224

@@ -226,6 +228,7 @@ function createAllComponents(schema, prefix = ""){
226228

227229
for (const [key, value] of Object.entries(items)) {
228230

231+
console.log("key at play:", key);
229232
const fullKey = prefix ? `${prefix}.${key}` : key;
230233

231234
var fieldComponent = createComponent(key, value);
@@ -244,7 +247,7 @@ function createAllComponents(schema, prefix = ""){
244247
return components;
245248
}
246249

247-
// Iterates through each json field and creates component array for Form.io
250+
// Creates complete form based on input json schema
248251
async function createFormComponents() {
249252
let components = [];
250253

0 commit comments

Comments
 (0)