Skip to content

Commit

Permalink
Merge pull request #636 from kbss-cvut/fix/632-fix-inconsitent-sectio…
Browse files Browse the repository at this point in the history
…n-title-style-in-event-and-fault-tree-dialogs

Move faultEventMenu.detailSectionTitle
  • Loading branch information
kostobog authored Oct 17, 2024
2 parents 92c2fdd + 4d41b64 commit 72e03f5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ import { Theme } from "@mui/material";
import { makeStyles } from "tss-react/mui";

const useStyles = makeStyles()((theme: Theme) => ({
menuTitle: {
backgroundColor: "#1976D256",
marginLeft: "-16px",
marginRight: "-16px",
paddingLeft: "8px",
borderBottom: "inset",
},
divForm: {
flexGrow: 1,
},
Expand Down
9 changes: 4 additions & 5 deletions src/components/dialog/faultEvent/FaultEventCreation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { FormControl, InputLabel, MenuItem, Select, TextField, Typography } from "@mui/material";
import { FormControl, InputLabel, MenuItem, Select, TextField } from "@mui/material";
import useStyles from "@components/dialog/faultEvent/FaultEventCreation.styles";
import { Controller } from "react-hook-form";
import { EventType, FaultEvent, GateType, gateTypeValues } from "@models/eventModel";
Expand Down Expand Up @@ -101,10 +101,6 @@ const FaultEventCreation = ({
}
return (
<>
<Typography variant="h6" className={classes.menuTitle} gutterBottom>
{`${t("faultEventMenu.detailSectionTitle")}`}
</Typography>
<br />
<ControlledAutocomplete
control={control}
name="existingEvent"
Expand All @@ -130,6 +126,7 @@ const FaultEventCreation = ({

{selectedEvent && (
<FormControl className={classes.formControl}>
<br />
<InputLabel id="event-type-select-label">{t("newFtaModal.type")}</InputLabel>
<Controller
render={({ field }) => {
Expand Down Expand Up @@ -173,6 +170,7 @@ const FaultEventCreation = ({
<>
{eventTypeWatch === EventType.INTERMEDIATE && (
<div className={classes.formControlDiv}>
<br />
<FormControl className={classes.formControl}>
<InputLabel id="gate-type-select-label">{t("newFtaModal.gateType")}</InputLabel>
<Controller
Expand Down Expand Up @@ -210,6 +208,7 @@ const FaultEventCreation = ({
!isRootEvent &&
isEditedEvent && (
<>
<br />
<TextField
margin="dense"
label={t("newFtaModal.description")}
Expand Down
2 changes: 2 additions & 0 deletions src/components/dialog/faultTree/FaultTreeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const FaultTreeDialog = ({ open, handleCloseDialog }) => {
{...register("faultTreeName")}
helperText={!!useFormMethods.formState.errors.faultTreeName && t("newFtaModal.noSystemError")}
/>
<br />
<br />
<ReusableFaultEventsProvider systemUri={selectedSystem?.iri}>
<FaultEventCreation useFormMethods={useFormMethods} isRootEvent={true} />
</ReusableFaultEventsProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ const useStyles = makeStyles()((theme: Theme) => ({
color: theme.main.grey,
padding: theme.spacing(10, 2),
},
menuTitle: {
backgroundColor: "#1976D256",
marginLeft: "-16px",
marginRight: "-16px",
paddingLeft: "8px",
borderBottom: "inset",
},
}));

// TODO jss-to-tss-react codemod: usages of this hook outside of this file will not be converted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ const FaultEventShapeToolPane = ({ data, refreshTree, formMethods }: Props) => {

const editorPane = (isDisabled) => (
<ReusableFaultEventsProvider treeUri={faultTree?.iri}>
<Typography variant="h6" className={classes.menuTitle} gutterBottom>
{`${t("faultEventMenu.detailSectionTitle")}`}
</Typography>
<br />
<FaultEventCreation
useFormMethods={formMethods}
isRootEvent={false}
Expand Down

0 comments on commit 72e03f5

Please sign in to comment.