-
Notifications
You must be signed in to change notification settings - Fork 63
Add support for displayValueExpression #1126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ff09432
15c3bd8
fedd33b
33f994c
fccccf4
2b04dee
c669206
ae9d4f6
69c460c
c4f8496
1971b56
a88e8f1
eca3efd
3d7ae93
30376f8
745dffc
7c89e26
4ff5af4
7b704d5
6ecd66f
4cd0179
bba5c50
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,14 +125,14 @@ public static void testSchemaValidation(@NotNull Object model) { | |
| // create an instance of the JsonSchemaFactory using version flag | ||
| JsonSchemaFactory schemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7); | ||
| try { | ||
| InputStream schemaStream = Utils.class.getResourceAsStream("/schema/0.12.1/adaptive-form.schema.json"); | ||
| InputStream schemaStream = Utils.class.getResourceAsStream("/schema/0.12.5/adaptive-form.schema.json"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you change the default version of spec in container to 0.12.5 ? https://github.com/adobe/aem-core-forms-components/blob/master/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/FormContainer.java#L67
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this new property is added via expression editor, I believe expression editor would be persisting the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I'm raising the PR for that. |
||
| JsonSchema schema = schemaFactory.getSchema(schemaStream); | ||
| // read data from the stream and store it into JsonNode | ||
| JsonNode json = objectMapper.readTree(jsonStream); | ||
| // if there is a version bump of schema, then it needs to be validated against its corresponding sling model here | ||
| // by explicitly checking the model implementation | ||
| if (!(model instanceof FormContainerImpl)) { | ||
| InputStream formContainerTemplate = Utils.class.getResourceAsStream("/schema/0.12.0/form.json"); | ||
| InputStream formContainerTemplate = Utils.class.getResourceAsStream("/schema/0.12.5/form.json"); | ||
| JsonNode formContainerTemplateNode = objectMapper.readTree(formContainerTemplate); | ||
| ((ObjectNode) formContainerTemplateNode).putArray("items").add(json); | ||
| json = formContainerTemplateNode; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "id": "datepicker-c7fc29dc99", | ||
| "fieldType": "date-input", | ||
| "name": "abc", | ||
| "type": "string", | ||
| "displayValueExpression": "($field.$value & abc)", | ||
| "label": { | ||
| "value": "def" | ||
| }, | ||
| "events": { | ||
| "custom:setProperty": [ | ||
| "$event.payload" | ||
| ] | ||
| }, | ||
| "properties": { | ||
| "fd:dor": { | ||
| "dorExclusion": false | ||
| }, | ||
| "fd:path": "/content/datepicker-displayValueExpression" | ||
| }, | ||
| "format": "date", | ||
| ":type": "core/fd/components/form/datepicker/v1/datepicker" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "id": "numberinput-30f1c1a86c", | ||
| "fieldType": "number-input", | ||
| "name": "abc", | ||
| "type": "number", | ||
| "displayValueExpression": "($field.$value & abc)", | ||
| "label": { | ||
| "value": "def" | ||
| }, | ||
| "events": { | ||
| "custom:setProperty": [ | ||
| "$event.payload" | ||
| ] | ||
| }, | ||
| "properties": { | ||
| "fd:dor": { | ||
| "dorExclusion": false | ||
| }, | ||
| "fd:path": "/content/numberinput-displayvalueExpression" | ||
| }, | ||
| ":type": "core/fd/components/form/numberinput/v1/numberinput" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "id": "textinput-1247cf0c35", | ||
| "fieldType": "text-input", | ||
| "name": "abc", | ||
| "type": "string", | ||
| "displayValueExpression": "($field.$value & abc)", | ||
| "label": { | ||
| "value": "def" | ||
| }, | ||
| "events": { | ||
| "custom:setProperty": [ | ||
| "$event.payload" | ||
| ] | ||
| }, | ||
| "properties": { | ||
| "fd:dor": { | ||
| "dorExclusion": false | ||
| }, | ||
| "fd:path": "/content/textinput-displayValueExpression" | ||
| }, | ||
| ":type": "core/fd/components/form/textinput/v1/textinput" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "$id": "classpath:/schema/0.12.5/adaptive-form-aem-allowed-components.schema.json", | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "type": "object", | ||
| "title": "Allowed Components object for the current panel.", | ||
| "description": "This is applicable only if the panel's layout is grid system. This property is useful if needs to show list of allowed components in the client while authoring the panel.", | ||
| "properties": { | ||
| "components": { | ||
| "type": "array", | ||
| "title": "List of simple objects representing all Allowed Components for the given panel" | ||
| }, | ||
| "applicable": { | ||
| "type": "boolean", | ||
| "title": "Is the given panel contained by a page, with authored template structure and is the given panel set as editable (unlocked)", | ||
| "description": "true if the template has structure support and the panel is editable, false otherwise" | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.