File tree 3 files changed +93
-4
lines changed 3 files changed +93
-4
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "env" : {
3
+ "browser" : true ,
4
+ "node" : true
5
+ },
6
+ "parserOptions" : {
7
+ "ecmaVersion" : 6 ,
8
+ "sourceType" : " module"
9
+ },
10
+ "extends" : " google" ,
11
+ "rules" : {
12
+ "array-bracket-spacing" : [
13
+ 2 ,
14
+ " always" ,
15
+ {
16
+ "objectsInArrays" : false ,
17
+ "arraysInArrays" : false
18
+ }
19
+ ],
20
+ "object-curly-spacing" : [
21
+ 2 ,
22
+ " always" ,
23
+ {
24
+ "objectsInObjects" : false ,
25
+ "arraysInObjects" : false
26
+ }
27
+ ],
28
+ "brace-style" : [
29
+ 2 ,
30
+ " stroustrup" ,
31
+ {
32
+ "allowSingleLine" : true
33
+ }
34
+ ],
35
+ "max-len" : [
36
+ 2 ,
37
+ 120 ,
38
+ { "ignoreStrings" : true }
39
+ ],
40
+ "semi" : [
41
+ 2 ,
42
+ " always"
43
+ ],
44
+ "linebreak-style" : " off" ,
45
+ "space-before-function-paren" : " off" ,
46
+ "valid-jsdoc" : " off" ,
47
+ "no-invalid-this" : " off"
48
+ }
49
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " json-schema-form-core" ,
3
- "version" : " 1.0.0-alpha.4 " ,
3
+ "version" : " 1.0.0-alpha.5 " ,
4
4
"description" : " JSON-Schema and JSON-UI-Schema utilities for form generation." ,
5
5
"main" : " dist/json-schema-form-core.js" ,
6
6
"scripts" : {
53
53
"babel-preset-stage-0" : " ^6.22.0" ,
54
54
"babel-register" : " ^6.18.0" ,
55
55
"chai" : " ^3.5.0" ,
56
+ "eslint" : " ^3.19.0" ,
57
+ "eslint-config-google" : " ^0.7.1" ,
56
58
"json-refs" : " ^2.1.6" ,
57
59
"karma" : " ^1.3.0" ,
58
60
"karma-babel-preprocessor" : " ^6.0.1" ,
Original file line number Diff line number Diff line change @@ -161,17 +161,55 @@ describe('merge.js', () => {
161
161
162
162
var merged = merge ( subschema , [ { key : 'sub' , readonly : true } ] ) ;
163
163
164
- //sub
164
+ // sub
165
165
merged [ 0 ] . should . have . property ( 'readonly' ) ;
166
166
merged [ 0 ] . readonly . should . eq ( true ) ;
167
167
168
- //array
168
+ // array
169
169
merged [ 0 ] . items [ 0 ] . should . have . property ( 'readonly' ) ;
170
170
merged [ 0 ] . items [ 0 ] . readonly . should . eq ( true ) ;
171
171
172
- //array items
172
+ // array items
173
173
merged [ 0 ] . items [ 0 ] . items [ 0 ] . should . have . property ( 'readonly' ) ;
174
174
merged [ 0 ] . items [ 0 ] . items [ 0 ] . readonly . should . eq ( true ) ;
175
175
} ) ;
176
+
177
+ it ( 'should add x-schema-form properties' , ( ) => {
178
+ let subschema = {
179
+ "type" : "object" ,
180
+ "properties" : {
181
+ "comment" : {
182
+ "type" : "string" ,
183
+ "title" : "Comment" ,
184
+ "x-schema-form" : {
185
+ "type" : "textarea" ,
186
+ "placeholder" : "Don't hold back"
187
+ }
188
+ }
189
+ }
190
+ } ;
191
+
192
+ var merged = merge ( subschema , [ '*' ] ) ;
193
+
194
+ merged . should . deep . eq (
195
+ [
196
+ {
197
+ "title" : "Comment" ,
198
+ "schema" : {
199
+ "type" : "string" ,
200
+ "title" :"Comment" ,
201
+ "x-schema-form" : {
202
+ "type" : "textarea" ,
203
+ "placeholder" : "Don't hold back"
204
+ }
205
+ } ,
206
+ "ngModelOptions" : { } ,
207
+ "key" : [ "comment" ] ,
208
+ "type" : "textarea" ,
209
+ "placeholder" : "Don't hold back"
210
+ }
211
+ ]
212
+ )
213
+ } ) ;
176
214
} ) ;
177
215
} ) ;
You can’t perform that action at this time.
0 commit comments