Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 06bca3f

Browse files
authored
Merge pull request #817 from derrabauke/feat-remaining-effort-projects
feat(remaining-effort): add re feature to project statistics
2 parents 44b0a21 + 92b8ccf commit 06bca3f

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class="statistic-list-bar"
66
{{style --value=(concat @value)}}
77
></div>
8-
{{#if (and @remaining (lt @remaining 1))}}
8+
{{#if (and @remaining (lte @remaining 1))}}
99
<div
1010
...attributes
1111
class="statistic-list-bar remaining
@@ -17,7 +17,7 @@
1717
<div
1818
...attributes
1919
class="statistic-list-bar-goal"
20-
{{style --goal=(concat @goal)}}
20+
{{style --goal=(concat (min "0.99" @goal))}}
2121
></div>
2222
{{/if}}
2323
</div>

app/components/statistic-list/component.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ const COLUMN_MAP = {
3131
layout: DURATION_LAYOUT,
3232
},
3333
{ title: "Duration", path: "duration", layout: DURATION_LAYOUT },
34+
{
35+
title: "Remaining Effort",
36+
path: "totalRemainingEffort",
37+
layout: DURATION_LAYOUT,
38+
},
3439
],
3540
task: [
3641
{

app/components/statistic-list/template.hbs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,19 @@
6969
{{/each}}
7070
<td>
7171
{{#let
72-
(add row.duration row.mostRecentRemainingEffort)
73-
as |allotted|
72+
(or row.totalRemainingEffort row.mostRecentRemainingEffort)
73+
as |remainingEffort|
7474
}}
75-
<StatisticList::Bar
76-
@value={{div row.duration this.maxDuration}}
77-
@remaining={{div allotted this.maxDuration}}
78-
@goal={{min "0.99" (div row.estimatedTime this.maxDuration)}}
79-
/>
75+
{{#let
76+
(if remainingEffort (add row.duration remainingEffort) 0)
77+
as |allotted|
78+
}}
79+
<StatisticList::Bar
80+
@value={{div row.duration this.maxDuration}}
81+
@remaining={{div allotted this.maxDuration}}
82+
@goal={{div row.estimatedTime this.maxDuration}}
83+
/>
84+
{{/let}}
8085
{{/let}}
8186
</td>
8287
</tr>

tests/acceptance/statistics-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module("Acceptance | statistics", function (hooks) {
5050
test("can view statistics by project", async function (assert) {
5151
await visit("/statistics?type=project&customer=1");
5252

53-
assert.dom("thead > tr > th").exists({ count: 5 });
53+
assert.dom("thead > tr > th").exists({ count: 6 });
5454
assert.dom("tbody > tr").exists({ count: 5 });
5555
assert.dom("tfoot").includesText("Total");
5656
});

0 commit comments

Comments
 (0)