Skip to content

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
wants to merge 54 commits into
base: master
Choose a base branch
from
Open

Conversation

kchobantonov
Copy link
Contributor

@kchobantonov kchobantonov commented Dec 30, 2024

  1. provide support for mixed types
  2. fix clearing of inputs when not under an object - e.g. string once cleared will become empty string rather than to return undefined to remove the property from the parent object
  3. fix date controls, now the date can show year, year/month and etc. depending on the control option views
  4. improve the performance to convert dayjs format into maska format function
  5. fixing the :key to at least have the collection size into the key so when the size changes the vue will not reuse html elements leaving attributes like id unchanged
  6. add more examples to show how the mixed control can be used
  7. use arraySchema from the mapped values rather than using Resolve
  8. minor UI changes to use less space
  9. core changes : use the provided schema when the resolve failed, make sure that boolean is valid schema as well - e.g. items: true is valid schema (Note: the last change for the items to be boolean was reverted back since more code should be adjusted - maybe a future improvement)
  10. introduce a new config - allowAdditionalPropertiesIfMissing - this allows to show the additioanalProperties UI when the additionalProperties and patternProperties do not exist. The reason is that by default if the additionalProperties is missing from the schema the default should be considered as true but the UI component does not respect that default - e.g. it needs to be explicitly states as additionalProperties: true if the UI control is needed without the allowAdditionalPropertiesIfMissing config

…ot part of the object that has the property defined in properties then to not clear it - e.g. send undefined value
… based on index - e.g. prevent reusing elements when the array change size which will cause id properties for example to not have correct value
…n also allow such case to be handled by the object renderer
…s no need to resolve that schema just use it

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@kchobantonov
Copy link
Contributor Author

@sdirix check my responses and also updated repo but it looks like the build failed perhaps because netlify is using greater than pnpm version 8 now ?

kchobantonov and others added 3 commits February 13, 2025 18:44

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have concerns about the proposed changes to the core functionality.

Please have a look at my new comments and the unresolved comments from my previous review.

…d renderer handle the true value directly
@kchobantonov kchobantonov requested a review from sdirix May 8, 2025 10:04
@kchobantonov
Copy link
Contributor Author

kchobantonov commented May 8, 2025

@sdirix please review again - here are the outstanding items that I need to check with you if you are ok with those as they are at the moment with the explanation that was provided.

  1. change in the packages/core/src/util/resolvers.ts - I have added the reason why is that but I haven't yet resolved the conversation
  2. the changes to the :key to include the size of the layout items is still there at least until there is some support from the core to know when the uischema is changes to use the proper key that will work on all changes to the layout data - e.g. reordering and etc.
  3. the issue where when we want to clear an input that is part of the additionalProperties (e.g. dynamic) and the type is an enum that we use an empty string as a reset value - not sure at the moment how to handle that one with a valid enum value since clearing does not necessary means to select any of the valid values from the supported enum set. Before that this change was not needed but then we were having an issue when we wanted to set the JSON as a data and that to be reflected by the UI - e.g. removing a dynamic field from the JSON and applying that to the form was not having an effect - that is why this change with what to set the value when the control clears the value was needed

kchobantonov and others added 4 commits May 8, 2025 14:13
… and we have patternProprties

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works good for me!

I'm waiting on Lucas' (or your) input to this suggestion and the handling of the additionalErrors. When they are resolved I'm happy to merge.

Thanks for your great work and patience ;)

Nitpick: the "Mixed" and "Json Editor" examples in the Vue Vuetify app do not render as nicely as the other examples. Does not need to be resolved for the merge.

@sdirix
Copy link
Member

sdirix commented May 21, 2025

@kchobantonov Please adapt the resolver as suggested and the additionalErrors, then we can merge

@kchobantonov
Copy link
Contributor Author

@sdirix both changes that were request are now done - please review again and let me know if anything else is needed. Thanks for your feedback.

kchobantonov and others added 2 commits May 22, 2025 09:08

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Stefan Dirix <sdirix@eclipsesource.com>
@kchobantonov kchobantonov requested a review from sdirix May 22, 2025 13:10
@kchobantonov
Copy link
Contributor Author

@sdirix please review again - all concerns should be addresses and the last commit is fixing an issue where in the jsonschema example when you try to add new example field as an object and you do enable from the "Allow Additional Properties By Default" option then to correctly determine the type of the new properties that are going to be added to this new object example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants