diff --git a/src/dotnet/APIView/APIView/Model/CodeDiagnosticLevel.cs b/src/dotnet/APIView/APIView/Model/CodeDiagnosticLevel.cs index 936fe3e0c64..785a064b9a7 100644 --- a/src/dotnet/APIView/APIView/Model/CodeDiagnosticLevel.cs +++ b/src/dotnet/APIView/APIView/Model/CodeDiagnosticLevel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. namespace APIView { @@ -9,4 +9,4 @@ public enum CodeDiagnosticLevel Warning = 2, Error = 3 } -} \ No newline at end of file +} diff --git a/src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss b/src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss index da2ed860358..262f2e81ef6 100644 --- a/src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss +++ b/src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss @@ -64,4 +64,45 @@ margin-left: 10px; color: var(--success-color); font-size: medium; +} + +.approval-list-group-item { + list-style-type: none; +} + +.revision-title { + margin-bottom: 0; +} + +.revision-info { + display: inline-block; + padding-left: 5px; +} + +.status-icon { + font-size: 0.8em; + + &.deleted { + color: black; + } + + &.approval-reverted { + color: red; + } + + &.created { + color: darkorange; + } + + &.approved { + color: forestgreen; + } + + &.undeleted { + color: yellow; + } +} + +.revision-info:last-child { + margin-left: 17px; } \ No newline at end of file diff --git a/src/dotnet/APIView/APIViewWeb/LeanModels/ChangeHistory.cs b/src/dotnet/APIView/APIViewWeb/LeanModels/ChangeHistory.cs index 489a13cec8d..c6c235f0a4f 100644 --- a/src/dotnet/APIView/APIViewWeb/LeanModels/ChangeHistory.cs +++ b/src/dotnet/APIView/APIViewWeb/LeanModels/ChangeHistory.cs @@ -46,7 +46,7 @@ public enum CommentChangeAction } public abstract class ChangeHistoryModel - { + { public string ChangedBy { get; set; } public DateTime? ChangedOn { get; set; } public string Notes { get; set; } diff --git a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml index a0d708bc5d5..30be6073cab 100644 --- a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml +++ b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml @@ -504,11 +504,74 @@ + +
  • +
    +

    Change History:

    + @foreach (var change in Model.ReviewContent.ActiveAPIRevision.ChangeHistory) + { +
  • +
    +
    + @{ + var changeAction = change.ChangeAction.ToString(); + string iconClass = ""; + switch (changeAction) + { + case "Created": + iconClass = "bi bi-plus-circle-fill created status-icon"; + break; + case "Approved": + iconClass = "bi bi-check-circle-fill approved status-icon"; + break; + case "ApprovalReverted": + iconClass = "bi bi-arrow-left-circle-fill approval-reverted status-icon"; + break; + case "Deleted": + iconClass = "bi bi-backspace-fill deleted status-icon"; + break; + case "UnDeleted": + iconClass = "bi bi-plus-circle-fill undeleted status-icon"; + break; + } + } + +
    + @if (!string.IsNullOrEmpty(iconClass)) + { + + } + @if (change.ChangeAction.ToString() == "Created") + { + Created: + } + else if (change.ChangeAction.ToString() == "Approved") + { + Approved: + } + else if (change.ChangeAction.ToString() == "ApprovalReverted") + { + Reverted: + } + else if (change.ChangeAction.ToString() == "Deleted") + { + Deleted: + } + else if (change.ChangeAction.ToString() == "UnDeleted") + { + UnDeleted: + } + @change.ChangedBy
    + +
    +
    +
  • + } + -
    diff --git a/src/dotnet/APIView/APIViewWeb/Program.cs b/src/dotnet/APIView/APIViewWeb/Program.cs index fa97ce46bbb..b2ecec632b1 100644 --- a/src/dotnet/APIView/APIViewWeb/Program.cs +++ b/src/dotnet/APIView/APIViewWeb/Program.cs @@ -16,7 +16,7 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .ConfigureAppConfiguration((hostingContext, config) => { - config.AddEnvironmentVariables(prefix: "APIVIEW_"); + config.AddEnvironmentVariables(prefix: "APIVIEW_"); IConfiguration settings = config.Build(); string connectionString = settings.GetValue("APPCONFIG"); // Load configuration from Azure App Configuration