Skip to content

Commit c196be8

Browse files
committed
refactor(web-ts-results): minor improvements
Use template literals to build `id` strings. Refactor styles. Remove unnecessary nesting of tags.
1 parent c6892ed commit c196be8

File tree

7 files changed

+30
-49
lines changed

7 files changed

+30
-49
lines changed

webdriver-ts-results/src/App.css

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ select {
2424
font-size: 14px;
2525
}
2626

27+
.select-bar {
2728
background-color: #fafafa;
2829
border-top: 1px solid var(--border-color);
2930
border-bottom: 1px solid var(--border-color);
@@ -38,10 +39,6 @@ select {
3839
input + label {
3940
margin-left: 5px;
4041
}
41-
.hspan {
42-
display: inline-block;
43-
width: 10px;
44-
}
4542

4643
.panel-body .checkbox {
4744
margin-top: 5px;
@@ -77,21 +74,6 @@ table.results th {
7774
padding: 3px;
7875
border: 1px solid #ddd;
7976
}
80-
.top1 {
81-
background-color: #63bf7c;
82-
}
83-
.top2 {
84-
background-color: #d1d580;
85-
}
86-
.top3 {
87-
background-color: #ffec84;
88-
}
89-
.top4 {
90-
background-color: #fcaa78;
91-
}
92-
.top5 {
93-
background-color: #f9696c;
94-
}
9577
td {
9678
text-align: center;
9779
}
@@ -165,10 +147,10 @@ dd {
165147
}
166148

167149
.header-row {
150+
margin: 20px 0;
168151
display: flex;
169-
}
170-
.header-row > * {
171-
align-self: center;
152+
align-items: center;
153+
gap: 10px;
172154
}
173155

174156
.error {

webdriver-ts-results/src/App.tsx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ import { SelectionBar } from "./components/selection/SelectionBar";
77
const KnownIssuesList = () => {
88
return (
99
<>
10-
<h3>Known issues and notes</h3>
11-
{knownIssues.map((issue) => (
12-
<dl key={issue.issue.toFixed()} id={issue.issue.toFixed()}>
13-
<dt>
14-
<a target="_blank" rel="noopener noreferrer" href={issue.link}>
15-
{issue.issue.toFixed()}
16-
</a>
17-
</dt>
18-
<dd>{issue.text}</dd>
19-
</dl>
20-
))}
10+
<section>
11+
<h3>Known issues and notes</h3>
12+
{knownIssues.map((issue) => (
13+
<dl key={issue.issue.toFixed()} id={issue.issue.toFixed()}>
14+
<dt>
15+
<a target="_blank" rel="noopener noreferrer" href={issue.link}>
16+
{issue.issue.toFixed()}
17+
</a>
18+
</dt>
19+
<dd>{issue.text}</dd>
20+
</dl>
21+
))}
22+
</section>
2123
</>
2224
);
2325
};
@@ -56,15 +58,17 @@ const App = () => {
5658
);
5759

5860
return (
59-
<div>
61+
<>
6062
{disclaimer}
6163
{testEnvironmentInfo}
6264

63-
<SelectionBar showDurationSelection={false} />
64-
<ResultTable type={FrameworkType.KEYED} />
65-
<ResultTable type={FrameworkType.NON_KEYED} />
66-
<KnownIssuesList></KnownIssuesList>
67-
</div>
65+
<main>
66+
<SelectionBar showDurationSelection={false} />
67+
<ResultTable type={FrameworkType.KEYED} />
68+
<ResultTable type={FrameworkType.NON_KEYED} />
69+
<KnownIssuesList></KnownIssuesList>
70+
</main>
71+
</>
6872
);
6973
};
7074

webdriver-ts-results/src/components/selection/BenchmarkSelector/BenchmarkSelectorList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ const BenchmarkSelectorList = ({ benchmarks, isSelected, select }: Props) => {
1616
<div key={item.id} className="col-md-12">
1717
<div className="form-check">
1818
<input
19-
id={"inp-" + item.id}
19+
id={`inp-${item.id}`}
2020
className="form-check-input"
2121
type="checkbox"
2222
onChange={(evt) => select(item, evt.target.checked)}
2323
checked={isSelected(item)}
2424
/>
25-
<label htmlFor={"inp-" + item.id} className="form-check-label">
25+
<label htmlFor={`inp-${item.id}`} className="form-check-label">
2626
{item.label}
2727
</label>
2828
</div>

webdriver-ts-results/src/components/selection/FrameworkSelector/FrameworkSelectorList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ const FrameworkSelectorList = ({ frameworks, isSelected, select }: Props) => {
1616
<div key={item.name}>
1717
<input
1818
className="form-check-input"
19-
id={"inp-" + item.name + "-" + item.type}
19+
id={`inp-${item.name}-${item.type}`}
2020
type="checkbox"
2121
onChange={(evt) => select(item, evt.target.checked)}
2222
checked={isSelected(item)}
2323
/>
2424
<label
25-
htmlFor={"inp-" + item.name + "-" + item.type}
25+
htmlFor={`inp-${item.name}-${item.type}`}
2626
className="form-check-label"
2727
>
2828
{item.displayname}

webdriver-ts-results/src/components/selection/ModeSelector/DisplayModeSelector.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const DisplayModeSelector = ({ displayMode, onChange }: Props) => {
1010
return (
1111
<>
1212
<label htmlFor="displayMode">Display mode</label>
13-
<div className="hspan" />
1413
<select
1514
id="displayMode"
1615
className="custom-select"

webdriver-ts-results/src/components/selection/ModeSelector/DurationModeSelector.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const DurationModeSelector = ({ cpuDurationMode, onChange }: Props) => {
1212
<label htmlFor="durationMode">
1313
(Experimental) Duration measurement mode
1414
</label>
15-
<div className="hspan" />
1615
<select
1716
id="durationMode"
1817
className="custom-select"

webdriver-ts-results/src/components/selection/SelectionBar.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ export const SelectionBar = ({ showDurationSelection }: Props) => {
1212
console.log("SelectionBar");
1313

1414
return (
15-
<div className="selectBar">
15+
<div className="select-bar">
1616
<div className="header-row">
1717
<FrameworkSelector />
18-
<div className="hspan" />
1918
<BenchmarkSelector />
20-
<div className="hspan" />
2119
<ModeSelector showDurationSelection={showDurationSelection} />
22-
<div className="hspan" />
2320
<CopyPasteSelection />
2421
</div>
2522
</div>

0 commit comments

Comments
 (0)