Skip to content

Commit

Permalink
Updating page to work with other changes (Azure Azure#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Baas-hub authored and chidozieononiwu committed Sep 26, 2022
1 parent 92bf5cc commit 9f53633
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Samples.cshtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
@page "{id?}/{revisionId?}"
@model APIViewWeb.Pages.Assemblies.UsageSamplePageModel
@using APIViewWeb.Helpers
@using APIViewWeb.Models
@{
Layout = "ReviewLayout";
ViewData["Title"] = "Usage Samples";
var userPreference = PageModelHelpers.GetUserPreference(Model._preferenceCache, User.GetGitHubLogin()) ?? new UserPreferenceModel();
ViewData["UserPreference"] = userPreference;
}
<link rel="stylesheet" href="~/usagesample.css">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class UsageSamplePageModel : PageModel
private const string ENDPOINT_SETTING = "Endpoint";
private readonly CommentsManager _commentsManager;
private readonly NotificationManager _notificationManager;
public readonly UserPreferenceCache _preferenceCache;

public string Endpoint { get; }
public ReviewModel Review { get; private set; }
Expand All @@ -41,13 +42,15 @@ public UsageSamplePageModel(
UsageSampleManager samplesManager,
ReviewManager reviewManager,
CommentsManager commentsManager,
NotificationManager notificationManager)
NotificationManager notificationManager,
UserPreferenceCache preferenceCache)
{
_samplesManager = samplesManager;
_reviewManager = reviewManager;
Endpoint = configuration.GetValue<string>(ENDPOINT_SETTING);
_commentsManager = commentsManager;
_notificationManager = notificationManager;
_preferenceCache = preferenceCache;
}

[FromForm]
Expand Down

0 comments on commit 9f53633

Please sign in to comment.