From 66f1f91cd404bdde72c64fb3399c578f890f4e99 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Fri, 10 Feb 2023 18:37:31 -0800 Subject: [PATCH] Resolve Minor Bugs --- .../APIViewWeb/Client/css/pages/review.scss | 12 ++ .../css/shared/bootstraps-overrides.scss | 9 ++ .../Client/css/shared/comments.scss | 2 +- .../APIViewWeb/Models/ReviewRevisionModel.cs | 15 +- .../APIViewWeb/Pages/Assemblies/Review.cshtml | 140 +++++++++--------- .../Shared/_CommentThreadInnerPartial.cshtml | 41 +++-- .../Pages/Shared/_ReviewBadge.cshtml | 4 +- .../Pages/Shared/_ReviewsPartial.cshtml | 4 +- 8 files changed, 123 insertions(+), 104 deletions(-) diff --git a/src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss b/src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss index e710988fa3b..af616f12ac6 100644 --- a/src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss +++ b/src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss @@ -73,4 +73,16 @@ &.gutter-horizontal { cursor: col-resize; } +} + +.option-approved > label, .option-pending > label { + font-size: small; +} + +.option-approved > label::after { + content: ""; + font-family: "FontAwesome"; + margin-left: 10px; + color: var(--success-color); + font-size: medium; } \ No newline at end of file diff --git a/src/dotnet/APIView/APIViewWeb/Client/css/shared/bootstraps-overrides.scss b/src/dotnet/APIView/APIViewWeb/Client/css/shared/bootstraps-overrides.scss index 242a3580454..edeed269413 100644 --- a/src/dotnet/APIView/APIViewWeb/Client/css/shared/bootstraps-overrides.scss +++ b/src/dotnet/APIView/APIViewWeb/Client/css/shared/bootstraps-overrides.scss @@ -172,6 +172,15 @@ select { border: 1px solid var(--border-color); } +.dropdown-header { + color: var(--base-text-color); +} + +.dropdown-item:hover, .dropdown-item:focus { + color: var(--base-text-color); + background-color: var(--base-bg-color); +} + .table { color: var(--base-text-color); } diff --git a/src/dotnet/APIView/APIViewWeb/Client/css/shared/comments.scss b/src/dotnet/APIView/APIViewWeb/Client/css/shared/comments.scss index 2c81f7c6d6e..16ab2cfcdc5 100644 --- a/src/dotnet/APIView/APIViewWeb/Client/css/shared/comments.scss +++ b/src/dotnet/APIView/APIViewWeb/Client/css/shared/comments.scss @@ -36,7 +36,7 @@ .comment-contents { margin-bottom: 3px; overflow-wrap: anywhere; - overflow-x: auto; + display: inline-grid; } .comment-contents .fw-bold { diff --git a/src/dotnet/APIView/APIViewWeb/Models/ReviewRevisionModel.cs b/src/dotnet/APIView/APIViewWeb/Models/ReviewRevisionModel.cs index c1bad78b98c..e0ac490e13f 100644 --- a/src/dotnet/APIView/APIViewWeb/Models/ReviewRevisionModel.cs +++ b/src/dotnet/APIView/APIViewWeb/Models/ReviewRevisionModel.cs @@ -44,17 +44,6 @@ public string Author set => _author = value; } - [JsonIgnore] - public string DisplayNameShort - { - get - { - return Label != null ? - $"rev {RevisionNumber} - {Label}" : - $"rev {RevisionNumber}"; - } - } - [JsonIgnore] public string DisplayName { @@ -72,7 +61,9 @@ public string DisplayName // the feature to allow for editing revision names cleaner. name = Name; } - return $"{DisplayNameShort} - {name}"; + return Label != null ? + $"rev {RevisionNumber} - {Label} - {name}" : + $"rev {RevisionNumber} - {name}"; } } diff --git a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml index 79425fdd69c..7df02541739 100644 --- a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml +++ b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml @@ -18,7 +18,7 @@

- Approve   + Approval  

@{ var approvalCollapseState = " show"; @@ -29,9 +29,8 @@ } }
    -
  • - Approves the current revision of the API -
    +
  • + @if (Model.DiffRevision == null || Model.DiffRevision.Approvers.Count > 0) { @@ -44,47 +43,27 @@ else { @if (Model.ActiveConversations > 0 && Model.PreferredApprovers.Contains(User.GetGitHubLogin())) - { + { + Approves the current revision of the API
    - - } else { @if (Model.PreferredApprovers.Contains(User.GetGitHubLogin())) - { + { + Approves the current revision of the API
    - +
    } else {
    - +
    } } @@ -104,7 +83,7 @@ {
    } @@ -112,7 +91,7 @@
  • @if (Model.Revision.Approvers.Count > 0) { - + Approvers: @{ int i = 0; @@ -129,38 +108,42 @@ } } -
  • -
  • - @if (Model.Review.Revisions.LastOrDefault()?.Files.LastOrDefault()?.PackageName != null) + else { - var approver = Model.Review.ApprovedForFirstReleaseBy ?? Model.Review.Revisions.LastOrDefault(r => r.IsApproved)?.Approvers?.FirstOrDefault(); - var nameApprovalTip = approver != null ? "Package has been approved for first release by " + approver : "Package has been approved for first release"; - -
    - @if (!Model.Review.IsApprovedForFirstRelease) - { - Approval for First Release. + Current Revision Approval Pending } +
  • + @if (Model.Review.Revisions.LastOrDefault()?.Files.LastOrDefault()?.PackageName != null && + Model.Review.Language != "Swagger" && Model.Review.Language != "Cadl") + { + var approver = Model.Review.ApprovedForFirstReleaseBy ?? Model.Review.Revisions.LastOrDefault(r => r.IsApproved)?.Approvers?.FirstOrDefault(); + @if (!Model.Review.IsApprovedForFirstRelease) + { +
  • + + Approves First Release of the package
    -
    - +
+ + First Revision Approval Pending + + } + else + { +
  • + @if (approver != null) + { + Package has been approved for first release by @approver } else { - @if (approver != null) - { - Package has been approved for first release by @approver - } - else - { - Package has been approved for first release - } - } - + Package has been approved for first release + } +
  • } - + }

    Request Reviewers   @@ -312,7 +295,7 @@

    -
  • +
  • @if (Model.ShowDocumentation) { @@ -327,7 +310,7 @@
  • -
  • +
  • @if (userPreference.ShowHiddenApis == true) { @@ -397,7 +380,7 @@ @@ -449,7 +432,7 @@ } @foreach (var revision in Model.PreviousRevisions.Reverse()) { - var optionName = revision.IsApproved ? $"{@revision.DisplayNameShort} ✔" : @revision.DisplayNameShort; + var optionClass = revision.IsApproved ? "option-approved" : "option-pending"; var urlValue = @Url.ActionLink("Review", "Assemblies", new { id = @Model.Review.ReviewId, @@ -462,18 +445,18 @@ { if (@Model.DiffRevisionId == @revision.RevisionId) { - + } else { - + } } else { if (@Model.DiffRevisionId != @revision.RevisionId) { - + } } } @@ -544,6 +527,31 @@
    - + + +
    + + +
    diff --git a/src/dotnet/APIView/APIViewWeb/Pages/Shared/_CommentThreadInnerPartial.cshtml b/src/dotnet/APIView/APIViewWeb/Pages/Shared/_CommentThreadInnerPartial.cshtml index af92c4acbe9..00013e4b749 100644 --- a/src/dotnet/APIView/APIViewWeb/Pages/Shared/_CommentThreadInnerPartial.cshtml +++ b/src/dotnet/APIView/APIViewWeb/Pages/Shared/_CommentThreadInnerPartial.cshtml @@ -12,20 +12,6 @@ @Model.Username - - -
    - - -
  • .NET - Java - Python - C - JavaScript - Go - C++ + .NET + Java + Python + C + JavaScript + Go + C++
    + +
    + + +
    @if (Model.Comment.Contains("\r\n")) diff --git a/src/dotnet/APIView/APIViewWeb/Pages/Shared/_ReviewBadge.cshtml b/src/dotnet/APIView/APIViewWeb/Pages/Shared/_ReviewBadge.cshtml index f540cbc8311..98018aac999 100644 --- a/src/dotnet/APIView/APIViewWeb/Pages/Shared/_ReviewBadge.cshtml +++ b/src/dotnet/APIView/APIViewWeb/Pages/Shared/_ReviewBadge.cshtml @@ -27,8 +27,8 @@ { @if (Model.IsApprovedForFirstRelease) { - - + + } } diff --git a/src/dotnet/APIView/APIViewWeb/Pages/Shared/_ReviewsPartial.cshtml b/src/dotnet/APIView/APIViewWeb/Pages/Shared/_ReviewsPartial.cshtml index b19fd0d1ecb..4dcbbc6d236 100644 --- a/src/dotnet/APIView/APIViewWeb/Pages/Shared/_ReviewsPartial.cshtml +++ b/src/dotnet/APIView/APIViewWeb/Pages/Shared/_ReviewsPartial.cshtml @@ -42,7 +42,7 @@ @review.Author - + @review.FilterType.ToString() @@ -56,7 +56,7 @@ } else { - + }