Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/WR24' into WR24
Browse files Browse the repository at this point in the history
  • Loading branch information
l-1squared committed Mar 1, 2024
2 parents 612f20a + 490afae commit 991ba94
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 51 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
3 changes: 0 additions & 3 deletions new/src/components/ScenarioOverview/ScenarioHead.css

This file was deleted.

19 changes: 19 additions & 0 deletions new/src/components/ScenarioOverview/ScenarioHead.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { styled } from "@mui/material/styles";
import { Drawer, Link } from "@mui/material";

export const StyledDrawer = styled(Drawer)({
// width: 240,
flexShrink: 0,
"& .MuiDrawer-paper": {
backgroundColor: "rgba(250,250,250,255)"
}
});

export const StyledContent = styled("div")(({ theme }) => ({
flexGrow: 1,
padding: theme.spacing(3)
}));

export const StyledLink = styled(Link)({
cursor: "pointer"
});
48 changes: 9 additions & 39 deletions new/src/components/ScenarioOverview/ScenarioHead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Breadcrumbs,
Button,
Divider,
Drawer,
Grid,
Link,
List,
Expand All @@ -23,9 +22,8 @@ import BookmarkOutlinedIcon from "@mui/icons-material/BookmarkOutlined";
import { createReportCircle } from "./DonutChart";
import React, { MouseEventHandler } from "react";
import { processWords } from "../../wordProcessor";
import { styled } from "@mui/material/styles";
import { useSearchParams } from "react-router-dom";
import "./ScenarioHead.css";
import { StyledContent, StyledDrawer, StyledLink } from "./ScenarioHead.styles";

export interface ScenarioOverviewProps {
statistic: ReportStatistics;
Expand All @@ -46,23 +44,10 @@ interface Headers {
belowHeader?: string;
}

const StyledDrawer = styled(Drawer)({
// width: 240,
flexShrink: 0,
"& .MuiDrawer-paper": {
backgroundColor: "rgba(250,250,250,255)"
}
});

const Content = styled("div")(({ theme }) => ({
flexGrow: 1,
padding: theme.spacing(3)
}));

export function ScenarioHead(props: ScenarioOverviewProps) {
return (
<div style={{ display: "flex" }}>
<Content>
<StyledContent>
<List>
<ListItem>
<Grid
Expand All @@ -89,7 +74,7 @@ export function ScenarioHead(props: ScenarioOverviewProps) {
<canvas id={"symbol-canvas"} width={"50"} height={"2"} />
</ListItem>
</List>
</Content>
</StyledContent>
</div>
);
}
Expand Down Expand Up @@ -125,21 +110,6 @@ export function MenuBar() {
{/* Workshop: Use forEach to implement missing subitems. */}
<ListItem>
<ListItemText primary={<Typography variant="h6">TAGS</Typography>} />
<List>
<ListItem>
<ListItemText
primary={
<Link
href="http://localhost:3000?tag=mytag"
underline="none"
sx={{ color: "inherit" }}
>
mytag
</Link>
}
/>
</ListItem>
</List>
</ListItem>
<ListItem>
<ListItemText primary={<Typography variant="h6">CLASSES</Typography>} />
Expand Down Expand Up @@ -242,33 +212,33 @@ function StatisticBreadcrumbs(props: { statistic: ReportStatistics }) {

return (
<Breadcrumbs separator=" " aria-label="breadcrumb">
<Link
<StyledLink
underline="hover"
className="pseudo-link"
color={"black"}
onClick={() => setUrlSearchParams({ result: ScenarioStatusFilter.SUCCESS })}
>
<CheckIcon sx={{ mr: 0.5 }} fontSize={"small"} />
{props.statistic.numSuccessfulScenarios} Successful,
</Link>
<Link
</StyledLink>
<StyledLink
underline="hover"
className="pseudo-link"
color={"red"}
onClick={() => setUrlSearchParams({ result: ScenarioStatusFilter.FAILURE })}
>
<ErrorIcon sx={{ mr: 0.5 }} fontSize={"small"} />
{props.statistic.numFailedScenarios} failed,
</Link>
<Link
</StyledLink>
<StyledLink
underline="hover"
className="pseudo-link"
color={"grey"}
onClick={() => setUrlSearchParams({ result: ScenarioStatusFilter.PENDING })}
>
<DoNotDisturbAltIcon sx={{ mr: 0.5 }} fontSize={"small"} />
{props.statistic.numPendingScenarios} pending,
</Link>
</StyledLink>
<Typography color="text.primary">{props.statistic.numScenarios} Total</Typography>
<Typography color={"text.primary"}>{addRuntime(props.statistic)}</Typography>
</Breadcrumbs>
Expand Down
21 changes: 12 additions & 9 deletions new/src/components/Scenarios/ScenarioOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,21 @@ export function ScenarioOverview(props: {
}

function createStatistics(scenarios: ScenarioModel[]): ReportStatistics {
const allCases = scenarios.flatMap((scenario) => scenario.scenarioCases);
const allSteps = allCases.flatMap((scenarioCase) => {scenarioCase.steps});
const failedCases = allCases.filter((scenarioCase) => scenarioCase.status === "FAILED" );

const failedScenarios = scenarios.filter((scenario) => scenario.scenarioCases.some((scenarioCase) => scenarioCase.status === "FAILED"));
const pendingScenarios = scenarios.filter((scenario) => scenario.scenarioCases.some((scenarioCase) => scenarioCase.status === "SOME_STEPS_PENDING" || scenarioCase.status === "SCENARIO_PENDING"));
return {
numClasses: 1,
numScenarios: 1,
// numFailedScenarios: Math.sign(
// findNumberOfCasesWithStatus(scenario.scenarioCases, "FAILED")
// ),
numFailedScenarios: 1,
numCases: 1, //scenario.scenarioCases.length,
numFailedCases: 1, //findNumberOfCasesWithStatus(scenario.scenarioCases, "FAILED"),
numSteps: 1, //scenario.scenarioCases.map(value => value.steps.length).reduce(sum),
numScenarios: scenarios.length,
numFailedScenarios: failedScenarios.length,
numCases: allCases.length,
numFailedCases: failedCases.length,
numSteps: allSteps.length,
durationInNanos: 1, //scenario.durationInNanos,
numPendingScenarios: 1,
numPendingScenarios: pendingScenarios.length,
//Math.sign(
// findNumberOfCasesWithStatus(scenario.scenarioCases, "SCENARIO_PENDING")
//),
Expand Down

0 comments on commit 991ba94

Please sign in to comment.