jbockle / au-jsonschema-form

Create functional UI forms using json schema
https://aujsf.jbockle.dev
MIT License
8 stars 0 forks source link

Feature ideas/use cases #2

Open zewa666 opened 4 years ago

zewa666 commented 4 years ago

It's awesome to see others have the same idea and even go the way to create a plugin. Kudos for that @jbockle. With Ranorex Webtestit we're building an IDE which hosts the Monaco Editor. That has the ability to show intellisense based on a given json schema. One of those schemas we use e.g for our settings file, which can be manipulated both in the editor but also in a dynamically built settings dialog. We've flavoured the schema with additional property like a category which then is used for the navigation sidebar to group co-located settings or conditionals so that e.g typescript specific settings aren't shown if your projects language is python.

So I thought I'd list a few use case ideas which might be of interest for your project to keep in mind.

custom: [{
  model: {
    data: ...,
    stuff: ...
    foobar: ...
  },
  position: {
    anchor: "NAME/ID OF A PREVIOUS",
    insertBefore: false // if true it append after the anchor
  },
  viewModel: "name of viewModel of the custom component"
}],
jbockle commented 4 years ago

hey @zewa666, thanks!

zewa666 commented 4 years ago

hey there, yep you're right with optional, I just see with used that one for a totally different use case. With regards to category what I meant there is that imagine your form consists of 2 or more sections which group inputs together. E.g in a feedback form a section could be about the feedback itself another one about personal details and a third one about notifications, where each of the sections contains a few form elements. Having the group, would help to render the form differently, e.g add a header on top of every section.

EDIT: here's a screenshot of what I meant. Essentially all these sections on the left side are powered by one json schema and the right sections shows the individual elements of each group image

jbockle commented 4 years ago

Ahh I see-I currently support this with a named 'ui:viewSlot' ui schema option. It essentially wraps the json schema element in another component similar to how you would expect <slot>'s work, however due to aurelia <slot> limitations, I'm fulfilling this using an InlineViewStrategy to build out the template. I like the complexity shown in your screenshot, I'm going to try to mimic that into my dev-app for a better example until I'm ready to dive into documentation.