jxp 2.14.6 → 2.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libs/datamunging.js +97 -80
- package/libs/docs.js +66 -10
- package/libs/jxp.js +166 -68
- package/libs/schema_description.js +66 -19
- package/models/test_model.js +13 -12
- package/package.json +14 -14
- package/templates/model.pug +24 -5
- package/test/test.js +531 -440
package/templates/model.pug
CHANGED
|
@@ -36,21 +36,40 @@ block content
|
|
|
36
36
|
th Default
|
|
37
37
|
th Indexed?
|
|
38
38
|
th Unique?
|
|
39
|
+
th Required?
|
|
39
40
|
tbody
|
|
40
41
|
each fieldname in fields
|
|
41
|
-
- let field =
|
|
42
|
+
- let field = safeFields[fieldname]
|
|
42
43
|
if (field.path)
|
|
43
44
|
tr
|
|
44
45
|
td= field.path
|
|
45
|
-
td
|
|
46
|
+
td
|
|
47
|
+
if field.arrayType
|
|
48
|
+
| Array of #{field.arrayType}
|
|
49
|
+
else
|
|
50
|
+
= field.instance
|
|
46
51
|
td= field.options.link
|
|
47
52
|
td= field.options.map_to
|
|
48
53
|
td= field.defaultValue
|
|
49
54
|
td= (field.options.index) ? "x" : ""
|
|
50
55
|
td= (field.options.unique) ? "x" : ""
|
|
56
|
+
td= field.isRequired ? "x" : ""
|
|
51
57
|
hr
|
|
52
|
-
|
|
58
|
+
h2 Field Details
|
|
53
59
|
each fieldname in fields
|
|
54
|
-
- let field =
|
|
55
|
-
|
|
60
|
+
- let field = safeFields[fieldname]
|
|
61
|
+
if field
|
|
62
|
+
.field-details
|
|
63
|
+
h3= field.path
|
|
64
|
+
pre.pre= JSON.stringify(field, null, 2)
|
|
65
|
+
if field.schema
|
|
66
|
+
h4 Nested Schema
|
|
67
|
+
ul
|
|
68
|
+
each nestedField in field.schema
|
|
69
|
+
li #{nestedField.path}: #{nestedField.type}
|
|
70
|
+
if field.validators && field.validators.length
|
|
71
|
+
h4 Validators
|
|
72
|
+
ul
|
|
73
|
+
each validator in field.validators
|
|
74
|
+
li #{validator.type}: #{validator.message}
|
|
56
75
|
|