Skip to content
Merged
3 changes: 2 additions & 1 deletion src/dotnet/APIView/APIView/Model/CodeDiagnosticLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public enum CodeDiagnosticLevel
Default = 0,
Info = 1,
Warning = 2,
Error = 3
Error = 3,
Fatal = 4
}
}
22 changes: 22 additions & 0 deletions src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,28 @@
font-size: medium;
}

.form-check.override-check {
padding-left: 4rem;
padding-bottom: 1.5rem;
}

.modal-body.check-description {
padding-bottom: .5rem;
}

.form-check.convo-check {
padding-left: 4rem;
padding-bottom: 1.5rem;
}

.modal-body.convo-label {
padding-bottom: 0;
}

.modal-body.convo-label.combo-check {
padding-top: 0;
}

.approval-list-group-item {
list-style-type: none;
}
Expand Down
58 changes: 46 additions & 12 deletions src/dotnet/APIView/APIViewWeb/Client/css/shared/codeline.scss
Original file line number Diff line number Diff line change
Expand Up @@ -355,23 +355,58 @@ code {
color: #008509 !important;
}

.code-diagnostics-error {
background-color: var(--code-diagnostics-error-color);
border: 1px solid red;
$diagnostics: (
fatal: var(--code-diagnostics-fatal-color),
error: var(--code-diagnostics-error-color),
warn: var(--code-diagnostics-warn-color),
info: var(--code-diagnostics-info-color) );

@each $type, $color in $diagnostics {
.code-diagnostics-#{$type} {
background-color: $color;
}
}

