Skip to content

Commit

Permalink
update after npm run prettier:format
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasmadei committed Feb 29, 2024
1 parent d43dc0c commit 4e2d4c1
Show file tree
Hide file tree
Showing 16 changed files with 559 additions and 548 deletions.
32 changes: 15 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="manifest" href="/webmanifest.json" />
<!-- Runtime environment variables -->
<!-- With Vite, type must be text/javascript, see:
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="manifest" href="/webmanifest.json" />
<!-- Runtime environment variables -->
<!-- With Vite, type must be text/javascript, see:
https://stackoverflow.com/questions/70617812/change-environmet-variables-at-runtime-react-vite-with-docker-and-nginx-->
<script type="text/javascript" src="/config.js"></script>
<title>FTA/FMEA Analysis</title>
</head>

<body style="margin: 0">
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
<script type="text/javascript" src="/config.js"></script>
<title>FTA/FMEA Analysis</title>
</head>

</html>
<body style="margin: 0">
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion src/components/appBar/AppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const AppBar = ({ title, showBackButton = false, topPanelHeight }: Props) => {
const [loggedUser] = useLoggedUser();
const { classes } = useStyles();
const history = useNavigate();
const { i18n } = useTranslation()
const { i18n } = useTranslation();

const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
const isMenuOpen = Boolean(anchorEl);
Expand Down
16 changes: 8 additions & 8 deletions src/components/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';
import DashboardContentProvider from '@hooks/DashboardContentProvider';
import DashboardContent from '@components/dashboard/content/DashboardContent';
import * as React from "react";
import DashboardContentProvider from "@hooks/DashboardContentProvider";
import DashboardContent from "@components/dashboard/content/DashboardContent";

const Dashboard = () => {
return (
<DashboardContentProvider>
<DashboardContent />
</DashboardContentProvider>
);
return (
<DashboardContentProvider>
<DashboardContent />
</DashboardContentProvider>
);
};

export default Dashboard;
55 changes: 35 additions & 20 deletions src/components/dashboard/content/DashboardContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,41 @@ const DashboardContent = () => {
setCreateFmeaAggregateDialogOpen(true);
};

return (
<React.Fragment>
<SpeedDial
ariaLabel="SpeedDial Dashboard"
className={classes.speedDial}
icon={<SpeedDialIcon/>}
onClose={() => setSpeedDialOpen(false)}
onOpen={() => setSpeedDialOpen(true)}
open={speedDialOpen}
>
<SpeedDialAction key="speed-dial-action-new-table-aggregate" icon={<TableChartIcon/>} tooltipOpen
tooltipTitle={"Aggregated FMEA"} title={"Aggregated FMEA"}
onClick={handleNewFmeaAggregate}/>
<SpeedDialAction key="speed-dial-action-new-tree" icon={<NatureIcon/>} tooltipOpen
tooltipTitle={"Fault Tree"} title={"Fault Tree"}
onClick={handleNewFaultTree}/>
<SpeedDialAction key="speed-dial-action-new-system" icon={<FlightIcon/>} tooltipOpen
tooltipTitle={"System"} title={"System"}
onClick={handleNewSystem}/>
</SpeedDial>
return (
<React.Fragment>
<SpeedDial
ariaLabel="SpeedDial Dashboard"
className={classes.speedDial}
icon={<SpeedDialIcon />}
onClose={() => setSpeedDialOpen(false)}
onOpen={() => setSpeedDialOpen(true)}
open={speedDialOpen}
>
<SpeedDialAction
key="speed-dial-action-new-table-aggregate"
icon={<TableChartIcon />}
tooltipOpen
tooltipTitle={"Aggregated FMEA"}
title={"Aggregated FMEA"}
onClick={handleNewFmeaAggregate}
/>
<SpeedDialAction
key="speed-dial-action-new-tree"
icon={<NatureIcon />}
tooltipOpen
tooltipTitle={"Fault Tree"}
title={"Fault Tree"}
onClick={handleNewFaultTree}
/>
<SpeedDialAction
key="speed-dial-action-new-system"
icon={<FlightIcon />}
tooltipOpen
tooltipTitle={"System"}
title={"System"}
onClick={handleNewSystem}
/>
</SpeedDial>

<FaultTreeDialog open={createFaultTreeDialogOpen} handleCloseDialog={() => setCreateFaultTreeDialogOpen(false)} />
<SystemDialog open={createSystemDialogOpen} handleCloseDialog={() => setCreateSystemDialogOpen(false)} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,32 @@ const DashboardFailureModesTableList = () => {

const [renameDialogOpen, setRenameDialogOpen] = useState(false);

return (
<React.Fragment>
<ImageList className={classes.gridList} cols={6}>
{tables.map((mode) => {
const routePath = ROUTES.FMEA + `/${extractFragment(mode.iri)}`;
return (
<ImageListItem key={mode.iri} className={classes.gridListTile}>
<Card className={classes.card}>
<CardHeader
action={
<IconButton
aria-label="settings"
onClick={(e) => handleContextMenu(e, mode)}
size="large">
<MoreVertIcon/>
</IconButton>
}
title={mode.name}
/>
<CardActions disableSpacing>
<MaterialLink variant="button" component={RouterLink} to={routePath}>
Open
</MaterialLink>
</CardActions>
</Card>
</ImageListItem>
);
})}
</ImageList>
return (
<React.Fragment>
<ImageList className={classes.gridList} cols={6}>
{tables.map((mode) => {
const routePath = ROUTES.FMEA + `/${extractFragment(mode.iri)}`;
return (
<ImageListItem key={mode.iri} className={classes.gridListTile}>
<Card className={classes.card}>
<CardHeader
action={
<IconButton aria-label="settings" onClick={(e) => handleContextMenu(e, mode)} size="large">
<MoreVertIcon />
</IconButton>
}
title={mode.name}
/>
<CardActions disableSpacing>
<MaterialLink variant="button" component={RouterLink} to={routePath}>
Open
</MaterialLink>
</CardActions>
</Card>
</ImageListItem>
);
})}
</ImageList>

<FailureModeTableContextMenu
anchorPosition={contextMenuAnchor}
Expand Down
65 changes: 31 additions & 34 deletions src/components/dashboard/content/list/DashboardFaultTreeList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,40 +50,37 @@ const DashboardFaultTreeList = () => {

const [editDialogOpen, setEditDialogOpen] = useState(false);

return (
<React.Fragment>
<ImageList className={classes.gridList} cols={6}>
{faultTrees.map((tree) => {
const routePath = ROUTES.FTA + `/${extractFragment(tree.iri)}`;
return (
<ImageListItem key={tree.iri} className={classes.gridListTile}>
<Card className={classes.card}>
<CardHeader
classes={{content: classes.cardTitle}}
action={
<IconButton
aria-label="settings"
onClick={(e) => handleContextMenu(e, tree)}
size="large">
<MoreVertIcon/>
</IconButton>
}
title={
<Tooltip title={tree.name}>
<Typography variant="h5">{tree.name}</Typography>
</Tooltip>
}
/>
<CardActions disableSpacing>
<MaterialLink variant="button" component={RouterLink} to={routePath}>
Open
</MaterialLink>
</CardActions>
</Card>
</ImageListItem>
);
})}
</ImageList>
return (
<React.Fragment>
<ImageList className={classes.gridList} cols={6}>
{faultTrees.map((tree) => {
const routePath = ROUTES.FTA + `/${extractFragment(tree.iri)}`;
return (
<ImageListItem key={tree.iri} className={classes.gridListTile}>
<Card className={classes.card}>
<CardHeader
classes={{ content: classes.cardTitle }}
action={
<IconButton aria-label="settings" onClick={(e) => handleContextMenu(e, tree)} size="large">
<MoreVertIcon />
</IconButton>
}
title={
<Tooltip title={tree.name}>
<Typography variant="h5">{tree.name}</Typography>
</Tooltip>
}
/>
<CardActions disableSpacing>
<MaterialLink variant="button" component={RouterLink} to={routePath}>
Open
</MaterialLink>
</CardActions>
</Card>
</ImageListItem>
);
})}
</ImageList>

<FaultTreeContextMenu
anchorPosition={contextMenuAnchor}
Expand Down
65 changes: 31 additions & 34 deletions src/components/dashboard/content/list/DashboardSystemList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,40 +50,37 @@ const DashboardSystemList = () => {

const [editDialogOpen, setEditDialogOpen] = useState(false);

return (
<React.Fragment>
<ImageList className={classes.gridList} cols={6}>
{systems.map((system) => {
const routePath = ROUTES.SYSTEMS + `/${extractFragment(system.iri)}`;
return (
<ImageListItem key={system.iri} className={classes.gridListTile}>
<Card className={classes.card}>
<CardHeader
classes={{content: classes.cardTitle}}
action={
<IconButton
aria-label="settings"
onClick={(e) => handleContextMenu(e, system)}
size="large">
<MoreVertIcon/>
</IconButton>
}
title={
<Tooltip title={system.name}>
<Typography variant="h5">{system.name}</Typography>
</Tooltip>
}
/>
<CardActions disableSpacing>
<MaterialLink variant="button" component={RouterLink} to={routePath}>
Open
</MaterialLink>
</CardActions>
</Card>
</ImageListItem>
);
})}
</ImageList>
return (
<React.Fragment>
<ImageList className={classes.gridList} cols={6}>
{systems.map((system) => {
const routePath = ROUTES.SYSTEMS + `/${extractFragment(system.iri)}`;
return (
<ImageListItem key={system.iri} className={classes.gridListTile}>
<Card className={classes.card}>
<CardHeader
classes={{ content: classes.cardTitle }}
action={
<IconButton aria-label="settings" onClick={(e) => handleContextMenu(e, system)} size="large">
<MoreVertIcon />
</IconButton>
}
title={
<Tooltip title={system.name}>
<Typography variant="h5">{system.name}</Typography>
</Tooltip>
}
/>
<CardActions disableSpacing>
<MaterialLink variant="button" component={RouterLink} to={routePath}>
Open
</MaterialLink>
</CardActions>
</Card>
</ImageListItem>
);
})}
</ImageList>

<SystemContextMenu
anchorPosition={contextMenuAnchor}
Expand Down
51 changes: 27 additions & 24 deletions src/components/fmea/FmeaOverview.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
import React, { useState } from 'react';
import DashboardContentProvider from '@hooks/DashboardContentProvider';
import { Box, Button, Divider, Typography } from '@mui/material';
import DashboardFailureModesTableList from '@components/dashboard/content/list/DashboardFailureModesTableList';
import FailureModesTableAggregateDialog from '@components/dialog/failureModesTable/aggregate/FailureModesTableAggregateDialog';
import React, { useState } from "react";
import DashboardContentProvider from "@hooks/DashboardContentProvider";
import { Box, Button, Divider, Typography } from "@mui/material";
import DashboardFailureModesTableList from "@components/dashboard/content/list/DashboardFailureModesTableList";
import FailureModesTableAggregateDialog from "@components/dialog/failureModesTable/aggregate/FailureModesTableAggregateDialog";

const FmeaOverview = () => {
const [createFmeaAggregateDialogOpen, setCreateFmeaAggregateDialogOpen] = useState<boolean>(false);
const [createFmeaAggregateDialogOpen, setCreateFmeaAggregateDialogOpen] = useState<boolean>(false);

const handleDialogOpen = () => {
setCreateFmeaAggregateDialogOpen(true);
};
const handleDialogOpen = () => {
setCreateFmeaAggregateDialogOpen(true);
};

return (
<DashboardContentProvider>
<Box marginTop={3} marginLeft={2} marginRight={2}>
{/* TODO: Add to sep. component */}
<Box display='flex' flexDirection='row' justifyContent='space-between'>
<Typography variant='h5'>Fault Trees</Typography>
<Button variant='contained' onClick={handleDialogOpen}>
New fmea worksheet
</Button>
</Box>
return (
<DashboardContentProvider>
<Box marginTop={3} marginLeft={2} marginRight={2}>
{/* TODO: Add to sep. component */}
<Box display="flex" flexDirection="row" justifyContent="space-between">
<Typography variant="h5">Fault Trees</Typography>
<Button variant="contained" onClick={handleDialogOpen}>
New fmea worksheet
</Button>
</Box>

<DashboardFailureModesTableList />
<FailureModesTableAggregateDialog open={createFmeaAggregateDialogOpen} onClose={() => setCreateFmeaAggregateDialogOpen(false)} />
</Box>
</DashboardContentProvider>
);
<DashboardFailureModesTableList />
<FailureModesTableAggregateDialog
open={createFmeaAggregateDialogOpen}
onClose={() => setCreateFmeaAggregateDialogOpen(false)}
/>
</Box>
</DashboardContentProvider>
);
};

export default FmeaOverview;
Loading

0 comments on commit 4e2d4c1

Please sign in to comment.