Skip to content

Commit

Permalink
Integrate MenuBar into Scenario Overview
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Oertel <christian.oertel@tngtech.com>
  • Loading branch information
fudler committed Oct 20, 2023
1 parent 933b04f commit 5db6942
Showing 1 changed file with 49 additions and 29 deletions.
78 changes: 49 additions & 29 deletions new/src/components/Scenarios/SingleScenarioView.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,60 @@
import { ReportStatistics, ScenarioCaseModel, ScenarioModel } from "../../reportModel";
import { ScenarioOverview } from "../ScenarioOverview/ScenarioOverview";
import {MenuBar, ScenarioOverview} from "../ScenarioOverview/ScenarioOverview";
import { Scenario } from "./Scenario";
import { useState } from "react";
import {Grid} from "@mui/material";

export function SingleScenarioView(props: { reportName: string; scenario: ScenarioModel }) {
const [expanded, setExpanded] = useState(false);
return (
<>
<ScenarioOverview
headers={{
aboveHeader: props.scenario.className,
header: props.scenario.description
}}
statistic={createStatistics(props.scenario)}
targets={{
minusButtonTarget: () => {
console.log("Collapsing stuff");
setExpanded(false);
},
plusButtonTarget: () => {
console.log("Expanding stuff");
setExpanded(true);
},
printButtonTarget: () => {
console.error("print not implemented");
},
bookmarkButtonTarget: () => {
console.error("bookmark not implemented");
}
}}
/>
<Scenario
reportName={props.reportName}
scenario={props.scenario}
accordionExpansion={{ expanded: expanded, setExpanded: setExpanded }}
></Scenario>
<Grid container>
<Grid item xs={12} md={1}>
<div style={{ height: '100vh'}}>
<MenuBar/>
</div>
</Grid>
<Grid item xs={12} md={11}>
<Grid container direction="column">
<Grid item xs={12}>
<div style={{ height: '20vh'}}>
<ScenarioOverview
headers={{
aboveHeader: props.scenario.className,
header: props.scenario.description
}}
statistic={createStatistics(props.scenario)}
targets={{
minusButtonTarget: () => {
console.log("Collapsing stuff");
setExpanded(false);
},
plusButtonTarget: () => {
console.log("Expanding stuff");
setExpanded(true);
},
printButtonTarget: () => {
console.error("print not implemented");
},
bookmarkButtonTarget: () => {
console.error("bookmark not implemented");
}
}}
/>
</div>
</Grid>
</Grid>
<Grid item xs={12}>
<div style={{ height: '50vh'}}>
<Scenario
reportName={props.reportName}
scenario={props.scenario}
accordionExpansion={{ expanded: expanded, setExpanded: setExpanded }}
></Scenario>
</div>
</Grid>
</Grid>
</Grid>
</>
);
}
Expand Down

0 comments on commit 5db6942

Please sign in to comment.