From 36f60aab27d906d2922acdd0ea9ef6a295f5e973 Mon Sep 17 00:00:00 2001 From: gskrobisz Date: Thu, 9 Jan 2025 16:24:52 +0100 Subject: [PATCH] revert mui --- .../modals/ActivityCommentTextField.tsx | 21 ---------- .../src/components/modals/ActivityHeader.tsx | 28 ------------- .../CalculateCounts/CalculateCountsDialog.tsx | 2 +- .../components/modals/DeployProcessDialog.tsx | 39 +++++++++++-------- .../modals/GenerateTestDataDialog.tsx | 2 +- .../components/modals/SaveProcessDialog.tsx | 18 ++++++--- .../toolbars/process/buttons/SaveButton.tsx | 4 +- .../buttons/CancelDeployButton.tsx | 2 +- .../scenarioActions/buttons/DeployButton.tsx | 2 +- .../buttons/RunOffScheduleButton.tsx | 2 +- .../src/windowManager/PromptContent.tsx | 9 +---- 11 files changed, 43 insertions(+), 86 deletions(-) delete mode 100644 designer/client/src/components/modals/ActivityCommentTextField.tsx delete mode 100644 designer/client/src/components/modals/ActivityHeader.tsx diff --git a/designer/client/src/components/modals/ActivityCommentTextField.tsx b/designer/client/src/components/modals/ActivityCommentTextField.tsx deleted file mode 100644 index 256808dc198..00000000000 --- a/designer/client/src/components/modals/ActivityCommentTextField.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { styled, TextField, TextFieldProps } from "@mui/material"; -import React from "react"; - -export const ActivityCommentTextField = styled((props: TextFieldProps) => ( - -))({ - flexDirection: "column", - ".MuiFormLabel-root": { - margin: 0, - flexDirection: "column", - }, -}); diff --git a/designer/client/src/components/modals/ActivityHeader.tsx b/designer/client/src/components/modals/ActivityHeader.tsx deleted file mode 100644 index 0829d9a22e9..00000000000 --- a/designer/client/src/components/modals/ActivityHeader.tsx +++ /dev/null @@ -1,28 +0,0 @@ -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 ( - <> - - {props.title} - - - {processName} - - {props.displayWarnings && } - - ); -} diff --git a/designer/client/src/components/modals/CalculateCounts/CalculateCountsDialog.tsx b/designer/client/src/components/modals/CalculateCounts/CalculateCountsDialog.tsx index 3a2f045e048..7391493f8c5 100644 --- a/designer/client/src/components/modals/CalculateCounts/CalculateCountsDialog.tsx +++ b/designer/client/src/components/modals/CalculateCounts/CalculateCountsDialog.tsx @@ -59,7 +59,7 @@ export function CountsDialog({ children, ...props }: PropsWithChildren { await confirm(); diff --git a/designer/client/src/components/modals/DeployProcessDialog.tsx b/designer/client/src/components/modals/DeployProcessDialog.tsx index 2eae9482915..f3ee8207db9 100644 --- a/designer/client/src/components/modals/DeployProcessDialog.tsx +++ b/designer/client/src/components/modals/DeployProcessDialog.tsx @@ -7,19 +7,19 @@ import { getActivityParameters, getProcessName } from "../../reducers/selectors/ import { getFeatureSettings } from "../../reducers/selectors/settings"; import { ProcessName } from "../Process/types"; import { PromptContent, WindowKind } from "../../windowManager"; +import CommentInput from "../comment/CommentInput"; +import ProcessDialogWarnings from "./ProcessDialogWarnings"; +import { FormHelperText, Typography } from "@mui/material"; import { LoadingButtonTypes } from "../../windowManager/LoadingButton"; import { ActivityNodeParameters } from "../../types/activity"; import { AdvancedParametersSection } from "./AdvancedParametersSection"; import { mapValues } from "lodash"; import { NodesDeploymentData } from "../../http/HttpService"; import { ActivityProperty } from "./ActivityProperty"; -import { ActivityCommentTextField } from "./ActivityCommentTextField"; -import { ActivityHeader } from "./ActivityHeader"; import { NodeTable } from "../graph/node-modal/NodeDetailsContent/NodeTable"; export type ToggleProcessActionModalData = { action: (processName: ProcessName, comment: string, nodeData: NodesDeploymentData) => Promise; - activityName: string; displayWarnings?: boolean; }; @@ -36,12 +36,12 @@ function initialNodesData(params: ActivityNodeParameters[]) { export function DeployProcessDialog(props: WindowContentProps): JSX.Element { // TODO: get rid of meta const { - meta: { action, activityName, displayWarnings }, + meta: { action, displayWarnings }, } = props.data; const processName = useSelector(getProcessName); const activityParameters = useSelector(getActivityParameters); - const activityNodeParameters = activityParameters[activityName] || ([] as ActivityNodeParameters[]); + const activityNodeParameters = activityParameters["DEPLOY"] || ([] as ActivityNodeParameters[]); const initialValues = useMemo(() => initialNodesData(activityNodeParameters), [activityNodeParameters]); const [values, setValues] = useState(initialValues); @@ -64,27 +64,32 @@ export function DeployProcessDialog(props: WindowContentProps [ - { - title: t("dialog.button.cancel", "Cancel"), - action: () => props.close(), - classname: LoadingButtonTypes.secondaryButton, - }, - { title: t("dialog.button.ok", "Apply"), action: () => confirmAction() }, + { title: t("dialog.button.cancel", "Cancel"), action: () => props.close(), classname: LoadingButtonTypes.secondaryButton }, + { title: t("dialog.button.ok", "Ok"), action: () => confirmAction() }, ], [confirmAction, props, t], ); return ( -
- - + {props.data.title} + {displayWarnings && } + setComment(e.target.value)} + value={comment} + defaultValue={deploymentCommentSettings?.exampleComment} + className={cx( + css({ + minWidth: 600, + minHeight: 80, + }), + )} autoFocus /> + + {validationError} + {activityNodeParameters.map((anp: ActivityNodeParameters) => ( diff --git a/designer/client/src/components/modals/GenerateTestDataDialog.tsx b/designer/client/src/components/modals/GenerateTestDataDialog.tsx index 764a8c30d50..08189d2120e 100644 --- a/designer/client/src/components/modals/GenerateTestDataDialog.tsx +++ b/designer/client/src/components/modals/GenerateTestDataDialog.tsx @@ -46,7 +46,7 @@ function GenerateTestDataDialog(props: WindowContentProps): JSX.Element { const buttons: WindowButtonProps[] = useMemo( () => [ { title: t("dialog.button.cancel", "Cancel"), action: () => props.close(), classname: LoadingButtonTypes.secondaryButton }, - { title: t("dialog.button.ok", "Apply"), disabled: !isValid, action: () => confirmAction() }, + { title: t("dialog.button.ok", "Ok"), disabled: !isValid, action: () => confirmAction() }, ], [t, confirmAction, props, isValid], ); diff --git a/designer/client/src/components/modals/SaveProcessDialog.tsx b/designer/client/src/components/modals/SaveProcessDialog.tsx index 1a30c17190d..de9299dd49e 100644 --- a/designer/client/src/components/modals/SaveProcessDialog.tsx +++ b/designer/client/src/components/modals/SaveProcessDialog.tsx @@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next"; import { useDispatch } from "react-redux"; import { displayCurrentProcessVersion, loadProcessToolbarsConfiguration } from "../../actions/nk"; import { PromptContent } from "../../windowManager"; +import { CommentInput } from "../comment/CommentInput"; import { ThunkAction } from "../../actions/reduxTypes"; import { getScenarioGraph, @@ -17,10 +18,9 @@ import HttpService from "../../http/HttpService"; import { ActionCreators as UndoActionCreators } from "redux-undo"; import { visualizationUrl } from "../../common/VisualizationUrl"; import { useLocation, useNavigate } from "react-router-dom"; +import { Typography } from "@mui/material"; import { LoadingButtonTypes } from "../../windowManager/LoadingButton"; import { getScenarioActivities } from "../../actions/nk/scenarioActivities"; -import { ActivityCommentTextField } from "./ActivityCommentTextField"; -import { ActivityHeader } from "./ActivityHeader"; export function SaveProcessDialog(props: WindowContentProps): JSX.Element { const location = useLocation(); @@ -71,7 +71,7 @@ export function SaveProcessDialog(props: WindowContentProps): JSX.Element { const buttons: WindowButtonProps[] = useMemo( () => [ { title: t("dialog.button.cancel", "Cancel"), action: () => props.close(), classname: LoadingButtonTypes.secondaryButton }, - { title: t("dialog.button.ok", "Apply"), action: () => confirmAction() }, + { title: t("dialog.button.ok", "Ok"), action: () => confirmAction() }, ], [confirmAction, props, t], ); @@ -79,8 +79,16 @@ export function SaveProcessDialog(props: WindowContentProps): JSX.Element { return (
- - setState(e.target.value)} autoFocus /> + {props.data.title} + setState(e.target.value)} + value={comment} + className={css({ + minWidth: 600, + minHeight: 80, + })} + autoFocus + />
); diff --git a/designer/client/src/components/toolbars/process/buttons/SaveButton.tsx b/designer/client/src/components/toolbars/process/buttons/SaveButton.tsx index 19812e0277a..44e25d994ee 100644 --- a/designer/client/src/components/toolbars/process/buttons/SaveButton.tsx +++ b/designer/client/src/components/toolbars/process/buttons/SaveButton.tsx @@ -17,8 +17,8 @@ function SaveButton(props: ToolbarButtonProps): JSX.Element { const unsavedNewName = useSelector(getProcessUnsavedNewName); const isRenamed = useSelector(isProcessRenamed); const title = isRenamed - ? t("saveProcess.renameTitle", "Save scenario as", { name: unsavedNewName }) - : t("saveProcess.title", "Save scenario", { name: processName }); + ? t("saveProcess.renameTitle", "Save scenario as {{name}}", { name: unsavedNewName }) + : t("saveProcess.title", "Save scenario {{name}}", { name: processName }); const { open } = useWindows(); const onClick = () => diff --git a/designer/client/src/components/toolbars/scenarioActions/buttons/CancelDeployButton.tsx b/designer/client/src/components/toolbars/scenarioActions/buttons/CancelDeployButton.tsx index cb6a24f891d..be1c506afa1 100644 --- a/designer/client/src/components/toolbars/scenarioActions/buttons/CancelDeployButton.tsx +++ b/designer/client/src/components/toolbars/scenarioActions/buttons/CancelDeployButton.tsx @@ -36,7 +36,7 @@ export default function CancelDeployButton(props: ToolbarButtonProps) { title: message, kind: WindowKind.deployProcess, width: ACTION_DIALOG_WIDTH, - meta: { action, activityName: "CANCEL" }, + meta: { action }, }) } type={type} diff --git a/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx b/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx index cd424cb5736..f6fa2e4e7de 100644 --- a/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx +++ b/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx @@ -57,7 +57,7 @@ export default function DeployButton(props: ToolbarButtonProps) { title: message, kind: WindowKind.deployProcess, width: ACTION_DIALOG_WIDTH, - meta: { action, activityName: "DEPLOY", displayWarnings: true }, + meta: { action, displayWarnings: true }, }) } onMouseOver={deployMouseOver} diff --git a/designer/client/src/components/toolbars/scenarioActions/buttons/RunOffScheduleButton.tsx b/designer/client/src/components/toolbars/scenarioActions/buttons/RunOffScheduleButton.tsx index f59d012d84f..599dff503f3 100644 --- a/designer/client/src/components/toolbars/scenarioActions/buttons/RunOffScheduleButton.tsx +++ b/designer/client/src/components/toolbars/scenarioActions/buttons/RunOffScheduleButton.tsx @@ -52,7 +52,7 @@ export default function RunOffScheduleButton(props: ToolbarButtonProps) { title: message, kind: WindowKind.deployProcess, width: ACTION_DIALOG_WIDTH, - meta: { action, activityName: "RUN_OFF_SCHEDULE" }, // fixme: activityName, do we need this? + meta: { action }, }) } type={type} diff --git a/designer/client/src/windowManager/PromptContent.tsx b/designer/client/src/windowManager/PromptContent.tsx index 511f5adfc08..37a76f38740 100644 --- a/designer/client/src/windowManager/PromptContent.tsx +++ b/designer/client/src/windowManager/PromptContent.tsx @@ -16,14 +16,7 @@ export function PromptContent(props: PropsWithChildren): JS paddingLeft: theme.custom.spacing.baseUnit * 6, paddingRight: theme.custom.spacing.baseUnit * 6, }); - return { - footer: css({ - justifyContent: "flex-end", - backgroundColor: "#1D2734", - }), - ...props.classnames, - content, - }; + return { ...props.classnames, content }; }, [props.classnames, theme.custom.spacing.baseUnit]); const components = useMemo(