Skip to content
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

Add BeanReferenceField #470

Closed
igarashitm opened this issue Nov 30, 2023 · 2 comments · Fixed by #484 or #552
Closed

Add BeanReferenceField #470

igarashitm opened this issue Nov 30, 2023 · 2 comments · Fixed by #484 or #552
Assignees
Labels
canvas/config-form Configuration form related issues enhancement New feature or request
Milestone

Comments

@igarashitm
Copy link
Contributor

igarashitm commented Nov 30, 2023

Please describe the feature that you want to propose

cf. #245

Currently all the object type parameter is showing PropertiesField, for example DataSource parameter of SQL step looks like this
Screenshot from 2023-11-30 07-47-53

But the component catalog has "javaType": "javax.sql.DataSource", which indicates this is a specific type of Java object, and I believe in this case the parameter should have a reference to a bean with # prefix.

Introduce BeanReferenceField for step configuration form which allows both

  1. Choose from dropdown, where the dropdown shows existing beans
  2. "Add New" button right next to the dropdown, allows to add a new bean

For the parameters which

  1. is object type
  2. doesn't have enum
  3. has javaType other than java.lang.Object
    • to be investigated, maybe even the generic java.lang.Object parameter should be handled with BeanReferenceFiend instead of PropertiesField

We might be able to use format keyword in JSON schema to indicate to use BeanReferenceField from schema side.
https://json-schema.org/draft/2020-12/json-schema-validation#name-vocabularies-for-semantic-c
Unfortunately not. Uniforms throws an error if it cannot understand format (#505)
Instead we're currently using $comment for attaching additional metadata to the properties JSON schema.
Screenshot from 2023-12-01 14-31-29

@igarashitm igarashitm added the canvas/config-form Configuration form related issues label Nov 30, 2023
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 2, 2023
* Moved component-catalog > JSON schema generation to the maven plugin
* Fixed array/object related issues in component schema (KaotoIO#448)
* Added default value handling for component schema
* Added an exhaustive test for rendering component configuration form (KaotoIO#449)
* Added `$comment` to hold the catalog `javaType`, supposed to be used for BeanReferenceField (KaotoIO#470)
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 2, 2023
* Moved component-catalog > JSON schema generation to the maven plugin
* Fixed array/object related issues in component schema (KaotoIO#448)
* Added default value handling for component schema
* Added an exhaustive test for rendering component configuration form (KaotoIO#449)
* Added `$comment` to hold the catalog `javaType`, supposed to be used for BeanReferenceField (KaotoIO#470)
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 2, 2023
* Moved component-catalog > JSON schema generation to the maven plugin
* Fixed array/object related issues in component schema (KaotoIO#448)
* Added default value handling for component schema
* Added an exhaustive test for rendering component configuration form (KaotoIO#449)
* Added `$comment` to hold the catalog `javaType`, supposed to be used for BeanReferenceField (KaotoIO#470)
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 2, 2023
* Moved component-catalog > JSON schema generation to the maven plugin
* Fixed array/object related issues in component schema (KaotoIO#448)
* Added default value handling for component schema
* Added an exhaustive test for rendering component configuration form (KaotoIO#449)
* Added `$comment` to hold the catalog `javaType`, supposed to be used for BeanReferenceField (KaotoIO#470)
lordrip pushed a commit that referenced this issue Dec 4, 2023
* Moved component-catalog > JSON schema generation to the maven plugin
* Fixed array/object related issues in component schema (#448)
* Added default value handling for component schema
* Added an exhaustive test for rendering component configuration form (#449)
* Added `$comment` to hold the catalog `javaType`, supposed to be used for BeanReferenceField (#470)
@lordrip lordrip linked a pull request Dec 4, 2023 that will close this issue
@igarashitm igarashitm added the enhancement New feature or request label Dec 5, 2023
@lordrip lordrip added this to the 2.0.0 milestone Dec 5, 2023
@lordrip lordrip moved this from New to Todo in Kanban Board Dec 5, 2023
@lhein lhein moved this from Todo to In Progress in Kanban Board Dec 7, 2023
@igarashitm
Copy link
Contributor Author

igarashitm commented Dec 8, 2023

Typeahead with create option is the one for this case by connecting create new one event to the single bean editor modal.
https://www.patternfly.org/components/menus/select#typeahead-with-create-option

@lordrip lordrip moved this from In Progress to Todo in Kanban Board Dec 12, 2023
@igarashitm
Copy link
Contributor Author

igarashitm commented Dec 12, 2023

Mock up - plumbing is not completed yet, but showing the basic workflow

output.mp4

@igarashitm igarashitm moved this from Todo to In Progress in Kanban Board Dec 12, 2023
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 12, 2023
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 12, 2023
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 12, 2023
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 13, 2023
@igarashitm igarashitm moved this from In Progress to In Review in Kanban Board Dec 13, 2023
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 13, 2023
lordrip added a commit to lordrip/kaoto that referenced this issue Dec 13, 2023
`uniforms` connected fields require two things:
1. A componentDetectorContext provider
2. AutoForm parent which hold the schema

This commit adds both items to make the skipped test work

relates: KaotoIO#470
igarashitm pushed a commit to igarashitm/kaoto that referenced this issue Dec 13, 2023
`uniforms` connected fields require two things:
1. A componentDetectorContext provider
2. AutoForm parent which hold the schema

This commit adds both items to make the skipped test work

relates: KaotoIO#470
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 13, 2023
Otherwise it fails to add a bean if there's no existing `beans`
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 13, 2023
igarashitm pushed a commit to igarashitm/kaoto that referenced this issue Dec 13, 2023
`uniforms` connected fields require two things:
1. A componentDetectorContext provider
2. AutoForm parent which hold the schema

This commit adds both items to make the skipped test work

relates: KaotoIO#470
igarashitm added a commit to igarashitm/kaoto that referenced this issue Dec 13, 2023
Otherwise it fails to add a bean if there's no existing `beans`
lordrip pushed a commit that referenced this issue Dec 13, 2023
lordrip added a commit that referenced this issue Dec 13, 2023
`uniforms` connected fields require two things:
1. A componentDetectorContext provider
2. AutoForm parent which hold the schema

This commit adds both items to make the skipped test work

relates: #470
lordrip pushed a commit that referenced this issue Dec 13, 2023
Otherwise it fails to add a bean if there's no existing `beans`
@github-project-automation github-project-automation bot moved this from In Review to Done in Kanban Board Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
canvas/config-form Configuration form related issues enhancement New feature or request
Projects
Archived in project
2 participants