Skip to content

Commit 6510008

Browse files
committed
fix(frontend): style /statistics (not finished)
1 parent 01a7b3c commit 6510008

File tree

4 files changed

+44
-46
lines changed

4 files changed

+44
-46
lines changed

frontend/app/components/statistic-list/bar/component.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ export default class StatisticListBar extends Component {
1515

1616
get spentEffortsBarColor() {
1717
if (this.didFinishEffortsInBudget) {
18-
return "strong-success";
18+
return "before:bg-success";
1919
}
2020
if (this.didFinishEffortsOverBudget) {
21-
return "strong-danger";
21+
return "before:bg-danger";
2222
}
23-
return "";
23+
return "before:bg-primary";
2424
}
2525
}
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
<div class="statistic-list-bar-wrapper">
2-
1+
<div class="statistic-list-bar-wrapper h-5 [&>*]:w-full [&>*]:h-5 [&>*]:overflow-hidden [&>*]:before:block [&>*]:before:h-full [&>*]:before:w-full [&>*]:before:-translate-x-[calc((1-var(--value))*100%)] relative [&>*]:absolute">
32
<div
43
...attributes
5-
class="statistic-list-bar {{ this.spentEffortsBarColor }}"
4+
class="statistic-list-bar {{ this.spentEffortsBarColor }} before:rounded-r z-10"
65
{{style --value=(concat @value)}}
76
></div>
87
{{#if (and @remaining (lte @remaining 1))}}
98
<div
109
...attributes
11-
class="statistic-list-bar remaining
12-
{{if (gt @remaining @goal) 'danger' 'success'}}"
10+
class="statistic-list-bar remaining before:rounded-r
11+
{{if (gt @remaining @goal) 'before:bg-danger' 'before:bg-success'}}"
1312
{{style --value=(concat @remaining)}}
1413
></div>
1514
{{/if}}
1615
{{#if @goal}}
1716
<div
1817
...attributes
19-
class="statistic-list-bar-goal"
20-
{{style --goal=(concat (min "0.99" @goal))}}
18+
class="statistic-list-bar-goal before:border-dotted before:border-danger before:border-r-2"
19+
{{style --value=(concat (min "0.99" @goal))}}
2120
></div>
2221
{{/if}}
2322
</div>

frontend/app/components/statistic-list/template.hbs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div ...attributes>
22
{{#if @data.isRunning}}
3-
<div class="empty">
3+
<Empty>
44
<LoadingIcon />
5-
</div>
5+
</Empty>
66
{{else if @data.last.isError}}
7-
<div class="empty">
7+
<Empty>
88
<div>
99
<FaIcon @icon="bolt" @prefix="fas" />
1010
<h3>Oops... Something went wrong</h3>
@@ -14,25 +14,23 @@
1414
Please try refreshing the page.
1515
</p>
1616
</div>
17-
</div>
17+
</Empty>
1818
{{else if @missingParams}}
19-
<div class="empty">
20-
<div>
21-
<FaIcon @icon="magnifying-glass" @prefix="fas" />
22-
<h3>Missing filter parameters</h3>
23-
<p>{{this.missingParamsMessage}}</p>
24-
</div>
25-
</div>
19+
<Empty>
20+
<FaIcon @icon="magnifying-glass" @prefix="fas" />
21+
<h3>Missing filter parameters</h3>
22+
<p>{{this.missingParamsMessage}}</p>
23+
</Empty>
2624
{{else if (not @data.last.value)}}
27-
<div class="empty">
28-
<div>
29-
<FaIcon @icon="chart-bar" />
30-
<h3>No statistics to display</h3>
31-
<p>Maybe try loosening your filters</p>
32-
</div>
33-
</div>
25+
<Empty>
26+
<FaIcon @icon="chart-bar" />
27+
<h3>No statistics to display</h3>
28+
<p>Maybe try loosening your filters</p>
29+
</Empty>
3430
{{else}}
35-
<table class="table table-striped table--statistics">
31+
<table
32+
class="table table-striped table--statistics w-full table-collapse"
33+
>
3634
<thead>
3735
<tr>
3836
{{#each this.columns as |column|}}
@@ -59,15 +57,18 @@
5957
@containerSelector=".page-content--scroll"
6058
as |row|
6159
>
62-
<tr data-test-statistic-list-row>
60+
<tr
61+
data-test-statistic-list-row
62+
class="striped [&>*]:p-2 [&>*]:align-top [&>*]:leading-5"
63+
>
6364
{{#each this.columns as |column|}}
6465
<StatisticList::Column
6566
data-test-statistic-list-column
6667
@layout={{column.layout}}
6768
@value={{get row column.path}}
6869
/>
6970
{{/each}}
70-
<td>
71+
<td class="w-1/2">
7172
{{#let
7273
(or row.totalRemainingEffort row.mostRecentRemainingEffort)
7374
as |remainingEffort|
@@ -90,15 +91,14 @@
9091
<tfoot>
9192
<tr>
9293
{{#each this.columns as |column index|}}
93-
<td>
94+
<td class="p-2">
9495
<strong>
9596
{{#if (not index)}}
9697
Total:
9798
{{else if (eq column.title "Duration")}}
98-
<span class="total">{{humanize-duration
99-
this.total
100-
false
101-
}}</span>
99+
<span
100+
class="total border-double border-b-4"
101+
>{{humanize-duration this.total false}}</span>
102102
{{/if}}
103103
</strong>
104104
</td>
@@ -108,4 +108,4 @@
108108
</tfoot>
109109
</table>
110110
{{/if}}
111-
</div>
111+
</div>

frontend/app/statistics/template.hbs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,23 +191,22 @@
191191
</TaskSelection>
192192

193193
<div>
194-
<ul class="nav-tabs">
194+
<NavTabs class="flex">
195195
{{#each this.types as |t|}}
196-
<li>
197-
<a
198-
href="#"
196+
<NavTabs::Item>
197+
<NavTabs::A
199198
class={{if (eq t this.type) "active"}}
200199
{{on "click" (fn this.updateParam "type" t)}}
201200
>
202201
By
203202
{{t}}
204-
</a>
205-
</li>
203+
</NavTabs::A>
204+
</NavTabs::Item>
206205
{{/each}}
207-
</ul>
206+
</NavTabs>
208207
</div>
209208

210-
<div class="tab-content grid">
209+
<div class="tab-content grid h-full pt-3">
211210
<StatisticList
212211
class="grid-cell"
213212
@data={{this.data}}
@@ -218,4 +217,4 @@
218217
/>
219218
</div>
220219
</PagePermission>
221-
{{/if}}
220+
{{/if}}

0 commit comments

Comments
 (0)