Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2026-02-23 Thread via GitHub


domhanak merged PR #3367:
URL: https://github.com/apache/incubator-kie-tools/pull/3367


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2026-02-11 Thread via GitHub


fantonangeli commented on PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#issuecomment-3883396968

   @domhanak I just realized last night I forgot to attach the patch and now I 
recreated it
   
[swf-greeting-examples-on-4000.patch](https://github.com/user-attachments/files/25230777/swf-greeting-examples-on-4000.patch)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2026-02-10 Thread via GitHub


fantonangeli commented on PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#issuecomment-3881048117

   @domhanak  I created a patch to run the Greeting Example with OpenAPI and 
GraphQL on 4000 port, but there are bugs with the UI, not related to this PR.
   I guess there have been changes which I was not aware of. 
   
   Anyway, I created a Quarkus app, containing the `BoolField` WF used to test 
this PR. Please note it is based on versions `10.1.0`:
   https://github.com/fantonangeli/sonataflow-testing-deployment


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2026-01-29 Thread via GitHub


fantonangeli commented on PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#issuecomment-3820742659

   I don't what changed @domhanak , I tried a lot with some examples from 
kogito-examples, but the properties below seem totally ignored:
   ```
   quarkus.http.port=4000
   kogito.data-index.url=http://localhost:4000
   ```
   The SonataFlow Dev App requires the DI to be on port 4000. The real app will 
use the same port where it is served as it contacts the graphql with a relative 
link.
   If you want to test with the simple mocked data, which I created, you can 
just run: `pnpm start` and nothing more.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2026-01-29 Thread via GitHub


domhanak commented on PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#issuecomment-3818202973

   @kumaradityaraj @fantonangeli Could we please add a test for this?
   
   I am unable to build the environment and validate the error using the `How 
to test` steps, so will try again in fresh workspace tomorrow.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2026-01-16 Thread via GitHub


fantonangeli commented on PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#issuecomment-3759332305

   @kumaradityaraj can you please sync this branch?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2026-01-07 Thread via GitHub


fantonangeli commented on PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#issuecomment-3717831218

   Hi @kumaradityaraj, because the last commit here is from 9th December, can 
you please sync this branch, so the macos CIs will also run?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2025-12-09 Thread via GitHub


fantonangeli commented on code in PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#discussion_r2602064442


##
packages/uniforms-patternfly/tests/BoolField.test.tsx:
##
@@ -77,6 +77,17 @@ test(" - renders a input with correct value 
(default)", () => {
   expect(screen.getByTestId("bool-field")).not.toHaveAttribute("checked");
 });
 
