-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NU-1806] Add deployment activity parameters
- Loading branch information
Showing
61 changed files
with
1,049 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...onents-api/src/main/java/pl/touk/nussknacker/engine/api/editor/FixedValuesEditorMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package pl.touk.nussknacker.engine.api.editor; | ||
|
||
public enum FixedValuesEditorMode { | ||
LIST, RADIO; | ||
|
||
public static FixedValuesEditorMode fromName(String name) { | ||
switch (name) { | ||
case "LIST": | ||
return LIST; | ||
case "RADIO": | ||
default: | ||
return RADIO; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
designer/client/src/components/modals/ActivityCommentTextField.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { styled, TextField, TextFieldProps } from "@mui/material"; | ||
import React from "react"; | ||
|
||
export const ActivityCommentTextField = styled((props: TextFieldProps) => ( | ||
<TextField | ||
fullWidth | ||
multiline | ||
minRows={1} | ||
maxRows={3} | ||
InputLabelProps={{ shrink: true }} | ||
variant="outlined" | ||
label="Comment" | ||
{...props} | ||
/> | ||
))({ | ||
flexDirection: "column", | ||
".MuiFormLabel-root": { | ||
margin: 0, | ||
flexDirection: "column", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useSelector } from "react-redux"; | ||
import { getProcessName } from "../../reducers/selectors/graph"; | ||
import { Typography } from "@mui/material"; | ||
import React from "react"; | ||
import ProcessDialogWarnings from "./ProcessDialogWarnings"; | ||
|
||
interface Props { | ||
title: string; | ||
displayWarnings?: boolean; | ||
} | ||
|
||
export function ActivityHeader(props: Props): JSX.Element { | ||
const processName = useSelector(getProcessName); | ||
return ( | ||
<> | ||
<Typography | ||
variant={"body2"} | ||
sx={{ width: "100%", "::after": { content: "':'" }, fontWeight: 600, fontSize: "16px", lineHeight: "24px" }} | ||
> | ||
{props.title} | ||
</Typography> | ||
<Typography variant={"body2"} sx={{ width: "100%", fontWeight: 600, fontSize: "20px", lineHeight: "30px" }}> | ||
{processName} | ||
</Typography> | ||
{props.displayWarnings && <ProcessDialogWarnings />} | ||
</> | ||
); | ||
} |
49 changes: 49 additions & 0 deletions
49
designer/client/src/components/modals/ActivityProperty.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { ExpressionLang } from "../graph/node-modal/editors/expression/types"; | ||
import React, { useCallback } from "react"; | ||
import { FieldLabel } from "../graph/node-modal/FieldLabel"; | ||
import { getValidationErrorsForField } from "../graph/node-modal/editors/Validators"; | ||
import { ActivityNodeParameters, ActivityParameterConfig } from "../../types/activity"; | ||
import { NodesDeploymentData } from "../../http/HttpService"; | ||
import { NodeValidationError } from "../../types"; | ||
import { default as EditableEditor } from "../graph/node-modal/editors/EditableEditor"; | ||
|
||
interface Props { | ||
nodeName: string; | ||
propertyName: string; | ||
propertyConfig: ActivityParameterConfig; | ||
nodesData: NodesDeploymentData; | ||
onChange: <K extends keyof ActivityNodeParameters["parameters"]>( | ||
nodeId: string, | ||
property: K, | ||
newValue: ActivityNodeParameters["parameters"][K], | ||
defaultValue?: ActivityNodeParameters["parameters"][K], | ||
) => void; | ||
errors: NodeValidationError[]; | ||
} | ||
|
||
export function ActivityProperty(props: Props): JSX.Element { | ||
const { nodeName, propertyName, propertyConfig, errors, nodesData, onChange } = props; | ||
|
||
const current = nodesData[nodeName][propertyName] || ""; | ||
const expressionObj = { expression: current, value: current, language: ExpressionLang.String }; | ||
const onValueChange = useCallback((newValue) => onChange(nodeName, propertyName, newValue), [onChange, nodeName, propertyName]); | ||
|
||
return ( | ||
<EditableEditor | ||
key={propertyName} | ||
param={propertyConfig} | ||
fieldLabel={propertyConfig.label || propertyName} | ||
onValueChange={onValueChange} | ||
expressionObj={expressionObj} | ||
renderFieldLabel={() => ( | ||
<FieldLabel title={propertyConfig.label} label={propertyConfig.label} hintText={propertyConfig.hintText} /> | ||
)} | ||
readOnly={false} | ||
showSwitch={false} | ||
showValidation={true} | ||
//ScenarioProperties do not use any variables | ||
variableTypes={{}} | ||
fieldErrors={getValidationErrorsForField(errors, propertyName)} | ||
/> | ||
); | ||
} |
26 changes: 26 additions & 0 deletions
26
designer/client/src/components/modals/AdvancedParametersSection.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React, { PropsWithChildren } from "react"; | ||
import Accordion from "@mui/material/Accordion"; | ||
import AccordionSummary from "@mui/material/AccordionSummary"; | ||
import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; | ||
import { Typography } from "@mui/material"; | ||
import AccordionDetails from "@mui/material/AccordionDetails"; | ||
|
||
interface Props { | ||
nodeId: string; | ||
} | ||
|
||
export function AdvancedParametersSection({ children, nodeId }: PropsWithChildren<Props>): JSX.Element { | ||
return ( | ||
<Accordion disableGutters elevation={0} sx={{ border: 0, "&::before": { display: "none" } }}> | ||
<AccordionSummary | ||
expandIcon={<ExpandMoreIcon sx={{ color: "inherit" }} />} | ||
aria-controls={`${nodeId}-content`} | ||
id={`${nodeId}-header`} | ||
sx={{ flexDirection: "row-reverse", border: 0 }} | ||
> | ||
<Typography>{nodeId}</Typography> | ||
</AccordionSummary> | ||
<AccordionDetails>{children}</AccordionDetails> | ||
</Accordion> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.