Skip to content

Commit

Permalink
Merge pull request #5791 from TouK/release-1.14-fixes
Browse files Browse the repository at this point in the history
Release 1.14 fixes
  • Loading branch information
arkadius committed Mar 26, 2024
2 parents d472c78 + b126e8f commit 5887751
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 21 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 14 additions & 5 deletions designer/client/cypress/e2e/tableEditor.cy.ts
Expand Up @@ -46,7 +46,18 @@ describe.skip("Table editor", () => {
cy.realPress("Enter");
cy.realPress("Escape");
cy.realType("xxx");
cy.get("@table").click(580, 25);
cy.get("@table")
.realMouseMove(210, 50)
.realMouseDown({
x: 210,
y: 50,
})
.realMouseMove(210, 50)
.realMouseUp({
x: 210,
y: 50,
});
cy.get("@table").dblclick(381, 50);
snapshot();

cy.get("[title=Expression]").next().find(".ace_editor").as("expr");
Expand All @@ -62,7 +73,7 @@ describe.skip("Table editor", () => {
cy.wait("@validation").its("response.statusCode").should("eq", 200);
cy.contains(`Bad expression type, expected: Boolean, found: String`).should("be.visible");

cy.get("@table").click(250, 50);
cy.get("@table").click(230, 50);
cy.get("[role='menuitem']").contains("Boolean").click();
cy.wait("@validation").its("response.statusCode").should("eq", 200);
cy.contains(`Bad expression type, expected: Boolean, found: String`).should("not.be.visible");
Expand Down Expand Up @@ -91,9 +102,7 @@ describe.skip("Table editor", () => {
cy.contains(/^remove 1 column$/i).click();
cy.get("@table").rightclick(50, 125);
cy.contains(/^remove 1 row$/i).click();
cy.get("@table").rightclick(480, 90);
cy.contains(/^remove 1 column$/i).click();
cy.get("@table").rightclick(480, 90);
cy.get("@table").rightclick(50, 90);
cy.contains(/^remove 1 column$/i).click();
snapshot();

Expand Down
10 changes: 6 additions & 4 deletions designer/client/src/components/AddProcessDialog.tsx
Expand Up @@ -39,10 +39,11 @@ export function AddProcessDialog(props: AddProcessDialogProps): JSX.Element {
description: "",
typ: "",
}));
const { categories, engines, processingModes, isEngineFieldVisible, isCategoryFieldVisible } = useProcessFormDataOptions({
allCombinations,
value,
});
const { categories, engines, processingModes, isEngineFieldVisible, isCategoryFieldVisible, isProcessingModeBatchAvailable } =
useProcessFormDataOptions({
allCombinations,
value,
});

const [isFormSubmitted, setIsFormSubmitted] = useState<boolean>(false);
const validationErrors = flow(
Expand Down Expand Up @@ -134,6 +135,7 @@ export function AddProcessDialog(props: AddProcessDialogProps): JSX.Element {
engines={isEngineFieldVisible ? engines : []}
touched={touched}
handleSetTouched={handleSetTouched}
isProcessingModeBatchAvailable={isProcessingModeBatchAvailable}
/>
</WindowContent>
);
Expand Down
21 changes: 13 additions & 8 deletions designer/client/src/components/AddProcessForm.tsx
Expand Up @@ -9,6 +9,7 @@ import { FormControl, FormGroup, FormHelperText, FormLabel, Link, Typography } f
import { Trans, useTranslation } from "react-i18next";
import StreamingIcon from "../assets/img/streaming.svg";
import RequestResponseIcon from "../assets/img/request-response.svg";
import BatchIcon from "../assets/img/batch.svg";
import { CustomRadio } from "./customRadio/CustomRadio";
import { ProcessingMode } from "../http/HttpService";
import { NodeValidationError } from "../types";
Expand All @@ -25,6 +26,7 @@ interface AddProcessFormProps extends ChangeableValue<FormValue> {
engines: string[];
handleSetTouched: (touched: TouchedValue) => void;
touched: TouchedValue;
isProcessingModeBatchAvailable?: boolean;
}

export function AddProcessForm({
Expand All @@ -36,6 +38,7 @@ export function AddProcessForm({
categories,
engines,
processingModes,
isProcessingModeBatchAvailable,
}: AddProcessFormProps): JSX.Element {
const { t } = useTranslation();
const onFieldChange = useCallback(
Expand Down Expand Up @@ -89,14 +92,16 @@ export function AddProcessForm({
Icon={RequestResponseIcon}
active={value.processingMode === ProcessingMode.requestResponse}
/>
{/*TODO: Uncomment it when batch processing mode ready*/}
{/*<CustomRadio*/}
{/* disabled={processingModes.every((processingMode) => processingMode !== ProcessingMode.batch)}*/}
{/* label={t("addProcessForm.label.batch", "Batch")}*/}
{/* value={ProcessingMode.batch}*/}
{/* Icon={BatchIcon}*/}
{/* active={value.processingMode === ProcessingMode.batch}*/}
{/*/>*/}
{/*TODO: Remove condition when batch processing mode ready */}
{isProcessingModeBatchAvailable && (
<CustomRadio
disabled={processingModes.every((processingMode) => processingMode !== ProcessingMode.batch)}
label={t("addProcessForm.label.batch", "Batch")}
value={ProcessingMode.batch}
Icon={BatchIcon}
active={value.processingMode === ProcessingMode.batch}
/>
)}
</FormGroup>
<ValidationLabels
fieldErrors={touched.processingMode ? getValidationErrorsForField(validationErrors, "processingMode") : []}
Expand Down
Expand Up @@ -107,6 +107,7 @@ describe("useProcessFormDataOptions", () => {
engines: ["Flink"],
isCategoryFieldVisible: true,
isEngineFieldVisible: false,
isProcessingModeBatchAvailable: false,
processingModes: ["Unbounded-Stream"],
});

Expand Down Expand Up @@ -159,6 +160,7 @@ describe("useProcessFormDataOptions", () => {
engines: ["Flink"],
isCategoryFieldVisible: true,
isEngineFieldVisible: false,
isProcessingModeBatchAvailable: false,
processingModes: ["Unbounded-Stream"],
});

Expand Down Expand Up @@ -210,6 +212,7 @@ describe("useProcessFormDataOptions", () => {
engines: ["Flink"],
isCategoryFieldVisible: true,
isEngineFieldVisible: false,
isProcessingModeBatchAvailable: false,
processingModes: ["Unbounded-Stream"],
});

Expand Down Expand Up @@ -259,6 +262,7 @@ describe("useProcessFormDataOptions", () => {
engines: ["Lite Embedded", "Lite K8s", "Flink", "Development Tests", "Dev Periodic"],
isCategoryFieldVisible: true,
isEngineFieldVisible: false,
isProcessingModeBatchAvailable: false,
processingModes: ["Request-Response", "Unbounded-Stream"],
});

Expand Down Expand Up @@ -310,6 +314,7 @@ describe("useProcessFormDataOptions", () => {
engines: ["Lite Embedded", "Lite K8s"],
isCategoryFieldVisible: true,
isEngineFieldVisible: false,
isProcessingModeBatchAvailable: false,
processingModes: ["Request-Response", "Unbounded-Stream"],
});
});
Expand Down Expand Up @@ -349,6 +354,7 @@ describe("useProcessFormDataOptions", () => {
engines: ["Engine1", "Engine2"],
isCategoryFieldVisible: true,
isEngineFieldVisible: true,
isProcessingModeBatchAvailable: true,
processingModes: ["Unbounded-Stream", "Bounded-Stream"],
});
});
Expand Down Expand Up @@ -387,6 +393,7 @@ describe("useProcessFormDataOptions", () => {
engines: ["Engine1", "Engine2"],
isCategoryFieldVisible: true,
isEngineFieldVisible: false,
isProcessingModeBatchAvailable: true,
processingModes: ["Unbounded-Stream", "Bounded-Stream"],
});
});
Expand Down Expand Up @@ -420,7 +427,9 @@ describe("useProcessFormDataOptions", () => {
],
engines: ["Engine1", "Engine2"],
isCategoryFieldVisible: false,
isProcessingModeBatchAvailable: true,
isEngineFieldVisible: false,

processingModes: ["Unbounded-Stream", "Bounded-Stream"],
});
});
Expand Down
6 changes: 4 additions & 2 deletions designer/client/src/components/useProcessFormDataOptions.ts
@@ -1,7 +1,7 @@
import { FormValue } from "./AddProcessForm";
import { useMemo } from "react";
import { every, groupBy, map, some, uniq, uniqBy } from "lodash";
import { ScenarioParametersCombination } from "../http/HttpService";
import { ProcessingMode, ScenarioParametersCombination } from "../http/HttpService";

const getFilteredValues = (allCombinations: ScenarioParametersCombination[], value: Partial<FormValue>) => {
let availableCombinations = allCombinations;
Expand Down Expand Up @@ -70,5 +70,7 @@ export const useProcessFormDataOptions = ({ allCombinations, value }: Props) =>

const isCategoryFieldVisible = categories.length > 1;

return { processingModes, categories, engines, isEngineFieldVisible, isCategoryFieldVisible };
const isProcessingModeBatchAvailable = allCombinations.some((allCombination) => allCombination.processingMode === ProcessingMode.batch);

return { processingModes, categories, engines, isEngineFieldVisible, isCategoryFieldVisible, isProcessingModeBatchAvailable };
};
3 changes: 2 additions & 1 deletion docs/Changelog.md
Expand Up @@ -6,7 +6,7 @@
* Tapir: 1.7.4 -> 1.9.11
* openapi-circe-yaml: 0.6.0 -> 0.7.4

1.14.0 (Not released yet)
1.14.0 (21 Mar 2024)
-------------------------
* [#4287](https://github.com/TouK/nussknacker/pull/4287) [#5257](https://github.com/TouK/nussknacker/pull/5257) [#5432](https://github.com/TouK/nussknacker/pull/5432) [#5552](https://github.com/TouK/nussknacker/pull/5552) [#5645](https://github.com/TouK/nussknacker/pull/5645) Libraries bump:
* Flink: 1.16.2 -> 1.17.2
Expand Down Expand Up @@ -60,6 +60,7 @@
* [#5656](https://github.com/TouK/nussknacker/pull/5656) Added: Decision Table component - detailed validation
* [#5657](https://github.com/TouK/nussknacker/pull/5657) Improved heuristic for eventhub to Azure's schema name mapping.
* [#5754](https://github.com/TouK/nussknacker/pull/5754) Fix for broken encoding mechanism in tests from file with Avro format, revert [0d9b600][https://github.com/TouK/nussknacker/commit/0d9b600]
* [#5558](https://github.com/TouK/nussknacker/pull/5558) Added: an info about `Processing mode` to the scenario and divided `Status` toolbar to `Scenario actions` and `Scenario details`

1.13.2 (7 Mar 2024)
------------------------
Expand Down
3 changes: 2 additions & 1 deletion docs/MigrationGuide.md
Expand Up @@ -27,7 +27,7 @@ To see the biggest differences please consult the [changelog](Changelog.md).

* [#5574](https://github.com/TouK/nussknacker/pull/5574) Removed the support for the plugable expression languages: `ExpressionConfig.languages` removed

## In version 1.14.x (Not released yet)
## In version 1.14.0

### Code API changes
* [#5271](https://github.com/TouK/nussknacker/pull/5271) Changed `AdditionalUIConfigProvider.getAllForProcessingType` API to be more in line with FragmentParameter
Expand Down Expand Up @@ -200,6 +200,7 @@ To see the biggest differences please consult the [changelog](Changelog.md).
than wildcard.
On the other hand starting from this version, you can use the same category for many scenarioTypes. You only have to ensure that they
have components with other processing modes or other deployment configuration.
* [#5558](https://github.com/TouK/nussknacker/pull/5558) The `processToolbarConfig` toolbar with `type: "process-info-panel"` no longer accepts the `buttons` property. It only display scenario information now. However, a new toolbar with `type: "process-actions-panel"` has been introduced, which does accept the `buttons` property and renders actions similar to the old `type: "process-info-panel"`.

### Helm chart changes
* [#5515](https://github.com/TouK/nussknacker/pull/5515) [#5474](https://github.com/TouK/nussknacker/pull/5474) Helm chart now has two preconfigured scenario types (`streaming` and `request-response`) instead of one (`default`).
Expand Down

0 comments on commit 5887751

Please sign in to comment.