Skip to content

Commit

Permalink
new aggregations UI (#7102)
Browse files Browse the repository at this point in the history
* debug container update

* placeholders support

* optional fieldErrors

* cleanup

* show errors in NodeRow

* extract findParamDefinitonByName

* replace aggregator & aggregateBy with row with editors

* refactor & test fix

* fixed ace editor tabindex

* groupBy
cleanup

* fixed record parse

* cleanup

* fixed types error

* minor things

* json editor settings sync with aceWrapper

* test tweak

* test tweak

* Updated snapshots (#6834)

Co-authored-by: JulianWielga <[email protected]>

* minor types fixes

* fields labels

* required fields

* presets fixed

* sort type options

* review fixes

* test fixes

* add cypress test

* Updated snapshots (#7100)

Co-authored-by: JulianWielga <[email protected]>

* trigger build

* Updated snapshots (#7105)

Co-authored-by: JulianWielga <[email protected]>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: JulianWielga <[email protected]>
Co-authored-by: JulianWielga <[email protected]>
  • Loading branch information
4 people authored Oct 29, 2024
1 parent 0787421 commit 84657ca
Show file tree
Hide file tree
Showing 59 changed files with 1,749 additions and 163 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions designer/client/cypress/e2e/aggregations.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
describe("Aggregations", () => {
const seed = "aggregations";

before(() => {
cy.deleteAllTestProcesses({
filter: seed,
force: true,
});
});

after(() => {
cy.deleteAllTestProcesses({ filter: seed });
});

["aggregate-sliding", "aggregate-tumbling", "aggregate-session"].forEach((component) => {
it(`should display updated UI for ${component}`, () => {
cy.visitNewProcess(seed, "aggregations", "Default");
cy.getNode(component).dblclick();
cy.get("[data-testid=window]").should("be.visible");
cy.get("[title='Aggregations']")
.parent()
.should("be.visible")
.matchImage({
screenshotConfig: {
padding: [80, 10, 10, 10],
},
});
});
});
});
2 changes: 1 addition & 1 deletion designer/client/cypress/e2e/jsonEditor.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("JSON editor", () => {
.should("be.enabled")
.click();
cy.get("[data-testid=window]").as("modal");
cy.get("[title='Input schema']").next().find(".ace_editor").should("be.visible").as("editor");
cy.get("[title='Input schema']").next().find(".ace_editor").should("be.visible").parent().as("editor");

cy.get("@editor").matchImage({
maxDiffThreshold: 0.0025,
Expand Down
8 changes: 6 additions & 2 deletions designer/client/cypress/e2e/sqlEditor.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe("Sql editor", () => {
cy.layoutScenario();
cy.get("[model-id=sql-source]").should("be.visible").trigger("dblclick");
cy.get("[data-testid=window]").should("be.visible");
cy.get("#ace-editor").should("not.have.class", "tokenizer-working").parent().matchImage({ maxDiffThreshold });
cy.get("#ace-editor").should("not.have.class", "tokenizer-working");
cy.wait(1000);
cy.get("#ace-editor").parent().matchImage({ maxDiffThreshold });
cy.get("[data-testid=window]").matchImage();
});

Expand All @@ -26,7 +28,9 @@ describe("Sql editor", () => {

cy.wrap(["sql-source", "sql-source2", "sql-source3"]).each((name) => {
cy.get(`[model-id=${name}]`).should("be.visible").trigger("dblclick");
cy.get("#ace-editor").should("not.have.class", "tokenizer-working").parent().matchImage({ maxDiffThreshold });
cy.get("#ace-editor").should("not.have.class", "tokenizer-working");
cy.wait(1000);
cy.get("#ace-editor").parent().matchImage({ maxDiffThreshold });
cy.get("[data-testid=window]")
.contains(/^cancel$/i)
.click();
Expand Down
283 changes: 283 additions & 0 deletions designer/client/cypress/fixtures/aggregations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
{
"metaData": {
"id": "test",
"additionalFields": {
"description": null,
"properties": {
"parallelism": "1",
"spillStateToDisk": "true",
"useAsyncInterpretation": "",
"checkpointIntervalInSeconds": ""
},
"metaDataType": "StreamMetaData",
"showDescription": false
}
},
"nodes": [
{
"id": "periodic",
"ref": {
"typ": "periodic",
"parameters": [
{
"name": "period",
"expression": {
"language": "spel",
"expression": "T(java.time.Duration).parse('PT1M')"
}
},
{
"name": "count",
"expression": {
"language": "spel",
"expression": "1"
}
},
{
"name": "value",
"expression": {
"language": "spel",
"expression": "1"
}
}
]
},
"additionalFields": {
"description": null,
"layoutData": {
"x": 360,
"y": 0
}
},
"type": "Source"
},
{
"nexts": [
[
{
"id": "aggregate-session",
"outputVar": "outputVar",
"nodeType": "aggregate-session",
"parameters": [
{
"name": "groupBy",
"expression": {
"language": "spel",
"expression": "{ #input.floatValue }.toString"
}
},
{
"name": "aggregator",
"expression": {
"language": "spel",
"expression": "#AGG.map({\n count: #AGG.sum\n})"
}
},
{
"name": "aggregateBy",
"expression": {
"language": "spel",
"expression": "{\n count: 1\n}"
}
},
{
"name": "endSessionCondition",
"expression": {
"language": "spel",
"expression": "true"
}
},
{
"name": "sessionTimeout",
"expression": {
"language": "spel",
"expression": "T(java.time.Duration).parse('PT1H')"
}
},
{
"name": "emitWhen",
"expression": {
"language": "spel",
"expression": "T(pl.touk.nussknacker.engine.flink.util.transformer.aggregate.SessionWindowTrigger).OnEvent"
}
}
],
"additionalFields": {
"description": null,
"layoutData": {
"x": 720,
"y": 360
}
},
"type": "CustomNode"
},
{
"id": "dead-end",
"ref": {
"typ": "dead-end",
"parameters": []
},
"endResult": null,
"isDisabled": null,
"additionalFields": {
"description": null,
"layoutData": {
"x": 720,
"y": 540
}
},
"type": "Sink"
}
],
[
{
"id": "aggregate-sliding",
"outputVar": "outputVar",
"nodeType": "aggregate-sliding",
"parameters": [
{
"name": "groupBy",
"expression": {
"language": "spel",
"expression": "{ #input.longValue }.toString"
}
},
{
"name": "aggregator",
"expression": {
"language": "spel",
"expression": "#AGG.map({\n count: #AGG.sum\n})"
}
},
{
"name": "aggregateBy",
"expression": {
"language": "spel",
"expression": "{\n count: 1\n}"
}
},
{
"name": "windowLength",
"expression": {
"language": "spel",
"expression": "T(java.time.Duration).parse('PT1H')"
}
},
{
"name": "emitWhenEventLeft",
"expression": {
"language": "spel",
"expression": "false"
}
}
],
"additionalFields": {
"description": null,
"layoutData": {
"x": 0,
"y": 360
}
},
"type": "CustomNode"
},
{
"id": "dead-end 1",
"ref": {
"typ": "dead-end",
"parameters": []
},
"endResult": null,
"isDisabled": null,
"additionalFields": {
"description": null,
"layoutData": {
"x": 0,
"y": 540
}
},
"type": "Sink"
}
],
[
{
"id": "aggregate-tumbling",
"outputVar": "outputVar",
"nodeType": "aggregate-tumbling",
"parameters": [
{
"name": "groupBy",
"expression": {
"language": "spel",
"expression": "{ #input.longValue }.toString"
}
},
{
"name": "aggregator",
"expression": {
"language": "spel",
"expression": "#AGG.map({\n count: #AGG.sum\n})"
}
},
{
"name": "aggregateBy",
"expression": {
"language": "spel",
"expression": "{\n count: 1\n}"
}
},
{
"name": "windowLength",
"expression": {
"language": "spel",
"expression": "T(java.time.Duration).parse('PT1H')"
}
},
{
"name": "emitWhen",
"expression": {
"language": "spel",
"expression": "T(pl.touk.nussknacker.engine.flink.util.transformer.aggregate.TumblingWindowTrigger).OnEvent"
}
}
],
"additionalFields": {
"description": null,
"layoutData": {
"x": 360,
"y": 360
}
},
"type": "CustomNode"
},
{
"id": "dead-end 2",
"ref": {
"typ": "dead-end",
"parameters": []
},
"endResult": null,
"isDisabled": null,
"additionalFields": {
"description": null,
"layoutData": {
"x": 360,
"y": 540
}
},
"type": "Sink"
}
]
],
"id": "split",
"additionalFields": {
"description": null,
"layoutData": {
"x": 360,
"y": 180
}
},
"type": "Split"
}
],
"additionalBranches": []
}
Loading

0 comments on commit 84657ca

Please sign in to comment.