-
Notifications
You must be signed in to change notification settings - Fork 201
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
NO-ISSUE: add form-generation-tool README.md #1935
Conversation
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.
Thank you @pefernan
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.
Thank you for this readme, very helpful.
Question to issues I spot, maybe they are already reported as one of bellow?
- Fix @kogito-apps/form-details: The embedded monaco-editor doesn't show the proper syntax highlighting incubator-kie-issues#527
- Fix @kogito-apps/process-form: doesn't display custom forms. incubator-kie-issues#526
- Fix @kogito-apps/form-displayer issues displaying HTML forms incubator-kie-issues#525
- Fix @kogito-apps/form-displayer issues when establishing the envelope connection incubator-kie-issues#524
|
||
There are two types of form supported with differnt styling and output format: | ||
|
||
- **Patternfly**: generates a React (`.tsx`) forms using Patternfly 4 components. Implementation can be found in `@kie-tools/uniforms-patternfly-codegen` |
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.
I was not able to use patternfly for the basic process-quarkus-example is that expected, known issues or new issue?
log
Project path: /home/jomarko/github/kogito-examples/kogito-quarkus-examples/process-quarkus-example
Form type: patternfly
? Do you want to continue? Yes
Starting Form generation:
Found 5 schemas
Generating form "demo#orderItems"
Cannot generate form "demo#orderItems": ',' expected. (3:17)
1 | import React, { useCallback, useEffect, useState } from "react";
2 | import { TextInput, FormGroup, Card, CardBody, Checkbox } from "@patternfly/react-core";
> 3 | const Form__demo#orderItems: React.FC<any> = ( props:any ) => {
| ^
4 | const [formApi, setFormApi] = useState<any>();
5 | const [ item, set__item ] = useState<string>("");
6 | const [ order__orderNumber, set__order__orderNumber ] = useState<string>("");
Generating form "demo#orderItems_Verify_order"
Cannot generate form "demo#orderItems_Verify_order": ',' expected. (3:17)
1 | import React, { useCallback, useEffect, useState } from "react";
2 | import { Card, CardBody, TextInput, FormGroup, Checkbox } from "@patternfly/react-core";
> 3 | const Form__demo#orderItems_Verify_order: React.FC<any> = ( props:any ) => {
| ^
4 | const [formApi, setFormApi] = useState<any>();
5 | const [ input1__orderNumber, set__input1__orderNumber ] = useState<string>("");
6 | const [ input1__shipped, set__input1__shipped ] = useState<boolean>(false);
Generating form "demo#orders"
Cannot generate form "demo#orders": ',' expected. (3:17)
1 | import React, { useCallback, useEffect, useState } from "react";
2 | import { TextInput, FormGroup, Card, CardBody, Checkbox } from "@patternfly/react-core";
> 3 | const Form__demo#orders: React.FC<any> = ( props:any ) => {
| ^
4 | const [formApi, setFormApi] = useState<any>();
5 | const [ approver, set__approver ] = useState<string>("");
6 | const [ order__orderNumber, set__order__orderNumber ] = useState<string>("");
Generating form "persons"
Successfully generated form "persons.tsx"
Generating form "persons_ChildrenHandling"
Successfully generated form "persons_ChildrenHandling.tsx"
Good bye!
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.
@jomarko ok, I think this is a new issue. Looks like the problem is because some processes in the example have an id like demo.order
and that generates a schema file with a name like demo#orders.json
... the tool uses the schema file name as a formId
when building the react forms, probably sanityze the id to avoid that issue (at least to generate the form code)
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.
@pefernan please report a separate issue, or let me know I should do it, then I can approve this PR.
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.
|
||
![List of generated forms in project](./docs/form-generation-5.png) | ||
|
||
## Using the Custom Forms with Runtime Tools Quarkus Extension |
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.
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.
@jomarko this one is related to apache/incubator-kie-issues#525
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.
Thank you
Adding missing README.md