Skip to content

Commit 009aed9

Browse files
Baas-hubchidozieononiwu
authored andcommitted
parent 2d7456e
author Baas-hub <[email protected]> 1659925517 +1200 committer Chidozie Ononiwu <[email protected]> 1663964726 -0700 parent 2d7456e author Baas-hub <[email protected]> 1659925517 +1200 committer Chidozie Ononiwu <[email protected]> 1663964615 -0700 Adding Usage Sample page and Models for Azure#285 Continued advancements on adding usage samples. Milestone step for Azure#285: Capability to upload via file or text input, and remove samples. Minor refactor and tidy of backend code. Adding Markdown to HTML parsing for display Comments in bugged state. Going to experiment with new method of construction that may make them easier to manage. Inline comments semi-working Updated CONTRIBUTING.md and altered styling minimally. Syntax highlighting added for Azure#285 Added editable samples Added revisions to samples Minor finalizing changes Remvoing suggested inputs from revision labels Requested changes Changing wording as suggested Revert "Remvoing suggested inputs from revision labels" This reverts commit 0b96946. Undoing bad push Sandboxing changes: create apireview gen pipeline (Azure#3347) * APIView sandboxing pipeline yaml to generate api review file Bump Azure.Storage.Blobs (Azure#3750) Bumps [Azure.Storage.Blobs](https://github.com/Azure/azure-sdk-for-net) from 12.8.0 to 12.13.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](Azure/azure-sdk-for-net@Azure.Storage.Blobs_12.8.0...Azure.Storage.Blobs_12.13.0) --- updated-dependencies: - dependency-name: Azure.Storage.Blobs dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump Azure.Storage.Blobs (Azure#3749) Bumps [Azure.Storage.Blobs](https://github.com/Azure/azure-sdk-for-net) from 12.8.0 to 12.13.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](Azure/azure-sdk-for-net@Azure.Storage.Blobs_12.8.0...Azure.Storage.Blobs_12.13.0) --- updated-dependencies: - dependency-name: Azure.Storage.Blobs dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Bump Azure.Storage.Blobs in /src/dotnet/APIView/APIViewTest (Azure#3732) Bumps [Azure.Storage.Blobs](https://github.com/Azure/azure-sdk-for-net) from 12.0.0 to 12.13.0. Bump MacOs version to macos-11 (Azure#3753) Resolve Azure#3715 Tracking issue: actions/runner-images#5583 Introduced codeowner-extractor. (Azure#3719) * Introduced codeowner-extractor. * Refactor using implicit principal and vault based config (Azure#3751) * Refactor using implicit principal and vault based config * Cleanup logging and skipping logic in Processor. Use bulk github user mapping api. * Avoid using arrays with IConfiguration * Improve logging in GitHubToAADConverter and pipeline owner extractor Co-authored-by: Nicholi Harris <[email protected]> Co-authored-by: Patrick Hallisey <[email protected]> Set net core version for pipeline-owners-extractor (Azure#3771) APIVIew - Make GitHub token optional (Azure#3757) * Make github token optional when testing locally Update sandboxing pipeline to send request to APIView (Azure#3775) * Update sandboxing pipeline to send request to APIView Revert Accidentally Broken Sample assets (Azure#3776) * reverting assets.json to ensure tests continue succeeding Update nuget dependencies for pipeline witness (Azure#3745) Return 401 error code if org info is not available for PR owner (Azure#3778) * Return 401 error code if org info is not available for PR owner [Perf] Display results with 4 significant figures (Azure#3770) - Fixes Azure#3554 Remove build log queue based fanout (Azure#3789) Add pipeline-owners-extraction pipeline (Azure#3784) * Add pipeline-owners-extraction pipeline Fix misleading step name in az module install (Azure#3787) The name of this step is misleading and needed renaming. Server changes to create manual and upgrade required API reviews using pipeline(sandboxing) (Azure#3774) * Generate reviews using sandboxing pipeline docs: add disclaimer and specificity (Azure#3796) Co-authored-by: Dohyun Kim <[email protected]> Co-authored-by: Jeesang Kim <[email protected]> Co-authored-by: Dohyun Kim <[email protected]> Co-authored-by: Jeesang Kim <[email protected]> Add code owner processing to PipelineWitness (Azure#3742) Add kusto schema for tables and views (Azure#3425) Add Option for Hiding Left Navigation (Azure#3686) * Add option for hiding left navigation * Improve reviews page command bar * Persist page settings as user preferences * Smart update cache * Add auto mapper for mapping between models Fix issue when uploading json file to APIView (Azure#3800) Feature/3465 support for java variants (Azure#3797) Added Variant field to reviews and codefiles for different language variants Improving Java reference docs in apiview Fix label case in review dropdown (Azure#3814) Fix bad path to sample matrix json (Azure#3765) [perf] Right-align numerical values in tables (Azure#3802) - Change percentages from two to one decimal place, since our results are not stable enough to justify two decimals - Update sample results to 4 significant figures - Fixes Azure#3703 Fetch all reviews when running background tasks (Azure#3818) Feature/import warnings (Azure#3648) * update class names * docs * tests * fixme * change to convention * only allow imports from transport * spacing * naming * better naming * typo in tests * update linter names * fix test (please) * better class name Create API review using modules in consistent order (Azure#3832) * Create API review using modules in consistent order Update Python parser version and Python version to match version used by CI (Azure#3833) Add link checking for stress CI (Azure#3826) * Add link checking for stress CI * Remove region segment from stress testing links Add `RegexEntrySanitizer` (Azure#3807) * add RegexEntrySanitizer and accompanying tests * Update tools/test-proxy/Azure.Sdk.Tools.TestProxy/Sanitizers/RegexEntrySanitizer.cs Fix example group (Azure#3845) * fix: reuse m4 operation group to group examples * build: release @autorest/testmodeler_v2.3.1 [Pylint] adding in TypeError to exception for next() if type cant be inferred (Azure#3843) * adding in TypeError to exception for next() if type cant be inferred * update version * fix paging test * pass -> return so that on exceptions we dont throw a warning * fixing merge conflict * spacing: * spacing Bump Azure.Storage.Blobs (Azure#3729) Bumps [Azure.Storage.Blobs](https://github.com/Azure/azure-sdk-for-net) from 12.6.0 to 12.13.0. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](Azure/azure-sdk-for-net@Azure.Storage.Blobs_12.6.0...Azure.Storage.Blobs_12.13.0) --- updated-dependencies: - dependency-name: Azure.Storage.Blobs dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Updating Proxy Dev Cert (Azure#3860) support creating go apiview in pipeline (Azure#3878) * support creating go apiview in pipeline * format Vendor CrossPlat PemReader from azure-core (Azure#3882) * standardize line endings for RecordingHandler.cs. Update pem to an expired certificate that should be valid crossplat. remove trial RemoveOnLinuxFact * use vendored internal-only azure-core classes for loading a X509Certificate2 from the TLS Certificate input string. [check-enforcer] Remove unused dependency Azure.Storage.Blobs (Azure#3890) [Python APIView] Add error diagnostic if pylint parsing fails rather than fail APIView (and thus CI) (Azure#3884) * Make pylint parsing failure create an APIView error instead of failing the tool (and thus CI). * Closes Azure#3842. Update CODEOWNERS (Azure#3891) - Remove previous owners - Sort tools dirs alphabetically - Add owners for perf-automation and CODEOWNERS new pipeline for codegen (Azure#3375) * new pipeline for codegen * bugfix: taskresult is required, check exist before prepare sourcecode * Simplify Judgment Conditions * delete unnecessary variable * separate artifacts from total one to three part * move mkdir out of loop for it has the same path * may not generate artifact so event task failed, the pipeline should continue next task * use pr number to checkout swagger repo * [bugfix] fix missed parameter * delete test code * pipeline support use swagger pr to checkout spec repo * try upload logs file to artifact even sdk generation failed * debug for pipeline * build dpg * codegen pipeline support java dpg * add release pipeline name and build type in result * use azure-sdk account for create sdk pr * support add ex cmd for docker * event generate and build stage failed, try to upload source code and artifact * don't exit 1 event generate cmd return 1 * use one token for all git cmd * set sdk url by variable * use env variable to control whether to show debug info * remove hard code branch * roll back for debug * test * set basedir for git wapper * lint fix * update js ci test repo commitid * lint fix Update docs/trusting-cert-per-language for Mac troubleshooting (Azure#3739) * update docs/trusting-cert-per-language for Mac troubleshooting * fix images under the _images folder Co-authored-by: ponopono0322 <[email protected]> [Test-Proxy] Add Optional Specificity to the TLSValidationCert (Azure#3894) * add optional specificity to the hostname [Python APIView] Fix issue with duplicated diagnostics (Azure#3908) * Troubleshoot issue * Bump pylint-guidelines-checker version. * Fixes Azure#3712. Update CHANGELOG.md (Azure#3921) updated targeted proxy version to one that properly allows consumption of TLS certificates (Azure#3945) docker manifest deployment honors stabletags option (Azure#3913) Remove duplicate PR API review revisions (Azure#3949) * Remove duplicate pull request API review revisions Improvements around aliased types (Azure#3940) * Improvements around aliased types Issue a diagnostic error if an exported, aliased type contains nested types that aren't exported from the same package. Include methods for aliased types in the source package. Removed references to ioutil as it's been deprecated. * skip unexported fields * handle arrays * fix happy line * little more refinement * refine per feedback * array with pointer-to-type * add tests Sync azure-dev (Azure#3931) [Perf] Update storage GA package versions (Azure#3959) Feature/3810 replace language image references with css (Azure#3876) Replace language icon conditionals with CSS classes with background-image fix bug: miss autorest command in _meta (Azure#3966) Co-authored-by: Wei Dong <[email protected]> upgrade version (Azure#3967) Co-authored-by: Wei Dong <[email protected]> Explicit Error Message for Mismatch BEGIN and END Aliases (Azure#3889) Explicit Error Message for Mismatch BEGIN and END Aliases Fix issue with read-only properties. (Azure#3961) Add dark theme for APIView (Azure#3747) * Add dark theme for APIView * Add button for switching themes * persist Dark Theme * Allow Updates to UserPreference on all Pages * Handle cases where preference model is null * Fix colors for popover codesnippet-maven-plugin Performance Improvements (Azure#3970) Pipeline to covert manual JS reviews to code file (Azure#3897) add admin label to scheduler project (Azure#3974) eng-common sync is running on hosted pools (Azure#3863) Fix codesnippet-maven-plugin Bug with Full Class Codesnippets (Azure#3979) js apiview parser build pipeline (Azure#3847) * Pipeline yaml to build and publish JS APIView parser Block non-abstract transport imports (Azure#3930) * block transport imports * use separate rule * register linter * styling * fix comments * readme * typos Removes excess newlines Updating page to work with other changes (Azure Azure#285) Adding comment note for suppression reasoning. Suppressing warnings for dependencies in Azure#285 Changing "sample" to "revision" to account for new revision system add option --explicit-types to allow customize tagged types in exported code model. (Azure#3976) * explicti-types * changelog * lint * fix-swaggerpath * fix * use operation response schema * changelog * publish Only skip /internal sub-directories (Azure#3993) Allows support for the poorly named "internal" module. [Perf] Update EventHubs package versions (Azure#3995) clone sdk repo in grow up scenario (Azure#3667) * save * clone sdk repo in grow up scenario * lint fix * doc fix * clone spec repo in grow up * add skip-generation param in rerunning task * update doc * mute output * add new param --is-public-repo * lint * result change * fix test Co-authored-by: Wei Dong <[email protected]> Remove Duplicate Event Listener Code (Azure#3987) * Remove duplicate event listener code * Ensure that js files are not cached Initial integration tests (Azure#3932) * Initial integration test * Add Restore Tests * Update TODO in GitProcessHandler Update stress readme to remove misleading sections (Azure#4003) [Perf] Add pipeline to validate changes to perf-automation (Azure#3874) - Fixes Azure#3559 stress status dashboard update (Azure#3998) * stress status dashboard update * Adding back log analytics in stress dashboard * delete comment Add integration reset tests (Azure#4013) * Add integration reset tests * Updates based upon feedback Hiding warning for ColorCode inclusion Removing unused variable causing build failure Reduce throttling by adding distributed locks (Azure#3973) * Add async locks * Add cosmos initialization and secrets resolution * Increate queue worker count in prod to 10 per instance Support language-specific CSS files Azure#3464 (Azure#3978) Support language-specific CSS files Co-authored-by: Jonathan Giles <[email protected]> Adding Solarized Dark theme (Azure#4005) * Tweaking error/warning banner colors * Minor adjustments to style based on fast pass feedback Adding missed comma Feature/2389 show reference docs for specific method class (Azure#3941) Reference doc code folding feature - fully implemented Adding Java-Specific typekinds Azure#3463 (Azure#3988) Adding accomodation for new features Adding authorization, Modifying to soft deletes, Tidying unused code, and refactoring backend systems for revisions Remove a few extra properties Bugfixing deleting last revision not properly deleting, updating styles Cleaner error handling for blob/container misconfiguration Adding usage samples comments to conversation page Adding icons to usage sample buttons Updating for feedback. (Remove excess check and fix indentation) Removing old code and implementing feedback
1 parent d03098f commit 009aed9