+test(" - renders an input with correct value (default true)", () => 
{
+  render(
+usingUniformsContext(, {
+  x: { type: Boolean, defaultValue: true },
+})
+  );

Review Comment:
   If this test is similar to line 92, can you please remove it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2025-12-09 Thread via GitHub


fantonangeli commented on code in PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#discussion_r2602006480


##
packages/uniforms-patternfly/tests/BoolField.test.tsx:
##


Review Comment:
   @kumaradityaraj  We only need to clean this file,  then this PR is ready



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2025-12-05 Thread via GitHub


fantonangeli commented on code in PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#discussion_r2593425517


##
packages/runtime-tools-components/src/utils/ModelConversionTool.ts:
##
@@ -84,6 +104,7 @@ function convertModel(model: any, schema: Record, ctx: ConversionCo
 
   Object.keys(model).forEach((propertyName) => {
 const property = schema.properties[propertyName];
+const propSchema = 
lookupSchemaPropertyProps(schema.properties[propertyName], ctx);

Review Comment:
   This seems not to be used



##
packages/runtime-tools-components/src/utils/ModelConversionTool.ts:
##
@@ -25,6 +25,26 @@ export class ModelConversionTool {
   public static convertStringToDate = (model: any, schema: Record): any => {
 return doConvert(model, schema, (value) => new Date(value));
   };
+
+  public static applySchemaDefaults(model: any, schema: Record): 
any {
+const newModel = { ...model };
+if (schema.properties) {
+  Object.keys(schema.properties).forEach((key) => {
+const prop = schema.properties[key];
+if (newModel[key] !== undefined) {
+  return;
+}
+if (prop.default !== undefined) {
+  newModel[key] = prop.default;
+  return;
+}
+if (prop.type === "boolean") {
+  newModel[key] = false;
+}

Review Comment:
   ```suggestion
   if (prop.type === "boolean" && newModel[key] === undefined) {
 newModel[key] = prop.default ?? false;
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [PR] kie-tools#3316: [sonataflow-deployment-webapp] generated inputs are sent only if are touched [incubator-kie-tools]

2025-12-04 Thread via GitHub


fantonangeli commented on code in PR #3367:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3367#discussion_r2588798614


##
packages/runtime-tools-components/src/utils/ModelConversionTool.ts:
##
@@ -96,6 +119,13 @@ function convertModel(model: any, schema: Record, ctx: ConversionCo
   return;
 }
 
+if (value === undefined || value === null) {
+  if (propSchema.type === "boolean") {
+obj[propertyName] = !!value;

Review Comment:
   because of the:
   ```
   if (value === undefined || value === null) {...
   ```
   value will never be `true`. What did you mean to write?



##
packages/runtime-tools-components/src/components/FormRenderer/FormRenderer.tsx:
##
@@ -58,7 +58,10 @@ export const FormRenderer = 
React.forwardRef - renders a wrapper with unknown props", 
() => {
   expect(screen.getByTestId("wrapper-field").getAttribute("data-y")).toBe("y");
   expect(screen.getByTestId("wrapper-field").getAttribute("data-z")).toBe("z");
 });
+
+test(" - respects default false from model", () => {
+  render(usingUniformsContext(, { x: { type: Boolean } 
}, { model: { x: false } }));
+
+  const input = screen.getByTestId("bool-field");
+  expect(input).not.toBeChecked();
+});

Review Comment:
   It seems to be already checked on line 91.
   We already have a test which checks if BoolField is unchecked without a 
model plus a test to check if BoolField is checked when the model has value=true
   ```suggestion
   ```



##
packages/runtime-tools-components/src/utils/ModelConversionTool.ts:
##
@@ -96,6 +119,13 @@ function convertModel(model: any, schema: Record, ctx: ConversionCo
   return;
 }
 
+if (value === undefined || value === null) {

Review Comment:
   This code will not be executed as we have this before:
   ```
   if (value === null) {
 return;
   }
   ```



##
packages/runtime-tools-components/src/utils/ModelConversionTool.ts:
##
@@ -96,6 +119,13 @@ function convertModel(model: any, schema: Record, ctx: ConversionCo
   return;
 }
 
+if (value === undefined || value === null) {
+  if (propSchema.type === "boolean") {

Review Comment:
   why the need of nested ifs?



##
packages/runtime-tools-components/src/utils/ModelConversionTool.ts:
##
@@ -25,6 +25,28 @@ export class ModelConversionTool {
   public static convertStringToDate = (model: any, schema: Record): any => {
 return doConvert(model, schema, (value) => new Date(value));
   };
+
+  public static normalizeBooleans = (model: any, schema: Record): 
any => {
+return doConvert(model, schema, (value) => {
+  if (value === "boolean") {

Review Comment:
   Do we ever reach this code?
   What did you mean with `value === "boolean"`?



##
packages/uniforms-patternfly/tests/BoolField.test.tsx:
##
@@ -77,6 +77,17 @@ test(" - renders a input with correct value 
(default)", () => {
   expect(screen.getByTestId("bool-field")).not.toHaveAttribute("checked");
 });
 
+test(" - renders an input with correct value (default true)", () => 
{
+  render(
+usingUniformsContext(, {
+  x: { type: Boolean, defaultValue: true },
+})
+  );

Review Comment:
   In the real use-case `defaultValue` in the schema is translated to `default` 
by the backend.
   So the frontend receive `default` in the `openapi.json` and what we need to 
test is:
   ```
 render(usingUniformsContext(, { x: { type: Boolean } 
}, { model: { x: true } }));
   ```
   Which is already tested in line 92 



##
packages/uniforms-patternfly/tests/BoolField.test.tsx:
##
@@ -109,3 +120,29 @@ test(" - renders a wrapper with unknown props", 
() => {
   expect(screen.getByTestId("wrapper-field").getAttribute("data-y")).toBe("y");
   expect(screen.getByTestId("wrapper-field").getAttribute("data-z")).toBe("z");
 });
+
+test(" - respects default false from model", () => {
+  render(usingUniformsContext(, { x: { type: Boolean } 
}, { model: { x: false } }));
+
+  const input = screen.getByTestId("bool-field");
+  expect(input).not.toBeChecked();
+});
+
+test(" - respects default true from model", () => {
+  render(usingUniformsContext(, { x: { type: Boolean } 
}, { model: { x: true } }));
+
+  const input = screen.getByTestId("bool-field");
+  expect(input).toBeChecked();
+});
+
+test(" - respects schema default true", () => {
+  render(usingUniformsContext(, { x: { type: Boolean, 
defaultValue: true } }));
+  const input = screen.getByTestId("bool-field");
+  expect(input).toBeChecked();
+});

Review Comment:
   It seems to be already checked on line 80
   ```suggestion
   ```



##
packages/uniforms-patternfly/tests/BoolField.test.tsx:
##
@@ -109,3 +120,29 @@ test(" - renders a wrapper with unknown props", 
() => {
   expect(screen.getByTestId("wrapper-field").getAttribute("data-y")).toBe("y");
   expect(screen.getByTestId("wrapper-field").getAttribute("data-z")).toBe("z");
 });
+
+test("