Skip to content

Commit

Permalink
Added comments to funcs
Browse files Browse the repository at this point in the history
Signed-off-by: Natalia Luzuriaga <[email protected]>
  • Loading branch information
natalialuzuriaga committed Jan 8, 2025
1 parent c2b131d commit 3a8da32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/generateFormComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,13 @@ function createComponent(fieldName, fieldObject) {
}
}

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

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

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

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

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

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

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

Expand Down

0 comments on commit 3a8da32

Please sign in to comment.