Skip to content

Commit

Permalink
Add conversiation info badge
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Mar 5, 2024
1 parent 6ccae34 commit e4cf8af
Show file tree
Hide file tree
Showing 18 changed files with 601 additions and 664 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
.conversiation-center {
overflow: auto;
color: var(--base-text-color);
height: calc(100vh - 155px);
height: calc(100vh - 145px);
}
4 changes: 2 additions & 2 deletions src/dotnet/APIView/APIViewWeb/Client/css/pages/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@

#index-offcanvas-menu-content {
padding: 130px 60px 10px 20px;
min-height: calc(100vh - 40px);
max-height: calc(100vh - 40px);
min-height: calc(100vh - 30px);
max-height: calc(100vh - 30px);
overflow-y: auto;
}

Expand Down
4 changes: 2 additions & 2 deletions src/dotnet/APIView/APIViewWeb/Client/css/pages/review.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#review-left {
max-width: none;
min-width: 10px;
height: calc(100vh - 130px);
height: calc(100vh - 120px);
overflow: auto;
max-height: 100vh;
padding: 5px 0px 5px 10px;
Expand All @@ -27,7 +27,7 @@
#review-right {
max-width: 100%;
min-width: 100px;
height: calc(100vh - 130px);
height: calc(100vh - 120px);
padding: 0px;
overflow: auto;
background-color: var(--base-fg-color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

.samples-center {
overflow: auto;
height: calc(100vh - 130px);
height: calc(100vh - 120px);
padding: 0px;
background-color: var(--base-fg-color);
scroll-behavior: smooth;
Expand Down
5 changes: 5 additions & 0 deletions src/dotnet/APIView/APIViewWeb/Client/css/shared/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ html {
color: var(--link-active);
}

.navbar-brand {
padding-top: 0rem;
padding-bottom: 0rem;
}

.rounded-1 {
border-radius: 3px !important;
}
Expand Down
6 changes: 3 additions & 3 deletions src/dotnet/APIView/APIViewWeb/Client/css/shared/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
}

@mixin review-offcanvas-menu-content {
min-height: calc(100vh - 110px);
max-height: calc(100vh - 110px);
min-height: calc(100vh - 100px);
max-height: calc(100vh - 100px);
overflow-y: auto;
margin-top: 80px;
margin-top: 70px;
}

@mixin review-approval-border {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
.left-offcanvas-menu-content {
border-right: 1px solid var(--border-color) !important;
transform: translate3d(0, 0, 0);

.badge {
font-size: 0.55em;
top: 5px;
}
}

#right-offcanvas-menu-content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
--box-shadow-inset: inset 0 1px 2px #{rgba($black, .075)};
--box-shadow-success: 0 0 0 0.1rem #{rgba($success, 10%)};
--box-shadow-link: 0 0 0 0.2rem #{rgba($primary, 50%)};
--box-shadow-left: -15px 0px 0px 0rem #{rgba($primary, 100%)};
--box-shadow-left: -5px 0px 0px 0rem #{rgba($primary, 100%)};
/*----Nav--------------------------------------------------------*/
--navbar-bg: #{tint-color($base-bg-color, 100%)};
--navbar-text: #{$base-text-color};
Expand Down Expand Up @@ -85,7 +85,7 @@
--box-shadow-inset: inset 0 1px 2px #{rgba($white, .075)};
--box-shadow-success: 0 0 0 0.1rem #{rgba($success, 10%)};
--box-shadow-link: 0 0 0 0.2rem #{rgba($primary-color, 50%)};
--box-shadow-left: -15px 0px 0px 0rem #{rgba($primary-color, 100%)};
--box-shadow-left: -5px 0px 0px 0rem #{rgba($primary-color, 100%)};
/*----Nav--------------------------------------------------------*/
--navbar-bg: #{tint-color($base-bg-color, 20%)};
--navbar-text: #{tint-color($base-text-color, 40%)};
Expand Down Expand Up @@ -142,7 +142,7 @@
--box-shadow-inset: inset 0 1px 2px #{rgba($gray-100, .075)};
--box-shadow-success: 0 0 0 0.1rem #{rgba($success, 10%)};
--box-shadow-link: 0 0 0 0.2rem #{rgba($primary-color, 50%)};
--box-shadow-left: -15px 0px 0px 0rem #{rgba($primary-color, 100%)};
--box-shadow-left: -5px 0px 0px 0rem #{rgba($primary-color, 100%)};
/*----Nav--------------------------------------------------------*/
--navbar-bg: #{tint-color($base-bg-color, 20%)};
--navbar-text: #{tint-color($base-text-color, 40%)};
Expand Down
1 change: 0 additions & 1 deletion src/dotnet/APIView/APIViewWeb/Client/src/pages/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ $(() => {

// Scroll ids into view for Ids hidden in collapsed sections
const uriHash = location.hash;
console.log(`Initial uriHash: ${uriHash}`);
if (uriHash) {
let targetAnchorId = uriHash.replace('#', '');
targetAnchorId = decodeURIComponent(targetAnchorId);
Expand Down
12 changes: 10 additions & 2 deletions src/dotnet/APIView/APIViewWeb/Client/src/pages/revisions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $(() => {

function makeDiffAPIRevisionEventHandler(event) {
const trigger = $(event.currentTarget);
const diffCard = $(".revisions-list-container .bi.bi-file-dif.diff-rev").closest(".card");
const diffCard = $(".revisions-list-container .bi.bi-file-diff.diff-rev").closest(".card");
diffCard.find(".bi.bi-file-diff.diff-rev").remove();
diffCard.find(".btn-group").prepend(`<button type="button" class="btn btn-sm btn-outline-primary make-diff" data-bs-toggle="tooltip" title="Make Diff"><i class="bi bi-file-diff mr-1"></i></button>`);
diffCard.find(".btn-group").prepend(`<button type="button" class="btn btn-sm btn-outline-primary make-active" data-bs-toggle="tooltip" title="Make Active"><i class="bi bi-clock-history mr-1"></i></button>`);
Expand Down Expand Up @@ -115,7 +115,15 @@ $(() => {
}

const url = new URL(window.location.href);
url.searchParams.set("revisionId", activeRevisionId!);
const currRevisionId = hp.getReviewAndRevisionIdFromUrl(url.href)["revisionId"];

if (!currRevisionId || url.searchParams.has("revisionId")) {
url.searchParams.set("revisionId", activeRevisionId!);
}
else {
url.pathname = url.pathname.replace(currRevisionId, activeRevisionId!);
}

if (diffRevisionId) {
url.searchParams.set("diffRevisionId", diffRevisionId!);
}
Expand Down
4 changes: 3 additions & 1 deletion src/dotnet/APIView/APIViewWeb/Client/src/shared/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,12 @@ $(() => {
highlightCurrentRow(inlineRow, true);
});

$("#jump-to-first-comment").on("click", function () {
$("#jump-to-first-comment").on("click", function (e) {
e.preventDefault();
var commentRows = $('.comment-row');
var displayedCommentRows = hp.getDisplayedCommentRows(commentRows, false, true);
$(displayedCommentRows[0])[0].scrollIntoView();
e.stopPropagation();
});

function highlightCurrentRow(rowElement: JQuery<HTMLElement> = $(), isInlineRow: boolean = false) {
Expand Down
7 changes: 5 additions & 2 deletions src/dotnet/APIView/APIViewWeb/Client/src/shared/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,17 @@ export function getDisplayedCommentRows(commentRows: JQuery<HTMLElement>, clearC
* @returns result dictionary of "reviewId" and "revisionId", if they exist; undefined otherwise
*/
export function getReviewAndRevisionIdFromUrl(uri) {
const regex = /.+(Review|Conversation|Revisions|Samples)\/([a-zA-Z0-9]+)(\?revisionId=([a-zA-Z0-9]+))?/;
const regex = /.+(Review|Conversation|Revisions|Samples)\/([a-zA-Z0-9]+)(\/([a-zA-Z0-9]+)|\?revisionId=([a-zA-Z0-9]+))?/;

const match = uri.match(regex);
const result = {}

if (match) {
result["reviewId"] = match[2];
result["revisionId"] = match[4]; // undefined if latest revision
result["revisionId"] = match[4]; // undefined if latest revision, or searchParam used
if (!result["revisionId"]) {
result["revisionId"] = match[5];
}
}

return result;
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/APIView/APIViewWeb/Helpers/PageModelHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using APIViewWeb.Hubs;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Configuration;
using SharpCompress.Common;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

Expand Down Expand Up @@ -506,6 +505,7 @@ public static string ResolveRevisionLabel(APIRevisionListItemModel apiRevision,
/// Upload API Revision
/// </summary>
/// <param name="apiRevisionsManager"></param>
/// <param name="user"></param>
/// <param name="id"></param>
/// <param name="upload"></param>
/// <param name="label"></param>
Expand Down
Loading

0 comments on commit e4cf8af

Please sign in to comment.