-
Notifications
You must be signed in to change notification settings - Fork 395
Mixed support #2409
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
Open
kchobantonov
wants to merge
48
commits into
eclipsesource:master
Choose a base branch
from
kchobantonov:mixed-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Mixed support #2409
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
f8c2caf
initial mixed renderer support
kchobantonov c078710
organize imports
kchobantonov ece92ac
handle correctly the clear where if the property that is cleared in n…
kchobantonov bd28667
update controls to properly send clear value
kchobantonov a62efb4
update control to properly send clear value and add support for UI op…
kchobantonov 4bc6b73
optimize the performance of convertDayjsToMaskaFormat function
kchobantonov 4716a43
fix key property where the value is not based on data primary key but…
kchobantonov 807546f
organize imports
kchobantonov 25300db
add translations
kchobantonov 81c81db
make sure that we use new date so that the proxyModel is correctly no…
kchobantonov 3a4f2b9
no need to check props?.schema?.properties
kchobantonov 6b5dca8
proper implementation for the optional translator
kchobantonov 2f96aef
change the way how we determine if default value should be returned
kchobantonov cc44091
use control.arraySchema instead of Resolve
kchobantonov d460e6c
use control.arraySchema instead of Resolve, make the header to not ta…
kchobantonov 1f24b21
clean up class
kchobantonov d716953
use less space
kchobantonov 498cbf1
do not render the div if nothing to renders as children
kchobantonov 72e17d0
use more descriptive name
kchobantonov 89bfb0b
if we are in dynamic context then always prefer the VerticalLayout ov…
kchobantonov ef24610
if the schema is an object that is selected because of mixed type the…
kchobantonov 492e5fd
when the mixed renderer provides the exact schema to use then there i…
kchobantonov 434a1f9
add core schema meta-schema as example
kchobantonov 532fa9f
Merge branch 'master' into mixed-support
kchobantonov 22760af
resolve schema like 'items': true
kchobantonov 8a1b523
add jsonschema example
kchobantonov 1d51ee8
symplify how we determine that the object renderer should be used whe…
kchobantonov 770531a
items in draft7 can accept boolean
kchobantonov 6ead876
add generic json editor example
kchobantonov b7460ab
fix items.type
kchobantonov 27c11fe
add some space as title so opening and closing the expansion panel is…
kchobantonov 318950e
for now revert back the change to include the boolean since more code…
kchobantonov 3a6f240
fix the check because of the items type revert
kchobantonov e3c8b3c
use type array instead of true because of the items type revert
kchobantonov 40dc34f
remove unused imports
kchobantonov a7fa97b
Merge branch 'master' into mixed-support
kchobantonov 9111316
remove ?
kchobantonov 0a6047f
remove prop param
kchobantonov 1c146bd
Merge branch 'master' into mixed-support
kchobantonov fd7efb4
remove prop
kchobantonov 0e1577b
Merge branch 'master' into mixed-support
kchobantonov 6b863d9
Merge branch 'master' into mixed-support
sdirix ad8f056
remove changing the schema from true to mixed types and make the mixe…
kchobantonov d05642a
update mixed renderer and remove changes in the core to support it
kchobantonov 3d632b7
Merge branch 'master' into mixed-support
kchobantonov 82fb3be
expand the property name check when the additionalProperties is false…
kchobantonov 33e451c
Merge branch 'master' into mixed-support
kchobantonov 8f862d7
add additionalErrors into the event
kchobantonov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,50 @@ | ||
/* | ||
The MIT License | ||
|
||
Copyright (c) 2017-2019 EclipseSource Munich | ||
https://github.com/eclipsesource/jsonforms | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
*/ | ||
import { registerExamples } from '../register'; | ||
|
||
export const schema = { | ||
type: ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string'], | ||
additionalProperties: true, | ||
items: { | ||
type: ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string'], | ||
}, | ||
}; | ||
|
||
export const uischema = { | ||
type: 'Control', | ||
scope: '#/', | ||
}; | ||
|
||
const data = undefined as any; | ||
|
||
registerExamples([ | ||
{ | ||
name: 'json-editor', | ||
label: 'JSON Editor', | ||
data, | ||
schema, | ||
uischema, | ||
}, | ||
]); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the use case of this? Who hands over segments to resolve if the schema is just a boolean already anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is to resolve the case where the value of the last path segment is equals to true. For example items: true and you want to bind that items then you need to resolve the jsonschema which can be boolean but in the code we ignore that this can be ever the case.
Also the next check for isEmpty if we pass true/false values which are valid JSON schema will return an undefined when resolved instead of boolean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case is already handled via
If having a boolean
schema
breaks the checks before that, then we should fix those checks instead of hard coding the exception at the top.I guess the typing does not properly reflect that the
schema
could be a boolean. So we should adjust the typing and the checks to handle the typing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue was that if I was going to adjust the typing to allow true/false to be valid schema then there was a lot more changes to the code that just this one - so if the goal is go make the typing correct and the amount of changes to not be an issue then that is fine but I didn't wanted to change a lot of stuff in the core packages that was the reason to have that there