Skip to content

Commit 929f901

Browse files
Remove tooltips due to repetition
Signed-off-by: Natalia Luzuriaga <natalia.luzuriaga@cms.hhs.gov>
1 parent 44fa078 commit 929f901

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

js/generateFormComponents.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,14 @@ function determineType(field) {
5353

5454
// Creates Form.io component based on json field type
5555
function createComponent(fieldName, fieldObject) {
56-
var componentType = determineType(fieldObject);
56+
const componentType = determineType(fieldObject);
5757
switch (componentType) {
5858
case "textfield":
5959
return {
6060
type: "textfield",
6161
key: fieldName,
6262
label: fieldName,
6363
input: true,
64-
tooltip: fieldObject["description"],
6564
description: fieldObject["description"]
6665
};
6766
case "tags":
@@ -105,7 +104,6 @@ function createComponent(fieldName, fieldObject) {
105104
type: "radio",
106105
input: true,
107106
description: fieldObject["description"],
108-
tooltip: fieldObject["description"]
109107
};
110108
case "selectboxes":
111109
var options = transformArrayToOptions(fieldObject.items.enum);
@@ -224,14 +222,14 @@ function createAllComponents(schema, prefix = ""){
224222

225223
if (schema.type === "object" && schema.properties) {
226224

227-
let items = schema.properties.hasOwnProperty("items") ? schema.properties.items : schema.properties
225+
const items = schema.properties.hasOwnProperty("items") ? schema.properties.items : schema.properties
228226

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

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

234-
var fieldComponent = createComponent(key, value);
232+
let fieldComponent = createComponent(key, value);
235233

236234
if (fieldComponent.type === "container") {
237235
fieldComponent.components = createAllComponents(value, fullKey);
@@ -252,7 +250,7 @@ async function createFormComponents() {
252250
let components = [];
253251

254252
const filePath = "schemas/schema-0.0.0.json";
255-
let jsonData = await retrieveFile(filePath);
253+
const jsonData = await retrieveFile(filePath);
256254
console.log("JSON Data:", jsonData);
257255

258256
createFormHeading(jsonData["title"], jsonData["description"]);

0 commit comments

Comments
 (0)