feat(orchestrator): pre-populate Execute Workflow form from URL query params#2570
feat(orchestrator): pre-populate Execute Workflow form from URL query params#2570karthikjeeyar wants to merge 4 commits intoredhat-developer:mainfrom
Conversation
Signed-off-by: Karthik <karthik.jk11@gmail.com>
Changed Packages
|
Review Summary by QodoAdd URL query parameter prepopulation for Execute Workflow form
WalkthroughsDescription• Add URL query parameter support to prepopulate Execute Workflow form fields • Support flat and nested (dot-notation) schema paths for field mapping • Implement case-insensitive enum matching with validation and error skipping • Exclude reserved parameters (targetEntity, instanceId) from form prepopulation Diagramflowchart LR
A["URL Query Params"] -->|"extractSchemaPaths"| B["Valid Schema Paths"]
A -->|"iterate params"| C["mergeQueryParamsIntoFormData"]
B -->|"validate against"| C
D["Base Form Data"] -->|"clone & merge"| C
C -->|"coerceValueForSchema"| E["Enum Validation"]
E -->|"case-insensitive match"| F["Final Form Data"]
File Changes1. workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts
|
Code Review by Qodo
1.
|
...rchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts
Outdated
Show resolved
Hide resolved
...rchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts
Outdated
Show resolved
Hide resolved
f0045b3 to
c477103
Compare
lokanandaprabhu
left a comment
There was a problem hiding this comment.
- Array prepopulation is not supported (query params are treated as scalar values only).
- oneOf prepopulation is not supported.
Example schema
{
"tags": { "type": "array", "items": { "type": "string" } },
"mode": {
"oneOf": [
{ "title": "Alpha", "type": "object", "properties": { "alphaValue": { "type": "string" } } },
{ "title": "Beta", "type": "object", "properties": { "betaValue": { "type": "string" } } }
]
}
}
|
|
@lokanandaprabhu I have added full support for JSON schema. It now supports all the types and all boolean composite paths such as oneOf/anyOf/allOf etc. Refer the PR description for an example image. |



prepopulate workflow execution form using query params
https://redhat.atlassian.net/browse/RHDHBUGS-2829
Add support to pre-populate workflow execution form based on the query params.
Path format
?language=English&name=John?firstStep.fooTheFirst=testor?secondStep.language=EnglishScreenshot
Full Json schema support:
url:
http://rhdh.example.com/orchestrator/workflows/test-prepopulate-query-params/execute?language=english&name=John&count=1&ratio=4&enabled=true&firstStep.fooTheFirst=firstValue&provideInputs.language=spanish&refContainer.nestedEnum=alpha&refContainer.nestedInt=1&refContainer.nestedFlag=true&tags=foo,bar,baz&mode.betaValue=betaPrepopulates all the fields from queryparams.
✔️ Checklist