Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move faultEventMenu.detailSectionTitle #636

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading