Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 9bad7f3

Browse files
committed
[Form Builder] Linted code
1 parent fc60794 commit 9bad7f3

File tree

78 files changed

+1328
-967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1328
-967
lines changed

examples/form_composer_demo/data/dynamic/form_config.json

Lines changed: 99 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"title": "Form example",
44
"instruction": "Please answer <b>all</b> questions to the best of your ability as part of our study.",
55
"sections": [
6-
{
6+
{
77
"name": "section_about",
88
"title": "About you",
99
"instruction": "<p>Please introduce yourself. We would like to know more about your:</p><ul><li>Background</li><li>Personal information</li><li>Etc</li></ul>",
1010
"collapsable": false,
1111
"fieldsets": [
12-
{
12+
{
1313
"title": "Personal information",
1414
"instruction": "",
1515
"rows": [
16-
{
16+
{
1717
"fields": [
18-
{
18+
{
1919
"help": "",
2020
"id": "id_name_first",
2121
"label": "First name",
@@ -24,13 +24,13 @@
2424
"tooltip": "Your first name",
2525
"type": "input",
2626
"validators": {
27-
"required": true,
28-
"minLength": 2,
29-
"maxLength": 20
27+
"required": true,
28+
"minLength": 2,
29+
"maxLength": 20
3030
},
3131
"value": ""
32-
},
33-
{
32+
},
33+
{
3434
"help": "",
3535
"id": "id_name_last",
3636
"label": "Last name",
@@ -39,14 +39,14 @@
3939
"tooltip": "Your last name",
4040
"type": "input",
4141
"validators": {
42-
"required": true
42+
"required": true
4343
},
4444
"value": ""
45-
}
45+
}
4646
],
4747
"help": "Please use your legal name"
48-
},
49-
{
48+
},
49+
{
5050
"fields": [
5151
{
5252
"help": "We may contact you later at your {{company_name}} email for additional information",
@@ -57,98 +57,95 @@
5757
"tooltip": "Email address for {{company_name}}",
5858
"type": "email",
5959
"validators": {
60-
"required": true,
61-
"regexp": [
62-
"^[a-zA-Z0-9._-]+@mephisto\\.ai$",
63-
"ig"
64-
]
60+
"required": true,
61+
"regexp": ["^[a-zA-Z0-9._-]+@mephisto\\.ai$", "ig"]
6562
},
6663
"value": ""
67-
}
64+
}
6865
]
69-
}
66+
}
7067
]
71-
},
72-
{
68+
},
69+
{
7370
"title": "Cultural background",
7471
"instruction": "Please tell us about your cultural affiliations and values that you use in your daily life.",
7572
"rows": [
76-
{
73+
{
7774
"fields": [
78-
{
75+
{
7976
"help": "Select country of your residence",
8077
"id": "id_country",
8178
"label": "Country",
8279
"multiple": false,
8380
"name": "country",
8481
"options": [
85-
{
82+
{
8683
"label": "---",
8784
"value": ""
88-
},
89-
{
85+
},
86+
{
9087
"label": "United States of America",
9188
"value": "USA"
92-
},
93-
{
89+
},
90+
{
9491
"label": "Canada",
9592
"value": "CAN"
96-
}
93+
}
9794
],
9895
"placeholder": "",
9996
"tooltip": "Country",
10097
"type": "select",
10198
"validators": {
102-
"required": true
99+
"required": true
103100
},
104101
"value": ""
105-
},
106-
{
102+
},
103+
{
107104
"help": "Select language spoken in your local community",
108105
"id": "id_language",
109106
"label": "Language",
110107
"multiple": true,
111108
"name": "language",
112109
"options": [
113-
{
110+
{
114111
"label": "English",
115112
"value": "en"
116-
},
117-
{
113+
},
114+
{
118115
"label": "French",
119116
"value": "fr"
120-
},
121-
{
117+
},
118+
{
122119
"label": "Spanish",
123120
"value": "es"
124-
},
125-
{
121+
},
122+
{
126123
"label": "Chinese",
127124
"value": "ch"
128-
}
125+
}
129126
],
130127
"placeholder": "",
131128
"tooltip": "Language",
132129
"type": "select",
133130
"validators": {
134-
"required": true,
135-
"minLength": 2,
136-
"maxLength": 3
131+
"required": true,
132+
"minLength": 2,
133+
"maxLength": 3
137134
},
138135
"value": ""
139-
}
136+
}
140137
]
141-
}
138+
}
142139
],
143140
"help": "This information will help us compile study statistics"
144-
},
145-
{
141+
},
142+
{
146143
"title": "Additional information",
147144
"instruction": "Optional details about you. You can fill out what you are most comfortable with.",
148145
"rows": [
149-
{
146+
{
150147
"fields": [
151-
{
148+
{
152149
"help": "",
153150
"id": "id_bio",
154151
"label": "Biography since age of {{ since_age }}",
@@ -157,89 +154,89 @@
157154
"tooltip": "Your bio in a few paragraphs",
158155
"type": "textarea",
159156
"validators": {
160-
"required": false
157+
"required": false
161158
},
162159
"value": ""
163-
}
160+
}
164161
]
165-
},
166-
{
162+
},
163+
{
167164
"fields": [
168-
{
165+
{
169166
"help": "",
170167
"id": "id_skills",
171168
"label": "Technical Skills",
172169
"name": "skills",
173170
"options": [
174-
{
171+
{
175172
"checked": false,
176173
"label": "React",
177174
"value": "react"
178-
},
179-
{
175+
},
176+
{
180177
"checked": true,
181178
"label": "JavaScript",
182179
"value": "javascript"
183-
},
184-
{
180+
},
181+
{
185182
"checked": false,
186183
"label": "Python",
187184
"value": "python"
188-
},
189-
{
185+
},
186+
{
190187
"checked": false,
191188
"label": "SQL",
192189
"value": "sql"
193-
}
190+
}
194191
],
195192
"tooltip": "Technical skills you may possess",
196193
"type": "checkbox",
197194
"validators": {
198-
"required": true,
199-
"minLength": 2,
200-
"maxLength": 3
195+
"required": true,
196+
"minLength": 2,
197+
"maxLength": 3
201198
}
202-
}
199+
}
203200
]
204-
},
205-
{
201+
},
202+
{
206203
"fields": [
207-
{
204+
{
208205
"help": "",
209206
"id": "id_kids",
210207
"label": "How many children do you have?",
211208
"name": "kids",
212209
"options": [
213-
{
210+
{
214211
"checked": false,
215212
"label": "None",
216213
"value": "0"
217-
},
218-
{
214+
},
215+
{
219216
"checked": false,
220217
"label": "One",
221218
"value": "1"
222-
},
223-
{
219+
},
220+
{
224221
"checked": false,
225222
"label": "Two",
226223
"value": "2"
227-
},
228-
{
224+
},
225+
{
229226
"checked": false,
230227
"label": "Three or more",
231228
"value": ">=3"
232-
}
229+
}
233230
],
234231
"tooltip": "How many children do you have?",
235232
"type": "radio",
236233
"validators": {
237-
"required": true
234+
"required": true
238235
}
239-
}
236+
}
240237
]
241-
},
242-
{
238+
},
239+
{
243240
"fields": [
244241
{
245242
"help": "We only accept files in PNG, JPG, and JPEG formats.",
@@ -249,10 +246,13 @@
249246
"placeholder": "Select a file",
250247
"tooltip": "Your profile photo",
251248
"type": "file",
252-
"validators": {"required": true, "fileExtension": ["png", "jpg", "jpeg"]},
249+
"validators": {
250+
"required": true,
251+
"fileExtension": ["png", "jpg", "jpeg"]
252+
},
253253
"value": ""
254-
},
255-
{
254+
},
255+
{
256256
"help": "",
257257
"id": "id_resume",
258258
"label": "Resume",
@@ -261,46 +261,46 @@
261261
"tooltip": "Your current resume",
262262
"type": "file",
263263
"validators": {
264-
"required": false
264+
"required": false
265265
},
266266
"value": ""
267-
}
267+
}
268268
]
269-
}
269+
}
270270
],
271271
"help": "Some additional details about your persona"
272-
}
272+
}
273273
]
274-
},
275-
{
274+
},
275+
{
276276
"name": "section_second",
277277
"title": "Second section",
278278
"instruction": "Example of another section",
279279
"initially_collapsed": true,
280280
"fieldsets": [
281-
{
281+
{
282282
"title": "Motivation",
283283
"instruction": "",
284284
"rows": [
285-
{
285+
{
286286
"fields": [
287-
{
287+
{
288288
"id": "id_motto",
289289
"label": "Personal Motto",
290290
"name": "motto",
291291
"tooltip": "Your personal motto",
292292
"type": "input",
293293
"validators": {
294-
"required": true
294+
"required": true
295295
}
296-
}
296+
}
297297
],
298298
"help": "Please type in your favorite personal motto"
299-
}
299+
}
300300
]
301-
}
301+
}
302302
]
303-
}
303+
}
304304
],
305305
"submit_button": {
306306
"instruction": "<i>Please double-check if everything has been filled in correctly.</i>",

0 commit comments

Comments
 (0)