40 files changed

+1654
-34
lines changed

src/dotnet/APIView/APIViewWeb/APIViewWeb.csproj

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="11.0.0" />
2727
<PackageReference Include="Azure.Storage.Blobs" Version="12.13.0" />
2828
<PackageReference Include="CsvHelper" Version="27.2.1" />
29+
<!-- Adding NU1701 suppression as these three libraries have not updated to more modern versions of .net, although in testing they work as required. -->
30+
<PackageReference Include="Markdig" Version="0.30.3">
31+
<NoWarn>NU1701</NoWarn>
32+
</PackageReference>
33+
<PackageReference Include="Markdig.SyntaxHighlighting" Version="1.1.7">
34+
<NoWarn>NU1701</NoWarn>
35+
</PackageReference>
36+
<PackageReference Include="ColorCode.Portable" Version="1.0.3">
37+
<NoWarn>NU1701</NoWarn>
38+
</PackageReference>
2939
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.12.0-beta4" />
3040
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.26.1" />
3141
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.0" />
@@ -37,7 +47,6 @@
3747
<PackageReference Include="Microsoft.VisualStudio.Services.Client" Version="16.170.0" />
3848
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.9" PrivateAssets="All" />
3949
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01" PrivateAssets="All" />
40-
<PackageReference Include="Markdig.Signed" Version="0.30.2" />
4150
<PackageReference Include="Octokit" Version="3.0.0" />
4251
<PackageReference Include="Sendgrid" Version="9.12.0" />
4352
</ItemGroup>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using Microsoft.AspNetCore.Authorization;
5+
6+
namespace APIViewWeb
7+
{
8+
public class UsageSampleOwnerRequirement : IAuthorizationRequirement
9+
{
10+
protected UsageSampleOwnerRequirement()
11+
{
12+
}
13+
14+
public static UsageSampleOwnerRequirement Instance { get; } = new UsageSampleOwnerRequirement();
15+
}
16+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Authorization;
6+
7+
namespace APIViewWeb
8+
{
9+
public class UsageSampleOwnerRequirementHandler : IAuthorizationHandler
10+
{
11+
public Task HandleAsync(AuthorizationHandlerContext context)
12+
{
13+
foreach (var requirement in context.Requirements)
14+
{
15+
if (requirement is UsageSampleOwnerRequirement)
16+
{
17+
if (((UsageSampleRevisionModel)context.Resource).CreatedBy == context.User.GetGitHubLogin())
18+
{
19+
context.Succeed(requirement);
20+
}
21+
}
22+
}
23+
return Task.CompletedTask;
24+
}
25+
}
26+
}

src/dotnet/APIView/APIViewWeb/CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Create following Azure resources in your Azure subscription.
5959
#### Azure storage account
6060

6161
- Create a storage account in Azure. [Azure storage account](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-portal)
62-
- Create two blob storage containers with names as follows within the storage account created in previous step: `originals` and `codefiles`
62+
- Create three blob storage containers with names as follows within the storage account created in previous step: `originals`, `codefiles`, and `usagesamples`
6363

6464
#### Azure Cosmos DB
6565
- Create a Cosmos DB account in Azure and then create a database with name `APIView` in this account. Once database is created successfully then create three containers in `APIView` database. Following are the list of containers and partition key for each of them. Partition key is case sensitive.
@@ -69,6 +69,7 @@ Create following Azure resources in your Azure subscription.
6969
| Reviews | /id |
7070
| Comments | /ReviewId |
7171
| PullRequests | /PullRequestNumber |
72+
| UsageSamples | /ReviewId |
7273

7374

7475

src/dotnet/APIView/APIViewWeb/Client/css/site.scss

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,71 @@ code {
871871
background: url(/icons/json-original.svg) center center no-repeat;
872872
}
873873

874+
.icon-swagger {
875+
background: url(/icons/swagger-original.svg) center center no-repeat;
876+
}
877+
878+
.icon-chevron-right {
879+
background: url(/icons/chevron-right.svg) center center no-repeat;
880+
}
881+
882+
.icon-chevron-up {
883+
background: url(/icons/chevron-up.svg) center center no-repeat;
884+
}
885+
886+
.icon-language {
887+
width: 34px;
888+
height: 34px;
889+
}
890+
891+
.icon-csharp {
892+
background: url(/icons/csharp-original.svg) center center no-repeat;
893+
}
894+
895+
.icon-javascript {
896+
background: url(/icons/javascript-original.svg) center center no-repeat;
897+
}
898+
899+
.icon-python {
900+
background: url(/icons/python-original.svg) center center no-repeat;
901+
}
902+
903+
.icon-c {
904+
background: url(/icons/c-original.svg) center center no-repeat;
905+
}
906+
907+
.icon-cplusplus {
908+
background: url(/icons/cplusplus-original.svg) center center no-repeat;
909+
}
910+
911+
.icon-go {
912+
background: url(/icons/go-original.svg) center center no-repeat;
913+
}
914+
915+
.icon-java {
916+
background: url(/icons/java-original.svg) center center no-repeat;
917+
}
918+
919+
.icon-java-spring {
920+
background: url(/icons/java-spring-original.svg) center center no-repeat;
921+
}
922+
923+
.icon-java-android {
924+
background: url(/icons/java-android-original.svg) center center no-repeat;
925+
}
926+
927+
.icon-swift {
928+
background: url(/icons/swift-original.svg) center center no-repeat;
929+
}
930+
931+
.icon-kotlin {
932+
background: url(/icons/kotlin-original.svg) center center no-repeat;
933+
}
934+
935+
.icon-json {
936+
background: url(/icons/json-original.svg) center center no-repeat;
937+
}
938+
874939
.icon-swagger {
875940
background: url(/icons/swagger-original.svg) center center no-repeat;
876941
}
@@ -1120,4 +1185,4 @@ mark {
11201185
.row-fold-elipsis i {
11211186
position: relative;
11221187
top: 2px;
1123-
}
1188+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.usage-sample {
2+
padding: 4px;
3+
margin: 10px;
4+
}
5+
6+
.usage-sample + .border + .rounded {
7+
margin-top: 15px !important;
8+
}
9+
10+
.usage-sample .code-line {
11+
padding: 0px;
12+
margin: 0px;
13+
font-size: 85%;
14+
line-height: 10px;
15+
}
16+
17+
.usage-sample .line-number {
18+
font-size: 125%;
19+
}
20+
21+
.code-inner {
22+
height: 100%;
23+
}
24+
25+
.usage-sample .internal {
26+
display: inline-block;
27+
}

src/dotnet/APIView/APIViewWeb/Client/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
review: './src/review.ts',
1313
reviews: './src/reviews.ts',
1414
site: './css/site.scss',
15-
15+
usagesample: './css/usageSample.scss',
1616
c: './css/c.scss',
1717
cplusplus: './css/cplusplus.scss',
1818
csharp: './css/csharp.scss',
@@ -58,7 +58,7 @@ module.exports = {
5858
},
5959
plugins: [
6060
new MiniCssExtractPlugin({
61-
filename: "[name].css"
61+
filename: '[name].css'
6262
}),
6363
],
6464
resolve: {

src/dotnet/APIView/APIViewWeb/CommentMarkdownExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ public static string MarkdownAsHtml(string text) =>
3232
public static string MarkdownAsPlainText(string text) =>
3333
Markdown.ToPlainText(text ?? "", MarkdownPipeline);
3434
}
35-
}
35+
}

