Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GovUk Frontend Aspnet to v2 #750

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.10" />
<PackageReference Include="Dfe.Academisation.CorrelationIdMiddleware" Version="2.0.2" />
<PackageReference Include="FluentValidation" Version="11.11.0" />
<PackageReference Include="GovUk.Frontend.AspNetCore" Version="1.5.0" />
<PackageReference Include="GovukNotify" Version="7.2.0" />
<PackageReference Include="jQuery.Validation" Version="1.21.0" />
<PackageReference Include="GovUk.Frontend.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.11" />
Expand Down
4 changes: 2 additions & 2 deletions Dfe.Academies.External.Web/Pages/Shared/_Header.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
</a>
</div>
<div class="govuk-header__content">
<a href="/" class="govuk-header__link govuk-header__link--service-name">
<a href="/" class="govuk-header__link govuk-header__service-name">
Apply to become an Academy
</a>
</div>
</div>
</header>
</header>
139 changes: 60 additions & 79 deletions Dfe.Academies.External.Web/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@using Microsoft.Extensions.Configuration
@using Microsoft.AspNetCore.Http.Features
@using GovUk.Frontend.AspNetCore
@using System.Security.Claims;
@inject IConfiguration _configuration

Expand Down Expand Up @@ -47,7 +48,7 @@
} },
}
});

// Set Authenticated User Context
window.appInsights.setAuthenticatedUserContext("@authenticatedUserId", null, true);
</script>
Expand All @@ -58,98 +59,78 @@
<title>@ViewData["Title"] &ndash; Apply to become an academy</title>
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="theme-color" content="blue"/>

<meta http-equiv="X-UA-Compatible" content="IE=edge"/>

<link rel="icon" sizes="48x48" href="/assets/images/favicon.ico">
<link rel="icon" sizes="any" href="/assets/images/favicon.svg" type="image/svg+xml">
<link rel="mask-icon" href="/assets/images/govuk-icon-mask.svg" color="#0b0c0c">
<link rel="apple-touch-icon" href="/assets/images/govuk-icon-180.png">

<meta property="og:image" content="/assets/images/govuk-opengraph-image.png">
<meta property="og:image" content="/assets/images/govuk-opengraph-image.png">
<link rel="icon" sizes="48x48" href="/assets/images/favicon.ico">
<link rel="icon" sizes="any" href="/assets/images/favicon.svg" type="image/svg+xml">
<link rel="mask-icon" href="/assets/images/govuk-icon-mask.svg" color="#0b0c0c">
<link rel="apple-touch-icon" href="/assets/images/govuk-icon-180.png">
@Html.GovUkFrontendStyleImports()
<link href="/css/site.css" rel="stylesheet" media="all"/>
<link href="/assets/accessible-autocomplete.min.css" rel="stylesheet" media="all"/>
</head>

<body class="govuk-template__body app-body-class">
@if (canTrack)
{
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=@_configuration["Google:TagManagerId"]"
height="0" width="0" style="display:none;visibility:hidden">
</iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
}

<script asp-add-nonce>
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
</script>
<partial name="_CookieConsentPartial"/>
<partial name="_NotificationBanner"/>
<partial name="_Header"/>
@Html.GovUkFrontendJsEnabledScript()


<div class="container body-content">
@if (User.Identity is not null && User.Identity.IsAuthenticated)
@if (canTrack)
{
<div class=" govuk-width-container govuk-phase-banner print-hide">
<p class="govuk-phase-banner__content">
<strong class="govuk-tag govuk-phase-banner__content__tag ">
beta
</strong>
<span class="govuk-phase-banner__text">
<a class="govuk-link" asp-page="/Help/HowCanWeHelp" target="_blank">Get help or give feedback on this service (opens in a new tab)</a>
</span>
</p>
</div>
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=@_configuration["Google:TagManagerId"]"
height="0" width="0" style="display:none;visibility:hidden">
</iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
}

