Skip to content

Commit

Permalink
Merge f1b0454 into 104b4c0
Browse files Browse the repository at this point in the history
  • Loading branch information
samsmithnz committed Mar 7, 2024
2 parents 104b4c0 + f1b0454 commit 3a6c041
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions src/RepoGovernance.Web/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
TimeSpan ts = new();
string lastUpdated = "[unknown]";
string user = "[unknown]";
if (Model.SummaryItems.Count > 0)
if (Model.SummaryItems != null && Model.SummaryItems.Count > 0)
{
DateTime minDate = DateTime.Now;
DateTime maxDate = DateTime.Now;
Expand All @@ -27,6 +27,12 @@
lastUpdated = maxDate.ToString("dd-MMM-yyyy h:mm:sstt");
user = Model.SummaryItems[0].User;
}
else
{
Model.SummaryItems = new();
Model.SummaryRepoLanguages = new();
Model.IsContributor = true;
}
}

<div>
Expand All @@ -42,7 +48,6 @@
<span class="badge bg-primary">Total PRs: @Model.SummaryItems.Sum(x => x.PullRequests.Count)</span> &nbsp;
<span class="badge bg-primary">Total issues: @Model.SummaryItems.Sum(x => x.TotalRecommendationCount)</span>
</div>
<br />
</div>
<div class="col-md-6">
<h4>&nbsp;</h4>
Expand All @@ -58,7 +63,16 @@
}
}
</div>
<br />
</div>
</div>
<div class="row">
<div class="col-md-6">
@if (Model.IsContributor)
{
<a href="@Url.Action("UpdateAll", "Home", new { isContributor = Model.IsContributor })" class="lastUpdatedText">Update all. Warning- takes a ~minute</a>
<br />
<a href="@Url.Action("ApprovePRsForAllRepos", "Home", new { isContributor = Model.IsContributor })" class="lastUpdatedText">Approve all open PRs. Warning- takes a ~minute</a>
}
</div>
</div>
<div>
Expand Down Expand Up @@ -251,9 +265,9 @@
<br />
<div style="font-size:12px;">
<ul>
<li>Deprecated packages: @item.NuGetPackages.Count(n=>n.Type == "Deprecated")</li>
<li>Outdated packages: @item.NuGetPackages.Count(n=>n.Type == "Outdated")</li>
<li>Vulnerable packages: @item.NuGetPackages.Count(n=>n.Type == "Vulnerable")</li>
<li>Deprecated packages: @item.NuGetPackages.Count(n => n.Type == "Deprecated")</li>
<li>Outdated packages: @item.NuGetPackages.Count(n => n.Type == "Outdated")</li>
<li>Vulnerable packages: @item.NuGetPackages.Count(n => n.Type == "Vulnerable")</li>
</ul>
</div>
}
Expand Down Expand Up @@ -312,13 +326,4 @@
</div>
}
</div>
<div>
@if (Model.IsContributor)
{
<a href="@Url.Action("UpdateAll", "Home", new { isContributor = Model.IsContributor })" class="lastUpdatedText">Update all. Warning- takes a ~minute</a>

<br />
<a href="@Url.Action("ApprovePRsForAllRepos", "Home", new { isContributor = Model.IsContributor })" class="lastUpdatedText">Approve all open PRs. Warning- takes a ~minute</a>
}
</div>
</div>

0 comments on commit 3a6c041

Please sign in to comment.