-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new form with working deploy parameters
- Loading branch information
Showing
15 changed files
with
231 additions
and
69 deletions.
There are no files selected for viewing
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,33 @@ | ||
import { useSelector } from "react-redux"; | ||
import { getProcessName } from "../../reducers/selectors/graph"; | ||
import { Box, 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 ( | ||
<Box> | ||
<Typography variant={"inherit"} sx={{ width: "100%", "::after": { content: "':'" } }}> | ||
{props.title} | ||
</Typography> | ||
<Typography | ||
variant={"h5"} | ||
sx={{ | ||
width: "100%", | ||
fontWeight: "bold", | ||
margin: 0, | ||
lineHeight: "2em", | ||
}} | ||
> | ||
{processName} | ||
</Typography> | ||
{props.displayWarnings && <ProcessDialogWarnings />} | ||
</Box> | ||
); | ||
} |
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 />} | ||
aria-controls={`${nodeId}-content`} | ||
id={`${nodeId}-header`} | ||
sx={{ flexDirection: "row-reverse", px: 0, 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
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
Oops, something went wrong.