<div class="govuk-width-container">
@await RenderSectionAsync("BeforeMain", required: false)
<main class="govuk-main-wrapper " id="main-content" role="main">
<div class="govuk-grid-row">
<partial name="_ErrorMessages"/>
@RenderBody()
<partial name="_CookieConsentPartial"/>
<partial name="_NotificationBanner"/>
<partial name="_Header"/>

<div class="container body-content">
@if (User.Identity is not null && User.Identity.IsAuthenticated)
{
<div class=" govuk-width-container govuk-phase-banner print-hide">
<p class="govuk-phase-banner__content">
<strong class="govuk-tag govuk-phase-banner__content__tag ">
beta
</strong>
<span class="govuk-phase-banner__text">
<a class="govuk-link" asp-page="/Help/HowCanWeHelp" target="_blank">Get help or give feedback on this service (opens in a new tab)</a>
</span>
</p>
</div>
</main>
</div>
}

<div class="govuk-width-container">
@await RenderSectionAsync("BeforeMain", required: false)
<main class="govuk-main-wrapper " id="main-content" role="main">
<div class="govuk-grid-row">
<partial name="_ErrorMessages"/>
@RenderBody()
</div>
</main>
</div>

<partial name="_Footer"/>
</div>
<partial name="_Footer"/>
</div>

<environment include="Development">
<script src="~/lib/jquery/dist/jquery.js" asp-add-nonce></script>
<script src="~/js/site.js" asp-append-version="true" asp-add-nonce></script>
</environment>
<environment exclude="Development">
@*<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.4.1.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
crossorigin="anonymous"
integrity="sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh">
</script>*@
<script src="~/lib/jquery/dist/jquery.js" asp-add-nonce></script>
<script src="~/js/site.js" asp-append-version="true" asp-add-nonce></script>
</environment>
<script src="~/assets/application-39beab6507cd50944edb58ab76ca9a393e09d467cba25003fbd3104c8a02514b.js"></script>
@* <script src="~/js/all.js"></script>*@
<script asp-add-nonce>
window.GOVUKFrontend.initAll();
@if (canTrack)
{
<text>
window.addEventListener('load', function () {
idlechecks('@_configuration["Google:AnalyticsKey"]',
@_configuration["SessionidleSecondsMax:Value"]);
}, false);
</text>
}

</script>
@await RenderSectionAsync("scripts", required: false)

<script src="~/assets/accessible-autocomplete.min.js" asp-add-nonce></script>
<script src="~/assets/application-39beab6507cd50944edb58ab76ca9a393e09d467cba25003fbd3104c8a02514b.js" asp-add-nonce></script>
<script src="~/assets/accessible-autocomplete.min.js" asp-add-nonce></script>
<script asp-add-nonce>
@if (canTrack)
{
<text>
window.addEventListener('load', function () {
idlechecks('@_configuration["Google:AnalyticsKey"]',
@_configuration["SessionidleSecondsMax:Value"]);
}, false);
</text>
}
</script>
@Html.GovUkFrontendScriptImports()
</body>
</html>
2 changes: 1 addition & 1 deletion Dfe.Academies.External.Web/Pages/_ViewImports.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, GovUk.Frontend.AspNetCore
@addTagHelper *, Dfe.Academies.External.Web
@addTagHelper *, NetEscapades.AspNetCore.SecurityHeaders.TagHelpers
@addTagHelper *, NetEscapades.AspNetCore.SecurityHeaders.TagHelpers
2 changes: 1 addition & 1 deletion Dfe.Academies.External.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.Options;
using NetEscapades.AspNetCore.SecurityHeaders;
using Notify.Client;
using Notify.Interfaces;
using Polly;
using Polly.Extensions.Http;
using Quartz;
using Serilog;
using StackExchange.Redis;
using NetEscapades.AspNetCore.SecurityHeaders;

namespace Dfe.Academies.External.Web
{
Expand Down
Loading