src/dotnet/APIView/APIViewWeb/Controllers/CommentsController.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Threading.Tasks;
33
using APIViewWeb.Models;
4-
using APIViewWeb.Repositories;
4+
using APIViewWeb.Repositories;
55
using Microsoft.AspNetCore.Authorization;
66
using Microsoft.AspNetCore.Mvc;
77

@@ -22,7 +22,7 @@ public CommentsController(CommentsManager commentsManager, ReviewManager reviewM
2222
}
2323

2424
[HttpPost]
25-
public async Task<ActionResult> Add(string reviewId, string revisionId, string elementId, string commentText, string sectionClass, string groupNo)
25+
public async Task<ActionResult> Add(string reviewId, string revisionId, string elementId, string commentText, string sectionClass, string groupNo, bool usageSampleComment = false)
2626
{
2727
var comment = new CommentModel();
2828
comment.TimeStamp = DateTime.UtcNow;
@@ -32,12 +32,13 @@ public async Task<ActionResult> Add(string reviewId, string revisionId, string e
3232
comment.SectionClass = sectionClass;
3333
comment.Comment = commentText;
3434
comment.GroupNo = groupNo;
35+
comment.IsUsageSampleComment = usageSampleComment;
3536

3637
await _commentsManager.AddCommentAsync(User, comment);
3738
var review = await _reviewManager.GetReviewAsync(User, reviewId);
38-
if (review != null)
39-
{
40-
await _notificationManager.SubscribeAsync(review,User);
39+
if (review != null)
40+
{
41+
await _notificationManager.SubscribeAsync(review,User);
4142
}
4243
return await CommentPartialAsync(reviewId, comment.ElementId);
4344
}

src/dotnet/APIView/APIViewWeb/Models/CommentModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ public class CommentModel
1919
public bool IsResolve { get; set; }
2020
public DateTime? EditedTimeStamp { get; set; }
2121
public List<string> Upvotes { get; set; } = new List<string>();
22+
public bool IsUsageSampleComment { get; set; } = false;
2223
}
2324
}

0 commit comments

Comments
 (0)