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

Fix @kogito-apps/form-displayer issues displaying HTML forms #525

Closed
pefernan opened this issue Aug 30, 2023 · 0 comments · Fixed by apache/incubator-kie-kogito-apps#1875
Assignees
Labels
area:form-generation-tool area:tools Issues affecting Apache KIE tooling projects type:bug Something is behaving unexpectedly

Comments

@pefernan
Copy link

pefernan commented Aug 30, 2023

The @kogito-apps/form-displayer React component is the component in charge of displaying the custom forms generated by the form-generation-tool. This component is embedded by other components like @kogito-apps/task-form & @kogito-apps/form-details.

A part of #524, the component seems to be unable to display HTML forms. When trying to display the form the following errors appear:

Error: html prop cant't be null at http://localhost:8080/q/dev/org.kie.kogito.runtime-tools-quarkus-extension/resources/form-displayer.js:2:9045414 at Op (http://localhost:8080/q/dev/org.kie.kogito.runtime-tools-quarkus-extension/resources/form-displayer.js:2:9207151) at t.unstable_runWithPriority (http://localhost:8080/q/dev/org.kie.kogito.runtime-tools-quarkus-extension/resources/form-displayer.js:2:9314638)...

Steps to reproduce (for form-details):

  1. Generate bootstrap forms using form-generation-tool for any BPM Quarkus project in kogito-examples (for example process-usertasks-quarkus-with-console)
  2. In the project pom.xml add a dependency to the runtime-tools-quarkus-extension
  3. Start the Kogito project in dev mode (mvn clean quarkus:dev)
  4. Open the Dev ui (http://locahost:8080/q/dev) and click on the Forms link inside the Runtime Tools Quarkus Extension
  5. Once in the forms list, click in any form and you'll be brought to the form-details view, on the left side you'll see a monaco-editor and on the right side the form visualization will show up displaying the Error displaying form: error.

Acceptance criteria

  1. Once fix is done, check the issue reported here is gone https://github.com/kiegroup/kie-tools/pull/1935#discussion_r1310028203
@pefernan pefernan added type:bug Something is behaving unexpectedly area:tools Issues affecting Apache KIE tooling projects area:bpmn Related to BPMN labels Aug 30, 2023
@yesamer yesamer added area:form-generation-tool and removed area:bpmn Related to BPMN labels Sep 1, 2023
@jomarko jomarko self-assigned this Sep 6, 2023
jomarko added a commit to jomarko/kogito-apps that referenced this issue Sep 7, 2023
Closes: apache/incubator-kie-issues#525

The issue is related to the `FormDisplayer` component and its initialization.

Lets have a look firstly into `FormDsiplayer`. There we will find this code, for `html` forms.
```
<HtmlFormRenderer source={source} resources={resources} />
```

In the render logic, we can not execute ^ sooner than `source` is set, otherwise error will be thrown. Thus adding lgical check for `source` to be defined.
jomarko added a commit to jomarko/kogito-apps that referenced this issue Sep 8, 2023
Closes: apache/incubator-kie-issues#525

The issue is related to the `FormDisplayer` component and its initialization.

Lets have a look firstly into `FormDsiplayer`. There we will find this code, for `html` forms.
```
<HtmlFormRenderer source={source} resources={resources} />
```

In the render logic, we can not execute ^ sooner than `source` is set, otherwise error will be thrown. Thus adding lgical check for `source` to be defined.
jomarko added a commit to jomarko/kogito-apps that referenced this issue Sep 11, 2023
Closes: apache/incubator-kie-issues#525

The issue is related to the `FormDisplayer` component and its initialization.

Lets have a look firstly into `FormDsiplayer`. There we will find this code, for `html` forms.
```
<HtmlFormRenderer source={source} resources={resources} />
```

In the render logic, we can not execute ^ sooner than `source` is set, otherwise error will be thrown. Thus adding lgical check for `source` to be defined.
paulovmr pushed a commit to apache/incubator-kie-kogito-apps that referenced this issue Sep 12, 2023
… forms (#1875)

* kie-issues#525

Closes: apache/incubator-kie-issues#525

The issue is related to the `FormDisplayer` component and its initialization.

Lets have a look firstly into `FormDsiplayer`. There we will find this code, for `html` forms.
```
<HtmlFormRenderer source={source} resources={resources} />
```

In the render logic, we can not execute ^ sooner than `source` is set, otherwise error will be thrown. Thus adding lgical check for `source` to be defined.

* Wrap complex boolean decision into single method

* Update ui-packages/packages/form-displayer/src/envelope/components/FormDisplayer/FormDisplayer.tsx

Co-authored-by: Pere Fernández <pefernan@users.noreply.github.com>

---------

Co-authored-by: Pere Fernández <pefernan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:form-generation-tool area:tools Issues affecting Apache KIE tooling projects type:bug Something is behaving unexpectedly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants