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

new aggregations UI #7043

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
545e05c
debug container update
JulianWielga Jul 23, 2024
41167a7
placeholders support
JulianWielga Jul 23, 2024
86cb5c6
optional fieldErrors
JulianWielga Jul 23, 2024
7aaa9a8
cleanup
JulianWielga Jul 23, 2024
94599d8
show errors in NodeRow
JulianWielga Jul 23, 2024
e2f1dad
extract findParamDefinitonByName
JulianWielga Jul 23, 2024
735e6ab
replace aggregator & aggregateBy with row with editors
JulianWielga Jul 23, 2024
8675e38
refactor & test fix
JulianWielga Aug 2, 2024
217a745
fixed ace editor tabindex
JulianWielga Aug 19, 2024
b2e04f2
groupBy
JulianWielga Aug 20, 2024
40ecbcb
fixed record parse
JulianWielga Aug 20, 2024
f6f8a78
cleanup
JulianWielga Aug 20, 2024
adf97da
fixed types error
JulianWielga Aug 20, 2024
7e28c7a
minor things
JulianWielga Sep 10, 2024
e3fcca1
Merge remote-tracking branch 'upstream/staging' into aggregate-ui
JulianWielga Sep 16, 2024
8231b25
json editor settings sync with aceWrapper
JulianWielga Sep 17, 2024
4b17cc8
test tweak
JulianWielga Sep 17, 2024
300234e
Merge remote-tracking branch 'upstream/staging' into aggregate-ui
JulianWielga Sep 17, 2024
1b9e796
test tweak
JulianWielga Sep 18, 2024
4178e18
Updated snapshots (#6834)
github-actions[bot] Sep 18, 2024
3f73fe8
minor types fixes
JulianWielga Oct 1, 2024
c1022f4
fields labels
JulianWielga Oct 1, 2024
a64c0d3
required fields
JulianWielga Oct 1, 2024
ce7d43a
presets fixed
JulianWielga Oct 3, 2024
7de29fd
Merge remote-tracking branch 'upstream/staging' into aggregate-ui
JulianWielga Oct 3, 2024
17c64fe
sort type options
JulianWielga Oct 3, 2024
415c449
Merge branch 'staging' into preview/aggregate-ui
JulianWielga Oct 18, 2024
c110f56
Merge branch 'staging' into preview/aggregate-ui
JulianWielga Oct 22, 2024
14d3bff
Merge branch 'staging' into preview/aggregate-ui
JulianWielga Oct 24, 2024
b951ac5
Merge branch 'staging' into preview/aggregate-ui
JulianWielga Oct 24, 2024
1726fb5
Merge branch 'staging' into preview/aggregate-ui
JulianWielga Oct 28, 2024
f636550
review fixes
JulianWielga Oct 28, 2024
f289d19
Merge branch 'staging' into preview/aggregate-ui
JulianWielga Oct 28, 2024
4d1d0c3
test fixes
JulianWielga Oct 28, 2024
9b056e3
add cypress test
JulianWielga Oct 29, 2024
2368e27
Updated snapshots (#7100)
github-actions[bot] Oct 29, 2024
525507e
Merge branch 'staging' into preview/aggregate-ui
JulianWielga Oct 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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
107 changes: 107 additions & 0 deletions designer/client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions designer/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"babel-loader": "8.2.3",
"babel-plugin-istanbul": "6.1.1",
"chalk": "4.1.2",
"chevrotain": "11.0.3",
"color": "4.2.0",
"copy-webpack-plugin": "11.0.0",
"crypto-browserify": "3.12.0",
Expand Down
10 changes: 5 additions & 5 deletions designer/client/src/common/ProcessUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* eslint-disable i18next/no-literal-string */
import { flatten, isEmpty, isEqual, omit, pickBy, transform } from "lodash";
import { Scenario } from "src/components/Process/types";
import { ScenarioLabelValidationError } from "../components/Labels/types";
import { RootState } from "../reducers";
import { isProcessRenamed } from "../reducers/selectors/graph";
import {
ComponentDefinition,
NodeId,
Expand All @@ -13,10 +17,6 @@ import {
ValidationResult,
VariableTypes,
} from "../types";
import { RootState } from "../reducers";
import { isProcessRenamed } from "../reducers/selectors/graph";
import { Scenario } from "src/components/Process/types";
import { ScenarioLabelValidationError } from "../components/Labels/types";

class ProcessUtils {
nothingToSave = (state: RootState): boolean => {
Expand Down Expand Up @@ -204,7 +204,7 @@ class ProcessUtils {
}
};

extractComponentDefinition = (node: NodeType, components: Record<string, ComponentDefinition>): ComponentDefinition | null => {
extractComponentDefinition = (node: NodeType, components?: Record<string, ComponentDefinition>): ComponentDefinition | null => {
return components?.[this.determineComponentId(node)];
};

Expand Down
8 changes: 6 additions & 2 deletions designer/client/src/components/common/dndItems/DndItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import { alpha, Box } from "@mui/material";
interface DndListProps<I> extends ItemsProps<I> {
disabled?: boolean;
onChange: (value: I[]) => void;
onDestinationChange?: (index: number | null) => void;
}

export function DndItems<I>(props: DndListProps<I>): JSX.Element {
const { items, onChange, disabled } = props;
const { items, onChange, onDestinationChange, disabled } = props;

const moveItem = useCallback(
(source: number, target: number) => {
Expand All @@ -28,8 +29,9 @@ export function DndItems<I>(props: DndListProps<I>): JSX.Element {
});
onChange(newFields);
}
onDestinationChange?.(null);
},
[items, onChange],
[items, onChange, onDestinationChange],
);

const droppableId = useRef(Date.now().toString());
Expand Down Expand Up @@ -61,6 +63,8 @@ export function DndItems<I>(props: DndListProps<I>): JSX.Element {
renderClone={renderDraggable}
CloneWrapper={FakeFormWindow}
onDragEnd={({ destination, source }) => moveItem(source?.index, destination?.index)}
onDragStart={({ source }) => onDestinationChange?.(source?.index)}
onDragUpdate={({ destination }) => onDestinationChange?.(destination?.index)}
>
{items.map((_, index) => (
<Draggable key={index} draggableId={`${index}`} index={index} isDragDisabled={disabled}>
Expand Down
7 changes: 5 additions & 2 deletions designer/client/src/components/common/dndItems/DropTarget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ export function DropTarget({
renderClone,
CloneWrapper = "div",
onDragEnd,
onDragStart,
onDragUpdate,
...props
}: PropsWithChildren<
{ CloneWrapper?: ReactComponentLike } & Pick<DragDropContextProps, "onDragEnd"> & Omit<DroppableProps, "children">
{ CloneWrapper?: ReactComponentLike } & Pick<DragDropContextProps, "onDragEnd" | "onDragUpdate" | "onDragStart"> &
Omit<DroppableProps, "children">
>): JSX.Element {
const clone: DraggableChildrenFn = useCallback(
(...args) => <CloneWrapper>{renderClone(...args)}</CloneWrapper>,
[CloneWrapper, renderClone],
);
return (
<DragDropContext onDragEnd={onDragEnd}>
<DragDropContext onDragEnd={onDragEnd} onDragStart={onDragStart} onDragUpdate={onDragUpdate}>
<Droppable {...props} renderClone={clone}>
{(p) => (
<div ref={p.innerRef}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ import { UIParameter } from "../../../types";
import NodeTip from "./NodeTip";
import InfoIcon from "@mui/icons-material/Info";
import ProcessUtils from "../../../common/ProcessUtils";
import { findParamDefinitionByName } from "./parameterHelpers";
import { ErrorBoundary } from "react-error-boundary";
import { PlaceholderIconFallbackComponent } from "../../common/error-boundary/fallbackComponent/PlaceholderIconFallbackComponent";

export function findParamDefinitionByName(definitions: UIParameter[], paramName: string): UIParameter {
return definitions?.find((param) => param.name === paramName);
}

export const StyledNodeTip = styled(NodeTip)({
margin: "0 8px",
flex: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useTestResults } from "./TestResultsWrapper";
import ExpressionField from "./editors/expression/ExpressionField";
import { findParamDefinitionByName } from "./FieldLabel";
import React, { ComponentType, PropsWithChildren, useMemo } from "react";
import { NodeId, NodeType, NodeValidationError, Parameter, UIParameter, VariableTypes } from "../../../types";
import { getValidationErrorsForField } from "./editors/Validators";
import { findParamDefinitionByName } from "./parameterHelpers";

export type FieldWrapperProps = PropsWithChildren<Omit<ParameterExpressionFieldProps, "FieldWrapper">>;

Expand All @@ -24,7 +24,7 @@ export type ParameterExpressionFieldProps = {
};

//this is for "dynamic" parameters in sources, sinks, services etc.
export function ParameterExpressionField({ FieldWrapper = React.Fragment, ...props }: ParameterExpressionFieldProps): JSX.Element {
export function ParameterExpressionField({ FieldWrapper, ...props }: ParameterExpressionFieldProps): JSX.Element {
const {
errors,
findAvailableVariables,
Expand All @@ -50,8 +50,8 @@ export function ParameterExpressionField({ FieldWrapper = React.Fragment, ...pro
[findAvailableVariables, node.id, parameter.name, parameterDefinitions],
);

return (
<FieldWrapper {...props}>
const field = useMemo(
() => (
<ExpressionField
fieldName={parameter.name}
fieldLabel={parameter.name}
Expand All @@ -67,6 +67,22 @@ export function ParameterExpressionField({ FieldWrapper = React.Fragment, ...pro
variableTypes={variableTypes}
fieldErrors={getValidationErrorsForField(errors, parameter.name)}
/>
</FieldWrapper>
),
[
errors,
isEditMode,
listFieldPath,
node,
parameter.name,
parameterDefinitions,
renderFieldLabel,
setProperty,
showSwitch,
showValidation,
testResultsState.testResultsToShow,
variableTypes,
],
);

return FieldWrapper ? <FieldWrapper {...props}>{field}</FieldWrapper> : <>{field}</>;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useTestResults } from "./TestResultsWrapper";
import ExpressionField from "./editors/expression/ExpressionField";
import { findParamDefinitionByName } from "./FieldLabel";
import React from "react";
import { NodeType, NodeValidationError, UIParameter, VariableTypes } from "../../../types";
import { getValidationErrorsForField } from "./editors/Validators";
import { findParamDefinitionByName } from "./parameterHelpers";

//this is for "static" fields like expressions in filters, switches etc.
export function StaticExpressionField({
Expand Down
Loading
Loading