-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- moved all Accordion controls to the Scenario component - unified syntax for component properties - Put sub-components into dedicated files - Removed (currently) unnecessary properties to avoid confusion
- Loading branch information
Robert Schüler
committed
May 3, 2024
1 parent
559f6ce
commit 556e47f
Showing
5 changed files
with
103 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {Box, Link, Typography} from "@mui/material"; | ||
import { ScenarioCaseModel, StepModel } from "../../reportModel"; | ||
import {ScenarioStep} from "./ScenarioStep"; | ||
|
||
export interface ScenarioCaseProps { | ||
className: string, | ||
scenarioCase: ScenarioCaseModel, | ||
} | ||
export function ScenarioCase({ | ||
scenarioCase, | ||
className, | ||
} : ScenarioCaseProps) { | ||
return ( | ||
<Box sx={{marginLeft: "2em"}}> | ||
{scenarioCase.steps.map((step: StepModel, index) => ( | ||
<ScenarioStep key={index} step={step}></ScenarioStep> | ||
))} | ||
<Typography align="right" variant="body2"> | ||
<Link | ||
href={`#class/${className}`} | ||
variant="inherit" | ||
color="inherit" | ||
underline="none" | ||
> | ||
{className} | ||
</Link> | ||
</Typography> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {processWords} from "../../wordProcessor"; | ||
import {Typography} from "@mui/material"; | ||
import {ScenarioCaption} from "./ScenarioCaption"; | ||
import {addRuntimeInSeconds} from "../utils"; | ||
import { StepModel } from "../../reportModel"; | ||
|
||
export interface ScenarioStepProps { | ||
step: StepModel; | ||
} | ||
|
||
export function ScenarioStep({ step }: ScenarioStepProps) { | ||
const stepDescription = processWords(step.words); | ||
return ( | ||
<Typography align={"left"}> | ||
{stepDescription} <ScenarioCaption>{addRuntimeInSeconds(step.durationInNanos)}</ScenarioCaption> | ||
</Typography> | ||
); | ||
} |