.code-diagnostics-warn {
background-color: var(--code-diagnostics-warn-color);
border: 1px solid #ffe066;
.code-diagnostics p {
margin: 0;
}

.code-diagnostics-info {
background-color: var(--code-diagnostics-info-color);
border: 1px solid blue;
.light-theme .code-diagnostics p a {

&:active,
&:hover {
color: var(--details-link-active-hover);
}
}

.code-diagnostics p {
margin: 0;
.dark-theme .code-diagnostics p {
color: #e6eff7;

a {
color: var(--details-link-color);

&:visited {
color: var(--details-link-visited);
}

&:active,
&:hover {
color: var(--details-link-active-hover);
}
}
}

.dark-solarized-theme .code-diagnostics a {
color: var(--details-link-color);

&:visited {
color: var(--details-link-visited);
}

&:active,
&:hover {
color: var(--details-link-active-hover);
}
}

.code-diagnostics div {
Expand All @@ -385,5 +420,4 @@ code {
color: var(--text-muted-color) !important;
font-style: italic;
}

/*---------------------------------------------------------------------*/
35 changes: 24 additions & 11 deletions src/dotnet/APIView/APIViewWeb/Client/css/shared/theme-colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
--link-color: #{$primary};
--link-active: #{shade-color($primary, 20%)};
--link-visited: #{shade-color($primary, 40%)};
/*----Diagnostic Details Link------------------------------------*/
--details-link-color: #{$primary};
--details-link-active-hover: #00CBEB;
--link-visited: #{shade-color($primary, 40%)};
/*----Shadows and Glows------------------------------------------*/
--outer-glow: #{tint-color($primary, 80%)};
--shadow-color: rgba(#{$black}, .15);
Expand All @@ -42,10 +46,10 @@
--name-color: #{$base-text-color};
--code-color: #d1377e;
--code-comment: green;
--code-diagnostics-error-color: lightpink;
--code-diagnostics-warn-color: lightyellow;
--code-diagnostics-info-color: lightblue;
--code-added: #cee9d3;
--code-diagnostics-error-color: #ffcfad;
--code-diagnostics-warn-color: #ffeea3;
--code-diagnostics-info-color: #c8e6e5;
--code-diagnostics-fatal-color: #f5a3b9;
--code-removed: #fdcfce;
--code-delta: #fdefc6;
/*----SVG-------------------------------------------------*/
Expand Down Expand Up @@ -76,6 +80,10 @@
--link-color: #{$primary-color};
--link-active: #{tint-color($primary-color, 20%)};
--link-visited: #{tint-color($primary-color, 40%)};
/*----Diagnostic Details Link------------------------------------*/
--details-link-color: #0d1dfc;
--details-link-active-hover: #00CBEB;
--details-link-visited: #3d4afd;
/*----Shadows and Glows------------------------------------------*/
--outer-glow: #{tint-color($primary-color, 80%)};
--shadow-color: rgba(#{$white}, .15);
Expand All @@ -97,10 +105,10 @@
--name-color: #{$base-text-color};
--code-color: #db3984;
--code-comment: green;
--code-diagnostics-error-color: darkmagenta;
--code-diagnostics-warn-color: #846007;
--code-diagnostics-info-color: darkblue;
--code-added: #14432d;
--code-diagnostics-error-color: #bf6b2e;
--code-diagnostics-warn-color: #bd9b00;
--code-diagnostics-info-color: #489491;
--code-diagnostics-fatal-color: #a10e5f;
--code-removed: #491d24;
--code-delta: #4c401a;
/*----SVG-------------------------------------------------*/
Expand Down Expand Up @@ -133,6 +141,10 @@
--link-color: #{$primary-color};
--link-active: #{tint-color($primary-color, 10%)};
--link-visited: #{tint-color($primary-color, 20%)};
/*----Diagnostic Details Link------------------------------------*/
--details-link-color: #0d1dfc;
--details-link-active-hover: #00CBEB;
--details-link-visited: #3d4afd;
/*----Shadows and Glows------------------------------------------*/
--outer-glow: #{tint-color($primary-color, 80%)};
--shadow-color: rgba(#{$gray-100}, .15);
Expand All @@ -154,9 +166,10 @@
--name-color: #{$base-text-color};
--code-color: #db3984;
--code-comment: #8a9898;
--code-diagnostics-error-color: #ff4c59;
--code-diagnostics-warn-color: #e3a710;
--code-diagnostics-info-color: #5197f0;
--code-diagnostics-error-color: #d18654;
--code-diagnostics-warn-color: #d1ba56;
--code-diagnostics-info-color: #5da6a3;
--code-diagnostics-fatal-color: #d15a74;
--code-added: #345039;
--code-removed: #5d3837;
--code-delta: #695b32;
Expand Down
14 changes: 14 additions & 0 deletions src/dotnet/APIView/APIViewWeb/Client/src/pages/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,18 @@ $(() => {
}
}
});

/* MODAL WINDOW BUTTON AVAILABILITY
--------------------------------------------------------------------------------------------------------------------------------------------------------*/
$("#overrideDiag, #overrideConvo").on('change', function () {
var allChecked = true;
if ($("#overrideDiag").length && $("#overrideConvo").length) {
allChecked = $("#overrideDiag").is(":checked") && $("#overrideConvo").is(":checked");
} else if ($("#overrideDiag").length) {
allChecked = $("#overrideDiag").is(":checked");
} else if ($("#overrideConvo").length) {
allChecked = $("#overrideConvo").is(":checked");
}
$("#confirmButton").prop("disabled", !allChecked);
});
});
37 changes: 37 additions & 0 deletions src/dotnet/APIView/APIViewWeb/Helpers/PageModelHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using APIViewWeb.Pages.Assemblies;

namespace APIViewWeb.Helpers
{
Expand Down Expand Up @@ -385,6 +386,7 @@ public static async Task<ReviewContentModel> GetReviewContentAsync(
reviewPageContent.ActiveAPIRevision = activeRevision;
reviewPageContent.DiffAPIRevision = diffRevision;
reviewPageContent.TotalActiveConversations = comments.Threads.Count(t => !t.IsResolved);
reviewPageContent.HasFatalDiagnostics = fileDiagnostics.Any(d => d.Level == APIView.CodeDiagnosticLevel.Fatal);
reviewPageContent.ActiveConversationsInActiveAPIRevision = ComputeActiveConversationsInActiveRevision(activeRevisionHtmlLines, comments);
reviewPageContent.ActiveConversationsInSampleRevisions = comments.Threads.Count(t => t.Comments.FirstOrDefault()?.CommentType == CommentType.SampleRevision);
reviewPageContent.PreferredApprovers = preferredApprovers;
Expand Down Expand Up @@ -592,5 +594,40 @@ private static InlineDiffLine<CodeLine>[] CreateDiffOnlyLines(InlineDiffLine<Cod
}
return filteredLines.ToArray();
}
/// <summary>
/// Create and Assign Approval Check Boxes
/// </summary>
/// <param name="Model"></param>
/// <returns></returns>

public static (string modalId, List<string> issueList, Dictionary<string, (string modalBody, string checkboxId, string checkboxName)> issueDict) GetModalInfo(ReviewPageModel Model)
{
var issueDict = new Dictionary<string, (string modalBody, string checkboxId, string checkboxName)>
{
["openConvos"] = ("Active Conversations Present:", "overrideConvo", "overrideConvo"),
["fatalDiagnostics"] = ("Fatal Diagnostics Present:", "overrideDiag", "overrideDiag")
};

var issueList = new List<string>();
string modalId = "";

if ((Model.ReviewContent.ActiveConversationsInActiveAPIRevision > 0 || Model.ReviewContent.ActiveConversationsInSampleRevisions > 0) && Model.ReviewContent.HasFatalDiagnostics)
{
modalId = "convoFatalModel";
issueList = new List<string> { "openConvos", "fatalDiagnostics" };
}
else if ((Model.ReviewContent.ActiveConversationsInActiveAPIRevision > 0 || Model.ReviewContent.ActiveConversationsInSampleRevisions > 0) && !Model.ReviewContent.HasFatalDiagnostics)
{
modalId = "openConversationModel";
issueList = new List<string> { "openConvos" };
}
else
{
modalId = "fatalErrorModel";
issueList = new List<string> { "fatalDiagnostics" };
}

return (modalId, issueList, issueDict);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class ReviewContentModel
public string NotificationMessage { get; set; }
public ReviewContentModelDirective Directive { get; set; }
public Dictionary<string, ReviewContentModel> CrossLanguageViewContent { get; set; } = new Dictionary<string, ReviewContentModel>();
public bool HasFatalDiagnostics { get; set; }
}

public class ReviewBadgeModel
Expand Down
Loading