Skip to content

Commit 3b36b75

Browse files
committed
pin version to proxy with common sanitizers added
update to version with removable sanitizers refencing newest version of the proxy with correct Location header and redaction of uri hostnames update the version of the proxy update the proxy version to one with tenantid Add api approval history (Azure#8024) * Approval history functional but unstyled * Icons added to history * Icons and history styled, comment display added but need to add comment to test * Changed Created field * Reduced history text size and changed datetime display to hours/weeks ago * Removed blank lines, excess styling, duplicate ChangeAction, commented lines * Changed startup/login * Added icons back in but they still require styling * All text same size * Requested changes complete * Compiled scss selectors into a nested structure * Extra namespace imports removed reday for merge Allows override target version file (Azure#8158) * allow an override FILE to be honored by test-proxy-tool * remove test-proxy-docker merge upstream main
1 parent 72d5412 commit 3b36b75

8 files changed

Lines changed: 121 additions & 47 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0-dev.20240410.1
1+
1.0.0-dev.20240425.1

eng/common/testproxy/test-proxy-docker.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

eng/common/testproxy/test-proxy-tool.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,17 @@ steps:
2222
pwsh: true
2323

2424
- pwsh: |
25-
$version = $(Get-Content "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt" -Raw).Trim()
25+
$standardVersion = "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt"
26+
$overrideVersion = "${{ parameters.templateRoot }}/eng/target_proxy_version.txt"
27+
28+
$version = $(Get-Content $standardVersion -Raw).Trim()
29+
30+
if (Test-Path $overrideVersion) {
31+
$version = $(Get-Content $overrideVersion -Raw).Trim()
32+
}
33+
34+
Write-Host "Installing test-proxy version $version"
35+
2636
dotnet tool install azure.sdk.tools.testproxy `
2737
--tool-path $(Build.BinariesDirectory)/test-proxy `
2838
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `

src/dotnet/APIView/APIView/Model/CodeDiagnosticLevel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33
namespace APIView
44
{
@@ -9,4 +9,4 @@ public enum CodeDiagnosticLevel
99
Warning = 2,
1010
Error = 3
1111
}
12-
}
12+
}

src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,45 @@
6464
margin-left: 10px;
6565
color: var(--success-color);
6666
font-size: medium;
67+
}
68+
69+
.approval-list-group-item {
70+
list-style-type: none;
71+
}
72+
73+
.revision-title {
74+
margin-bottom: 0;
75+
}
76+
77+
.revision-info {
78+
display: inline-block;
79+
padding-left: 5px;
80+
}
81+
82+
.status-icon {
83+
font-size: 0.8em;
84+
85+
&.deleted {
86+
color: black;
87+
}
88+
89+
&.approval-reverted {
90+
color: red;
91+
}
92+
93+
&.created {
94+
color: darkorange;
95+
}
96+
97+
&.approved {
98+
color: forestgreen;
99+
}
100+
101+
&.undeleted {
102+
color: yellow;
103+
}
104+
}
105+
106+
.revision-info:last-child {
107+
margin-left: 17px;
67108
}

src/dotnet/APIView/APIViewWeb/LeanModels/ChangeHistory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public enum CommentChangeAction
4646
}
4747

4848
public abstract class ChangeHistoryModel
49-
{
49+
{
5050
public string ChangedBy { get; set; }
5151
public DateTime? ChangedOn { get; set; }
5252
public string Notes { get; set; }

src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,74 @@
504504
<label class="form-check-label" for="reviewViewedSwitch">Mark as Viewed</label>
505505
</form>
506506
</div>
507+
</li>
508+
<li class="list-group-item">
509+
<div>
510+
<p class="small revision-title">Change History:</p>
511+
@foreach (var change in Model.ReviewContent.ActiveAPIRevision.ChangeHistory)
512+
{
513+
<li class="list-group-item approval-list-group-item">
514+
<div class="d-flex align-items-start">
515+
<div class="me-3">
516+
@{
517+
var changeAction = change.ChangeAction.ToString();
518+
string iconClass = "";
519+
switch (changeAction)
520+
{
521+
case "Created":
522+
iconClass = "bi bi-plus-circle-fill created status-icon";
523+
break;
524+
case "Approved":
525+
iconClass = "bi bi-check-circle-fill approved status-icon";
526+
break;
527+
case "ApprovalReverted":
528+
iconClass = "bi bi-arrow-left-circle-fill approval-reverted status-icon";
529+
break;
530+
case "Deleted":
531+
iconClass = "bi bi-backspace-fill deleted status-icon";
532+
break;
533+
case "UnDeleted":
534+
iconClass = "bi bi-plus-circle-fill undeleted status-icon";
535+
break;
536+
}
537+
}
538+
539+
<div class="revision-events">
540+
@if (!string.IsNullOrEmpty(iconClass))
541+
{
542+
<i class="@iconClass"></i>
543+
}
544+
@if (change.ChangeAction.ToString() == "Created")
545+
{
546+
<span class="small revision-info">Created:</span>
547+
}
548+
else if (change.ChangeAction.ToString() == "Approved")
549+
{
550+
<span class="small revision-info">Approved:</span>
551+
}
552+
else if (change.ChangeAction.ToString() == "ApprovalReverted")
553+
{
554+
<span class="small revision-info">Reverted:</span>
555+
}
556+
else if (change.ChangeAction.ToString() == "Deleted")
557+
{
558+
<span class="small revision-info">Deleted:</span>
559+
}
560+
else if (change.ChangeAction.ToString() == "UnDeleted")
561+
{
562+
<span class="small revision-info">UnDeleted:</span>
563+
}
564+
<span class="small revision-info">@change.ChangedBy</span><br />
565+
<span data-bs-toggle="tooltip" title="@change.ChangedOn" date="@(change.ChangedOn.GetValueOrDefault())" class="small revision-info"></span>
566+
</div>
567+
</div>
568+
</li>
569+
}
570+
</div>
507571
</li>
508572
</ul>
509573
</div>
510574
</div>
511-
512575
<div class="container-fluid mx-0 px-0 sub-header-content">
513576
<div class="row px-3 py-2 border-bottom" id="review-info-bar">
514577
<partial name="Shared/_ReviewBadge" model="(Model.ReviewContent.Review, Model.ReviewContent.ActiveAPIRevision, Model.ReviewContent.DiffAPIRevision, Model.UserPreference)" />

src/dotnet/APIView/APIViewWeb/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
1616
WebHost.CreateDefaultBuilder(args)
1717
.ConfigureAppConfiguration((hostingContext, config) =>
1818
{
19-
config.AddEnvironmentVariables(prefix: "APIVIEW_");
19+
config.AddEnvironmentVariables(prefix: "APIVIEW_");
2020
IConfiguration settings = config.Build();
2121
string connectionString = settings.GetValue<string>("APPCONFIG");
2222
// Load configuration from Azure App Configuration

0 commit comments

Comments
 (0)