Skip to content

Commit

Permalink
Update TypeScript, remove JQuery UI
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Feb 9, 2023
1 parent 6482585 commit 85445cc
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 144 deletions.
6 changes: 3 additions & 3 deletions src/dotnet/APIView/APIViewUITests/SmokeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public async Task SmokeTest_CSharp()
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(WaitTime);
driver.Navigate().GoToUrl(_fixture._endpoint);

var createReviewBtn = driver.FindElement(By.XPath("//button[@data-target='#uploadModel']"));
var createReviewBtn = driver.FindElement(By.XPath("//button[@data-bs-target='#uploadModel']"));
createReviewBtn.Click();
var fileSelector = driver.FindElement(By.Id("Upload_Files"));
var fileSelector = driver.FindElement(By.Id("uploadReviewFile"));
fileSelector.SendKeys(fileAPath);
var uploadBtn = driver.FindElement(By.XPath("//div[@class='modal-footer']/button[@type='submit']"));
uploadBtn.Click();
Expand All @@ -120,7 +120,7 @@ public async Task SmokeTest_CSharp()
Assert.Equal("Reviews - apiview.dev", driver.Title);

// Select C# language
var languageSelector = driver.FindElement(By.Id("language-filter-bootstraps-select"));
var languageSelector = driver.FindElement(By.Id("language-filter-select"));
var languageSelectElement = new SelectElement(languageSelector);
languageSelectElement.SelectByText("C#");
var reviewNames = driver.FindElements(By.ClassName("review-name"));
Expand Down
4 changes: 1 addition & 3 deletions src/dotnet/APIView/APIViewWeb/Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
"acorn": "^8.0.0",
"core-js": "^3.3.2",
"jquery": "3.6.0",
"jquery-ui": "1.13.2",
"underscore": "^1.13.4"
},
"devDependencies": {
"@types/jquery": "3.3.31",
"@types/jqueryui": "1.12.16",
"@types/split.js": "^1.4.0",
"@types/webpack-env": "^1.14.1",
"@typescript-eslint/parser": "5.16.0",
Expand All @@ -32,7 +30,7 @@
"sass-loader": "^8.0.2",
"style-loader": "^3.3.1",
"ts-loader": "^6.2.0",
"typescript": "^3.5.3",
"typescript": "^3.6.0",
"webpack": "^5.70.0",
"webpack-cli": "^4.9.2"
},
Expand Down
4 changes: 1 addition & 3 deletions src/dotnet/APIView/APIViewWeb/Client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
"noImplicitAny": false,
"types": [
"webpack-env",
"jquery",
"jqueryui",
"node"
"jquery"
],
"paths": {
"@/*": [
Expand Down
267 changes: 132 additions & 135 deletions src/dotnet/APIView/APIViewWeb/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,135 +1,132 @@
@using APIViewWeb.Models;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="google" content="notranslate" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - apiview.dev</title>

<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
crossorigin="anonymous"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" />
</environment>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
<!-- Soma Select -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.sumoselect/3.1.6/sumoselect.min.css">
<link rel="stylesheet" href="~/main.css" asp-append-version="true">
@RenderSection("Styles", required: false)
</head>
@{
var userPreference = (TempData["UserPreference"] as UserPreferenceModel) ?? new UserPreferenceModel();
var theme = userPreference.Theme;
var fixedPageHeightClass = String.Empty;
var pageName = ViewContext.RouteData.Values["page"]?.ToString();
if (pageName.Equals("/Assemblies/Review") || pageName.Equals("/Assemblies/Conversation") || pageName.Equals("/Assemblies/Revisions") || pageName.Equals("/Assemblies/Samples"))
{
fixedPageHeightClass = " fixed-page-height"; }
}
<body class="@theme@fixedPageHeightClass">
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm main-nav-cst-theme">
<div class="container-fluid">
<a href="/" class="navbar-brand"><img id="apiview-logo" alt="apiview-logo" src="~/icons/apiview.png" />apiview.dev</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse">
<ul class="navbar-nav me-auto">
@if (User.Identity.IsAuthenticated) {
<li class="nav-item">
<a class="nav-link" asp-area="" asp-page="/Assemblies/Index">Reviews</a>
</li>
<li class="nav-item">
<span asp-resource="@Model" asp-requirement="@ApproverRequirement.Instance">
<a class="nav-link" asp-area="" asp-page="/Assemblies/RequestedReviews">Requested Reviews</a>
</span>
</li>
}
</ul>
<ul class="navbar-nav ms-auto">
@if (User.Identity.IsAuthenticated) {
<li class="nav-item">
<a asp-page="Profile" asp-route-UserName="@User.GetGitHubLogin()" class="nav-link">Profile</a>
</li>
<li class="nav-item">
<a asp-action="Logout" asp-controller="Account" class="nav-link">Log Out</a>
</li>
}
<li class="nav-item">
<a href="https://github.com/Azure/azure-sdk-tools/blob/main/src/dotnet/APIView/APIViewWeb/README.md" class="nav-link">Help</a>
</li>
</ul>
</div>
</div>
</nav>
</header>

<main role="main">
@RenderBody()
</main>

<footer class="border-top footer text-muted">
<div class="container text-center">
&copy; @DateTime.Now.Year - apiview.dev
- <a href="https://github.com/Azure/azure-sdk-tools/">Feedback</a>
- <a href="https://github.com/Azure/azure-sdk-tools/commit/@Startup.VersionHash">@Startup.VersionHash</a>
</div>
</footer>

<environment include="Development">
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/jquery/dist/jquery.sticky-sidebar.js"></script>
<script src="~/lib/ResizeSensor/dist/ResizeSensor.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
<script src="~/lib/mark/dist/jquery.mark.js"></script>
</environment>
<environment exclude="Development">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js"
asp-fallback-src="~/lib/mark/dist/jquery.mark.min.js"
crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.sticky-sidebar.min.js"
crossorigin="anonymous">
</script>
@*The ResizeSensor is used by the sticky-sidebar to handle resizing content.*@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/ResizeSensor.min.js"
crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
asp-fallback-test="window.bootstrap"
crossorigin="anonymous"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM">
</script>
</environment>
<!-- Soma Select -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.sumoselect/3.1.6/jquery.sumoselect.min.js" crossorigin="anonymous"></script>
<!-- UnderScoreJs-->
<script src="https://cdn.jsdelivr.net/npm/underscore@stable/underscore-umd-min.js"
crossorigin="anonymous">
</script>
<!--JQuery UI-->
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.min.js"
integrity="sha256-eTyxS0rkjpLEo16uXTS0uVCS4815lc40K2iVpWDvdSY="
crossorigin="anonymous">
</script>
<script src="~/main.js" asp-append-version="true"></script>

@RenderSection("Scripts", required: false)
</body>
</html>
@using APIViewWeb.Models;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="google" content="notranslate" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - apiview.dev</title>

<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
crossorigin="anonymous"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" />
</environment>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
<!-- Soma Select -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.sumoselect/3.1.6/sumoselect.min.css">
<link rel="stylesheet" href="~/main.css" asp-append-version="true">
@RenderSection("Styles", required: false)
</head>
@{
var userPreference = (TempData["UserPreference"] as UserPreferenceModel) ?? new UserPreferenceModel();
var theme = userPreference.Theme;
var fixedPageHeightClass = String.Empty;
var pageName = ViewContext.RouteData.Values["page"]?.ToString();
if (pageName.Equals("/Assemblies/Review") || pageName.Equals("/Assemblies/Conversation") || pageName.Equals("/Assemblies/Revisions") || pageName.Equals("/Assemblies/Samples"))
{
fixedPageHeightClass = " fixed-page-height";
}
}
<body class="@theme@fixedPageHeightClass">
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm main-nav-cst-theme">
<div class="container-fluid">
<a href="/" class="navbar-brand"><img id="apiview-logo" alt="apiview-logo" src="~/icons/apiview.png" />apiview.dev</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse">
<ul class="navbar-nav me-auto">
@if (User.Identity.IsAuthenticated) {
<li class="nav-item">
<a class="nav-link" asp-area="" asp-page="/Assemblies/Index">Reviews</a>
</li>
<li class="nav-item">
<span asp-resource="@Model" asp-requirement="@ApproverRequirement.Instance">
<a class="nav-link" asp-area="" asp-page="/Assemblies/RequestedReviews">Requested Reviews</a>
</span>
</li>
}
</ul>
<ul class="navbar-nav ms-auto">
@if (User.Identity.IsAuthenticated) {
<li class="nav-item">
<a asp-page="Profile" asp-route-UserName="@User.GetGitHubLogin()" class="nav-link">Profile</a>
</li>
<li class="nav-item">
<a asp-action="Logout" asp-controller="Account" class="nav-link">Log Out</a>
</li>
}
<li class="nav-item">
<a href="https://github.com/Azure/azure-sdk-tools/blob/main/src/dotnet/APIView/APIViewWeb/README.md" class="nav-link">Help</a>
</li>
</ul>
</div>
</div>
</nav>
</header>

<main role="main">
@RenderBody()
</main>

<footer class="border-top footer text-muted">
<div class="container text-center">
&copy; @DateTime.Now.Year - apiview.dev
- <a href="https://github.com/Azure/azure-sdk-tools/">Feedback</a>
- <a href="https://github.com/Azure/azure-sdk-tools/commit/@Startup.VersionHash">@Startup.VersionHash</a>
</div>
</footer>

<environment include="Development">
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/jquery/dist/jquery.sticky-sidebar.js"></script>
<script src="~/lib/ResizeSensor/dist/ResizeSensor.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
<script src="~/lib/mark/dist/jquery.mark.js"></script>
</environment>
<environment exclude="Development">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js"
asp-fallback-src="~/lib/mark/dist/jquery.mark.min.js"
crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.sticky-sidebar.min.js"
crossorigin="anonymous">
</script>
@*The ResizeSensor is used by the sticky-sidebar to handle resizing content.*@
<script src="https://cdn.jsdelivr.net/npm/[email protected]/ResizeSensor.min.js"
crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
asp-fallback-test="window.bootstrap"
crossorigin="anonymous"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM">
</script>
</environment>
<!-- Soma Select -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.sumoselect/3.1.6/jquery.sumoselect.min.js" crossorigin="anonymous"></script>
<!-- UnderScoreJs-->
<script src="https://cdn.jsdelivr.net/npm/underscore@stable/underscore-umd-min.js"
crossorigin="anonymous">
</script>
</script>
<script src="~/main.js" asp-append-version="true"></script>

@RenderSection("Scripts", required: false)
</body>
</html>

0 comments on commit 85445cc

Please sign in to comment.