-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: script component schema definition
Related to #1102
- Loading branch information
Showing
6 changed files
with
163 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,8 @@ | |
"taglist", | ||
"textfield", | ||
"textarea", | ||
"expression" | ||
"expression", | ||
"script" | ||
] | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
"separator", | ||
"table", | ||
"iframe", | ||
"expression" | ||
"expression", | ||
"script" | ||
] | ||
} |
43 changes: 43 additions & 0 deletions
43
packages/form-json-schema/test/fixtures/js-interval-no-interval.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
export const form = { | ||
type: 'default', | ||
'components': [ | ||
{ | ||
type: 'script', | ||
key: 'myField', | ||
jsFunction: 'return 42', | ||
functionParameters: '={\n value: 42\n}', | ||
computeOn: 'interval' | ||
} | ||
] | ||
}; | ||
|
||
export const errors = [ | ||
{ | ||
instancePath: '/components/0', | ||
keyword: 'required', | ||
message: "must have required property 'interval'", | ||
params: { | ||
missingProperty: 'interval' | ||
}, | ||
schemaPath: '#/properties/components/items/allOf/0/allOf/3/then/allOf/1/then/required' | ||
}, | ||
{ | ||
instancePath: '/components/0', | ||
keyword: 'if', | ||
message: 'must match "then" schema', | ||
params: { | ||
failingKeyword: 'then' | ||
}, | ||
schemaPath: '#/properties/components/items/allOf/0/allOf/3/then/allOf/1/if' | ||
}, | ||
{ | ||
instancePath: '/components/0', | ||
keyword: 'if', | ||
message: 'must match "then" schema', | ||
params: { | ||
failingKeyword: 'then' | ||
}, | ||
schemaPath: '#/properties/components/items/allOf/0/allOf/3/if' | ||
} | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
export const form = { | ||
type: 'default', | ||
'components': [ | ||
{ | ||
type: 'script', | ||
} | ||
] | ||
}; | ||
|
||
export const errors = [ | ||
{ | ||
instancePath: '/components/0', | ||
keyword: 'required', | ||
message: "must have required property 'key'", | ||
params: { | ||
missingProperty: 'key' | ||
}, | ||
schemaPath: '#/properties/components/items/allOf/0/allOf/0/then/required' | ||
}, | ||
{ | ||
instancePath: '/components/0', | ||
keyword: 'if', | ||
message: 'must match "then" schema', | ||
params: { | ||
failingKeyword: 'then' | ||
}, | ||
schemaPath: '#/properties/components/items/allOf/0/allOf/0/if' | ||
}, | ||
{ | ||
instancePath: '/components/0', | ||
keyword: 'required', | ||
message: "must have required property 'jsFunction'", | ||
params: { | ||
missingProperty: 'jsFunction' | ||
}, | ||
schemaPath: '#/properties/components/items/allOf/0/allOf/3/then/allOf/0/required' | ||
}, | ||
{ | ||
instancePath: '/components/0', | ||
keyword: 'required', | ||
message: "must have required property 'functionParameters'", | ||
params: { | ||
missingProperty: 'functionParameters' | ||
}, | ||
schemaPath: '#/properties/components/items/allOf/0/allOf/3/then/allOf/0/required' | ||
}, | ||
{ | ||
instancePath: '/components/0', | ||
keyword: 'required', | ||
message: "must have required property 'computeOn'", | ||
params: { | ||
missingProperty: 'computeOn' | ||
}, | ||
schemaPath: '#/properties/components/items/allOf/0/allOf/3/then/allOf/0/required' | ||
}, | ||
{ | ||
instancePath: '/components/0', | ||
keyword: 'if', | ||
message: 'must match "then" schema', | ||
params: { | ||
failingKeyword: 'then' | ||
}, | ||
schemaPath: '#/properties/components/items/allOf/0/allOf/3/if' | ||
} | ||
]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters