Skip to content

Commit 9b70dca

Browse files
[Streams] [Streamlang] Enable nested conditionals in the UI (elastic#232322)
## Summary Closes elastic/streams-program#445 This PR adds support for nested conditionals (nested `where` blocks in Streamlang DSL) to the processing UI. There have been architectural changes to the state machines, and UI changes to match the [Figma](https://www.figma.com/design/C4o0y9Knk4jYXjsulvbW3w/Stream-Management--Processors--Grok?node-id=6004-42432&p=f&t=QSrMxFyNLwrO2mLq-0) designs. ## States There are quite a lot of states within the UI, I've tried to capture the majority of them here. Also be mindful of UX additions such as scrolling newly added steps into view. <details> <summary>Screenshots</summary> <img width="1186" height="1216" alt="Screenshot 2025-09-11 at 22 17 48" src="https://github.com/user-attachments/assets/5ea4e45f-4398-4463-b5e5-81d8be005555" /> <img width="1164" height="1182" alt="Screenshot 2025-09-11 at 22 18 40" src="https://github.com/user-attachments/assets/a5604248-926c-49ec-bd00-18cae7a8aece" /> <img width="1174" height="508" alt="Screenshot 2025-09-11 at 22 18 49" src="https://github.com/user-attachments/assets/fbe19f40-761b-46fe-a2ac-6ad2a3795043" /> <img width="1150" height="246" alt="Screenshot 2025-09-11 at 22 19 05" src="https://github.com/user-attachments/assets/75f80061-985e-4600-871a-abda65d2f0d0" /> <img width="1148" height="1062" alt="Screenshot 2025-09-11 at 22 19 43" src="https://github.com/user-attachments/assets/78353291-809e-47a7-bb1c-76995559c38b" /> <img width="1176" height="664" alt="Screenshot 2025-09-11 at 22 20 10" src="https://github.com/user-attachments/assets/a92feeac-d0b4-43a8-8e44-42f34aea3a24" /> <img width="1260" height="380" alt="Screenshot 2025-09-11 at 22 20 17" src="https://github.com/user-attachments/assets/b9063711-58a0-41c1-8644-c876909734a6" /> <img width="1166" height="874" alt="Screenshot 2025-09-11 at 22 20 31" src="https://github.com/user-attachments/assets/7f593938-e447-4e68-a260-3bf39ff6af8f" /> </details> ## On the way - ~Existing Scout tests are still being updated (this doesn't need to block reviews)~ - Update Scout tests to cover new features - Copy needs review --------- Co-authored-by: kibanamachine <[email protected]>
1 parent 59af9fe commit 9b70dca

File tree

98 files changed

+3285
-1472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+3285
-1472
lines changed

oas_docs/bundle.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49744,6 +49744,9 @@
4974449744
{
4974549745
"additionalProperties": false,
4974649746
"properties": {
49747+
"customIdentifier": {
49748+
"type": "string"
49749+
},
4974749750
"where": {
4974849751
"allOf": [
4974949752
{
@@ -53079,6 +53082,9 @@
5307953082
{
5308053083
"additionalProperties": false,
5308153084
"properties": {
53085+
"customIdentifier": {
53086+
"type": "string"
53087+
},
5308253088
"where": {
5308353089
"allOf": [
5308453090
{
@@ -56011,6 +56017,9 @@
5601156017
{
5601256018
"additionalProperties": false,
5601356019
"properties": {
56020+
"customIdentifier": {
56021+
"type": "string"
56022+
},
5601456023
"where": {
5601556024
"allOf": [
5601656025
{
@@ -59042,6 +59051,9 @@
5904259051
{
5904359052
"additionalProperties": false,
5904459053
"properties": {
59054+
"customIdentifier": {
59055+
"type": "string"
59056+
},
5904559057
"where": {
5904659058
"allOf": [
5904759059
{
@@ -62558,6 +62570,9 @@
6255862570
{
6255962571
"additionalProperties": false,
6256062572
"properties": {
62573+
"customIdentifier": {
62574+
"type": "string"
62575+
},
6256162576
"where": {
6256262577
"allOf": [
6256362578
{
@@ -65748,6 +65763,9 @@
6574865763
{
6574965764
"additionalProperties": false,
6575065765
"properties": {
65766+
"customIdentifier": {
65767+
"type": "string"
65768+
},
6575165769
"where": {
6575265770
"allOf": [
6575365771
{

oas_docs/bundle.serverless.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48859,6 +48859,9 @@
4885948859
{
4886048860
"additionalProperties": false,
4886148861
"properties": {
48862+
"customIdentifier": {
48863+
"type": "string"
48864+
},
4886248865
"where": {
4886348866
"allOf": [
4886448867
{
@@ -52194,6 +52197,9 @@
5219452197
{
5219552198
"additionalProperties": false,
5219652199
"properties": {
52200+
"customIdentifier": {
52201+
"type": "string"
52202+
},
5219752203
"where": {
5219852204
"allOf": [
5219952205
{
@@ -55126,6 +55132,9 @@
5512655132
{
5512755133
"additionalProperties": false,
5512855134
"properties": {
55135+
"customIdentifier": {
55136+
"type": "string"
55137+
},
5512955138
"where": {
5513055139
"allOf": [
5513155140
{
@@ -58157,6 +58166,9 @@
5815758166
{
5815858167
"additionalProperties": false,
5815958168
"properties": {
58169+
"customIdentifier": {
58170+
"type": "string"
58171+
},
5816058172
"where": {
5816158173
"allOf": [
5816258174
{
@@ -61673,6 +61685,9 @@
6167361685
{
6167461686
"additionalProperties": false,
6167561687
"properties": {
61688+
"customIdentifier": {
61689+
"type": "string"
61690+
},
6167661691
"where": {
6167761692
"allOf": [
6167861693
{
@@ -64863,6 +64878,9 @@
6486364878
{
6486464879
"additionalProperties": false,
6486564880
"properties": {
64881+
"customIdentifier": {
64882+
"type": "string"
64883+
},
6486664884
"where": {
6486764885
"allOf": [
6486864886
{

oas_docs/output/kibana.serverless.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47397,6 +47397,8 @@ paths:
4739747397
- additionalProperties: false
4739847398
type: object
4739947399
properties:
47400+
customIdentifier:
47401+
type: string
4740047402
where:
4740147403
allOf:
4740247404
- anyOf:
@@ -49130,6 +49132,8 @@ paths:
4913049132
- additionalProperties: false
4913149133
type: object
4913249134
properties:
49135+
customIdentifier:
49136+
type: string
4913349137
where:
4913449138
allOf:
4913549139
- anyOf:
@@ -50661,6 +50665,8 @@ paths:
5066150665
- additionalProperties: false
5066250666
type: object
5066350667
properties:
50668+
customIdentifier:
50669+
type: string
5066450670
where:
5066550671
allOf:
5066650672
- anyOf:
@@ -52244,6 +52250,8 @@ paths:
5224452250
- additionalProperties: false
5224552251
type: object
5224652252
properties:
52253+
customIdentifier:
52254+
type: string
5224752255
where:
5224852256
allOf:
5224952257
- anyOf:
@@ -54113,6 +54121,8 @@ paths:
5411354121
- additionalProperties: false
5411454122
type: object
5411554123
properties:
54124+
customIdentifier:
54125+
type: string
5411654126
where:
5411754127
allOf:
5411854128
- anyOf:
@@ -55759,6 +55769,8 @@ paths:
5575955769
- additionalProperties: false
5576055770
type: object
5576155771
properties:
55772+
customIdentifier:
55773+
type: string
5576255774
where:
5576355775
allOf:
5576455776
- anyOf:

oas_docs/output/kibana.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53907,6 +53907,8 @@ paths:
5390753907
- additionalProperties: false
5390853908
type: object
5390953909
properties:
53910+
customIdentifier:
53911+
type: string
5391053912
where:
5391153913
allOf:
5391253914
- anyOf:
@@ -55640,6 +55642,8 @@ paths:
5564055642
- additionalProperties: false
5564155643
type: object
5564255644
properties:
55645+
customIdentifier:
55646+
type: string
5564355647
where:
5564455648
allOf:
5564555649
- anyOf:
@@ -57171,6 +57175,8 @@ paths:
5717157175
- additionalProperties: false
5717257176
type: object
5717357177
properties:
57178+
customIdentifier:
57179+
type: string
5717457180
where:
5717557181
allOf:
5717657182
- anyOf:
@@ -58754,6 +58760,8 @@ paths:
5875458760
- additionalProperties: false
5875558761
type: object
5875658762
properties:
58763+
customIdentifier:
58764+
type: string
5875758765
where:
5875858766
allOf:
5875958767
- anyOf:
@@ -60658,6 +60666,8 @@ paths:
6065860666
- additionalProperties: false
6065960667
type: object
6066060668
properties:
60669+
customIdentifier:
60670+
type: string
6066160671
where:
6066260672
allOf:
6066360673
- anyOf:
@@ -62304,6 +62314,8 @@ paths:
6230462314
- additionalProperties: false
6230562315
type: object
6230662316
properties:
62317+
customIdentifier:
62318+
type: string
6230762319
where:
6230862320
allOf:
6230962321
- anyOf:

x-pack/platform/packages/shared/kbn-streamlang/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
*/
77

88
export type { StreamlangDSL } from './types/streamlang';
9-
export { streamlangDSLSchema, isActionBlock } from './types/streamlang';
9+
export { streamlangDSLSchema, isActionBlock, isWhereBlock } from './types/streamlang';
1010
export { transpile as transpileIngestPipeline } from './src/transpilers/ingest_pipeline';
1111
export * from './types/processors';
1212
export * from './types/conditions';
13+
export type * from './types/ui';
1314
export * from './src/conditions/helpers';
1415
export * from './src/conditions/condition_to_query_dsl';
1516
export * from './src/conditions/condition_to_painless';
17+
export * from './src/transpilers/shared/convert_for_ui';

x-pack/platform/packages/shared/kbn-streamlang/src/conditions/condition_to_painless.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ export function conditionToStatement(condition: Condition, nested = false): stri
231231
return `!(${conditionToStatement(condition.not, true)})`;
232232
}
233233
// Always/never conditions (if you have them)
234-
if ('always' in condition && condition.always === true) {
234+
if ('always' in condition) {
235235
return `true`;
236236
}
237-
if ('never' in condition && condition.never === true) {
237+
if ('never' in condition) {
238238
return `false`;
239239
}
240240
throw new Error('Unsupported condition');

0 commit comments

Comments
 (0)