Skip to content

Commit

Permalink
reviews comment - change the property name - Done
Browse files Browse the repository at this point in the history
  • Loading branch information
nivedithaskywalk committed Feb 16, 2024
1 parent 564e24f commit 4251eb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/GitHubCostVisualizer.Web/Models/UsageReportViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ public class UsageReportViewModel

public class ActionMinutesItem
{
public string Repository { get; set; }
public string Label { get; set; }
public decimal Minutes { get; set; }
public decimal TotalCost { get; set; }
public string Workflow { get; set; }
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ group x by x.Repository
into grp
select new ActionMinutesItem
{
Repository = grp.Key,
Label = grp.Key,
Minutes = grp.Sum(i => (int)i.Quantity),
TotalCost = grp.Sum(i => i.Quantity.GetValueOrDefault() * i.Multiplier.GetValueOrDefault() * i.PricePer.GetValueOrDefault())
}).ToList();
Expand All @@ -49,7 +49,7 @@ into grp
select new ActionMinutesItem
{
Minutes = grp.Sum(i => (int)i.Quantity),
Workflow = ($"{grp.Key.Repository} - {grp.Key.TrimmedWorkflow}").ToString(),
Label = ($"{grp.Key.Repository} - {grp.Key.TrimmedWorkflow}").ToString(),
TotalCost = grp.Sum(i => i.Quantity.GetValueOrDefault() * i.Multiplier.GetValueOrDefault() * i.PricePer.GetValueOrDefault())
}).ToList();
Expand Down
6 changes: 3 additions & 3 deletions src/GitHubCostVisualizer.Web/Views/Home/_ActionDetail.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
@foreach (var item in Model.ActionMinutesByRepository)
{
<tr>
<td>@item.Repository</td>
<td>@item.Label</td>
<td data-sort="@item.Minutes">@item.Minutes minutes</td>
<td data-sort="@item.TotalCost">$@item.TotalCost</td>
</tr>
Expand All @@ -90,7 +90,7 @@
backgroundColor: getColors(@Model.ActionMinutesByRepository.Count, 'primary', 'dark', 'secondary', 'light')
}
],
labels: [@Html.Raw(String.Join(", ", Model.ActionMinutesByRepository.Select(m => $"'{m.Repository}'")))]
labels: [@Html.Raw(String.Join(", ", Model.ActionMinutesByRepository.Select(m => $"'{m.Label}'")))]
},
options: {
tooltips: {
Expand Down Expand Up @@ -121,7 +121,7 @@
@foreach (var item in Model.ActionMinutesByWorkflow)
{
<tr>
<td>@item.Workflow</td>
<td>@item.Label</td>
<td data-sort="@item.Minutes">@item.Minutes minutes</td>
<td data-sort="@item.TotalCost">$@item.TotalCost</td>
</tr>
Expand Down

0 comments on commit 4251eb2

Please sign in to comment.