Skip to content

Commit

Permalink
Merge branch 'master' into TM-173-LTM-Integration-With-Reservations-A…
Browse files Browse the repository at this point in the history
…nd-Approvals
  • Loading branch information
chrisfoster76 committed Oct 26, 2021
2 parents 0338388 + e5082e7 commit 05be832
Show file tree
Hide file tree
Showing 30 changed files with 123 additions and 341 deletions.
7 changes: 7 additions & 0 deletions src/SFA.DAS.EAS.Web/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ public ActionResult ServiceStartPage()
return Redirect(Url.EmployerAccountsAction("service/start", false));
}

[HttpGet]
[Route("termsAndConditions/overview")]
public ActionResult TermsAndConditionsOverview()
{
return Redirect(Url.EmployerAccountsAction("service/termsAndConditions/overview", false));
}

private string GetTrackerQueryString()
{
var trackerValue = Url.RequestContext.HttpContext.Request.QueryString[GoogleTag];
Expand Down
2 changes: 0 additions & 2 deletions src/SFA.DAS.EAS.Web/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public void Configuration(IAppBuilder app)
JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();
UserLinksViewModel.ChangePasswordLink = $"{constants.ChangePasswordLink()}{urlHelper.Encode("https://" + config.DashboardUrl + "/service/password/change")}";
UserLinksViewModel.ChangeEmailLink = $"{constants.ChangeEmailLink()}{urlHelper.Encode("https://" + config.DashboardUrl + "/service/email/change")}";
UserLinksViewModel.TermsAndConditionsLink = constants.TermsAndConditionsLink();
}

private static Func<X509Certificate2> GetSigningCertificate(bool useCertificate)
Expand Down Expand Up @@ -150,6 +149,5 @@ public Constants(IdentityServerConfiguration configuration)
public string RequiresVerification() => _baseUrl + "requires_verification";
public string TokenEndpoint() => $"{_configuration.BaseAddress}{_configuration.TokenEndpoint}";
public string UserInfoEndpoint() => $"{_configuration.BaseAddress}{_configuration.UserInfoEndpoint}";
public string TermsAndConditionsLink() => $"{_configuration.BaseAddress.Replace("/identity", "")}{_configuration.TermsAndConditionsLink}";
}
}
1 change: 0 additions & 1 deletion src/SFA.DAS.EAS.Web/ViewModels/UserLinksViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ public static class UserLinksViewModel
{
public static string ChangePasswordLink { get; set; }
public static string ChangeEmailLink { get; set; }
public static string TermsAndConditionsLink { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/SFA.DAS.EAS.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
<li><a href="@Url.Action("Help", "Home")" target="_blank">Help</a></li>
<li><a href="https://www.smartsurvey.co.uk/s/apprenticeshipservicefeedback/" target="_blank">Feedback</a></li>
<li><a href="@Url.Action("Privacy", "Home")">Privacy and cookies</a></li>
<li> <a target="_blank" href="@UserLinksViewModel.TermsAndConditionsLink">Terms and conditions</a></li>
<li> <a target="_blank" href="@Url.Action("TermsAndConditionsOverview", "Home")">Terms and conditions</a></li>
<li>Built by the <a href="http://gov.uk/esfa" target="_blank">Education and Skills Funding Agency</a></li>
</ul>
<div class="open-government-licence">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public void ThenTheViewModelIsMappedCorrectly()
var viewResult = (ViewResult)result;
var viewModel = viewResult.Model;

Assert.IsInstanceOf<TermsAndConditionViewModel>(viewModel);
var termsAndConditionViewModel = (TermsAndConditionViewModel)viewModel;
Assert.IsInstanceOf<TermsAndConditionsNewViewModel>(viewModel);
var termsAndConditionViewModel = (TermsAndConditionsNewViewModel)viewModel;

Assert.AreEqual("returnUrl", termsAndConditionViewModel.ReturnUrl);
Assert.AreEqual("hashedId", termsAndConditionViewModel.HashedAccountId);
Expand All @@ -80,7 +80,7 @@ public void ThenTheViewModelIsMappedCorrectly()
[Test]
public async Task ThenIsRedirectedToEmployerTeamController()
{
var termsAndConditionViewModel = new TermsAndConditionViewModel() { HashedAccountId = "HashedId", ReturnUrl = "EmployerTeam" };
var termsAndConditionViewModel = new TermsAndConditionsNewViewModel() { HashedAccountId = "HashedId", ReturnUrl = "EmployerTeam" };
//Act
var result = await _homeController.TermsAndConditions(termsAndConditionViewModel);

Expand All @@ -94,7 +94,7 @@ public async Task ThenIsRedirectedToEmployerTeamController()
[Test]
public async Task ThenIsRedirectedToHomeController()
{
var termsAndConditionViewModel = new TermsAndConditionViewModel() { HashedAccountId = "HashedId", ReturnUrl = "Home" };
var termsAndConditionViewModel = new TermsAndConditionsNewViewModel() { HashedAccountId = "HashedId", ReturnUrl = "Home" };
//Act
var result = await _homeController.TermsAndConditions(termsAndConditionViewModel);

Expand Down
13 changes: 10 additions & 3 deletions src/SFA.DAS.EmployerAccounts.Web/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,27 @@ public async Task<ActionResult> Index()
return RedirectToAction(ControllerConstants.GetApprenticeshipFundingActionName, ControllerConstants.EmployerAccountControllerName);
}

[HttpGet]
[Route("termsAndConditions/overview")]
public ActionResult TermsAndConditionsOverview()
{
return View();
}


[HttpGet]
[DasAuthorize]
[Route("termsAndConditions")]
public ActionResult TermsAndConditions(string returnUrl, string hashedAccountId)
{
var termsAndConditionViewModel = new TermsAndConditionViewModel { ReturnUrl = returnUrl, HashedAccountId = hashedAccountId };
return View(termsAndConditionViewModel);
var termsAndConditionsNewViewModel = new TermsAndConditionsNewViewModel { ReturnUrl = returnUrl, HashedAccountId = hashedAccountId };
return View(termsAndConditionsNewViewModel);
}

[HttpPost]
[DasAuthorize]
[Route("termsAndConditions")]
public async Task<ActionResult> TermsAndConditions(TermsAndConditionViewModel termsAndConditionViewModel)
public async Task<ActionResult> TermsAndConditions(TermsAndConditionsNewViewModel termsAndConditionViewModel)
{
var userRef = OwinWrapper.GetClaimValue(ControllerConstants.UserRefClaimKeyName);
await _homeOrchestrator.UpdateTermAndConditionsAcceptedOn(userRef);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static string GetZenDeskCobrowsingSnippetKey(this HtmlHelper html)
public static IHeaderViewModel GetHeaderViewModel(this HtmlHelper html, bool useLegacyStyles = false)
{
var configuration = DependencyResolver.Current.GetService<EmployerAccountsConfiguration>();
var employerAccountsBaseUrl = configuration.EmployerAccountsBaseUrl + (configuration.EmployerAccountsBaseUrl.EndsWith("/") ? "" : "/");

var headerModel = new HeaderViewModel(new HeaderConfiguration
{
Expand All @@ -96,9 +97,9 @@ public static IHeaderViewModel GetHeaderViewModel(this HtmlHelper html, bool use
AuthenticationAuthorityUrl = configuration.Identity.BaseAddress,
ClientId = configuration.Identity.ClientId,
EmployerRecruitBaseUrl = configuration.EmployerRecruitBaseUrl,
SignOutUrl = new Uri($"{configuration.EmployerAccountsBaseUrl}/service/signOut"),
ChangeEmailReturnUrl = new System.Uri(configuration.EmployerAccountsBaseUrl + "/service/email/change"),
ChangePasswordReturnUrl = new System.Uri(configuration.EmployerAccountsBaseUrl + "/service/password/change")
SignOutUrl = new Uri($"{employerAccountsBaseUrl}service/signOut"),
ChangeEmailReturnUrl = new Uri($"{employerAccountsBaseUrl}service/email/change"),
ChangePasswordReturnUrl = new Uri($"{employerAccountsBaseUrl}service/password/change")
},
new UserContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
<Version>1.0.16</Version>
</PackageReference>
<PackageReference Include="SFA.DAS.MA.Shared.UI">
<Version>1.1.75</Version>
<Version>1.1.79</Version>
</PackageReference>
<PackageReference Include="SFA.DAS.NLog.Logger" Version="1.2.1" />
<PackageReference Include="SFA.DAS.NLog.Targets.Redis" Version="1.2.1" />
Expand Down Expand Up @@ -255,7 +255,7 @@
<Compile Include="Models\AccountContext.cs" />
<Compile Include="Models\ReturnUrlModel.cs" />
<Compile Include="Models\HashedAccountIdModel.cs" />
<Compile Include="ViewModels\TermsAndConditionViewModel.cs" />
<Compile Include="ViewModels\TermsAndConditionsNewViewModel.cs" />
<Compile Include="ViewModels\TriageViewModel.cs" />
<Compile Include="OrchestratorResponse.cs" />
<Compile Include="Orchestrators\EmployerAccountOrchestrator.cs" />
Expand Down Expand Up @@ -875,6 +875,7 @@
<Content Include="Views\Shared\_Agreement_v6.cshtml" />
<Content Include="Views\SearchOrganisation\ConfirmOrganisationDetails.cshtml" />
<Content Include="Views\Home\TermsAndConditions.cshtml" />
<Content Include="Views\Home\TermsAndConditionsOverview.cshtml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SFA.DAS.Account.Api.Client\SFA.DAS.EAS.Account.Api.Client.csproj">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace SFA.DAS.EmployerAccounts.Web.ViewModels
{
public class TermsAndConditionViewModel
public class TermsAndConditionsNewViewModel
{
public string ReturnUrl { get; set; }
public string HashedAccountId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
_ga
</td>
<td class="govuk-table__cell">
Used by Google Analytics, this registers a unique ID to generate statistics about how you use the website
Used by Google Analytics to distinguish users.
</td>
<td class="govuk-table__cell">
1 year
2 year
</td>
</tr>
<tr>
Expand All @@ -78,18 +78,18 @@
Google Analytics throttling rate request
</td>
<td class="govuk-table__cell">
1 year
1 minute
</td>
</tr>
<tr>
<td class="govuk-table__cell">
_gid
</td>
<td class="govuk-table__cell">
Google Analytics cookie that registers a unique ID to generate statistics about how you use the website
Used by Google Analytics to distinguish users.
</td>
<td class="govuk-table__cell">
1 year
1 day
</td>
</tr>
<tr>
Expand Down Expand Up @@ -150,16 +150,48 @@
<td class="govuk-table__cell">This monitors the performance of the website</td>
<td class="govuk-table__cell">Session</td>
</tr>
<tr>
<td class="govuk-table__cell">
sfa-das-employerapprenticeshipsservice-accountcontext
</td>
<td class="govuk-table__cell">This enables the website to function properly</td>
<td class="govuk-table__cell">1 day</td>
</tr>
<tr>
<td class="govuk-table__cell">
recruit-data
</td>
<td class="govuk-table__cell">This enables the website to function properly</td>
<td class="govuk-table__cell">Session</td>
</tr>
<tr>
<td class="govuk-table__cell">
setup-employer-[AccountID]
</td>
<td class="govuk-table__cell">This enables the website to function properly</td>
<td class="govuk-table__cell">Session</td>
</tr>
<tr>
<td class="govuk-table__cell">
__cfruid
</td>
<td class="govuk-table__cell">Used by the content network, Cloudflare, to identify trusted web traffic.</td>
<td class="govuk-table__cell">1 year</td>
</tr>
<tr>
<td class="govuk-table__cell">
SFA.DAS.EmployerCommitmentsV2.Web.Auth
</td>
<td class="govuk-table__cell">This enables the website to function properly</td>
<td class="govuk-table__cell">Session</td>
</tr>

</tbody>
</table>

<hr class="govuk-section-break govuk-section-break--l g" />

<h3 class="govuk-heading-s">Change your settings</h3>
<p>You can <a href="@Url.Action(ControllerConstants.Settings)" class="govuk-link">change which cookies you're happy for us to use</a>.</p>



</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@model SFA.DAS.EmployerAccounts.Web.ViewModels.TermsAndConditionViewModel
@model SFA.DAS.EmployerAccounts.Web.ViewModels.TermsAndConditionsNewViewModel
@{
ViewBag.PageID = "page-terms-and-condition";
ViewBag.Section = "home";
ViewBag.Title = "Term and Conditions";
ViewBag.Title = "Terms and Conditions";
Layout = "~/Views/Shared/_Layout_CDN.cshtml";
string returnUrl = string.Empty;
if (Model.ReturnUrl == "EmployerTeam")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@{
ViewBag.PageID = "page-terms-and-conditions-overview";
ViewBag.Section = "home";
ViewBag.Title = "Terms and Conditions";
ViewBag.HideNav = true;
Layout = "~/Views/Shared/_Layout_CDN.cshtml";
}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl">Terms of use</h1>
<p class="govuk-body govuk-!-padding-bottom-3">
To use this service you agree&nbsp;to:&nbsp;
</p>
<p>
<ul class="govuk-list govuk-list--bullet govuk-!-margin-bottom-9">
<li>Sign out at the end of each session</li>
<li>Input truthful and accurate information</li>
<li>Adhere to the <a href="http://www.legislation.gov.uk/ukpga/1990/18/contents" target="_blank">Computer Misuse Act 1990</a></li>
<li>Use only a legitimate email address that you or people in your organisation has access to</li>
<li>Keep your sign in details secure and do not share them with third parties</li>
<li>Not use discriminatory wording as set out in the <a href="https://www.gov.uk/guidance/equality-act-2010-guidance#equalities-act-2010-legislation" target="_blank">Equality Act 2010</a></li>
<li>Make sure the published rates of pay comply with the <a href="https://www.gov.uk/national-minimum-wage-rates" target="_blank">National Minimum Wage</a> guidelines and are not misleading to candidates</li>
<li>Adhere to all relevant <a href="https://www.gov.uk/browse/employing-people" target="_blank">UK employment law</a></li>
<li>If you are a commercial organisation as defined in <a href="https://www.legislation.gov.uk/ukpga/2015/30/section/54/enacted" target="_blank">section 54 of the Modern Slavery Act 2015</a>, adhere to the annual reporting requirements</li>
<li>Your apprenticeship adverts being publicly accessible, including the possibility of partner websites displaying them</li>
<li>Comply with the government safeguarding policies for <a href="https://www.gov.uk/government/publications/ofsted-safeguarding-policy" target="_blank">children</a> and <a href="https://www.gov.uk/government/publications/safeguarding-policy-protecting-vulnerable-adults" target="_blank">vulnerable adults</a></li>
<li>Not provide feedback on a training provider when you are an employer provider</li>
<li>Be an active and trading business at the point of creating an apprenticeship service account</li>
<li>Only add apprentices that are linked to the PAYE scheme registered in your employer account</li>
<li>Comply at all times with the Apprenticeship Agreement for Employers and Apprenticeship Funding Rules</li>
</ul>
</p>
<p class="govuk-body">When you sign up for an apprenticeship service account we may need to verify and validate your company. You may not be granted an account if you fail the checks conducted by ESFA.</p>
<p class="govuk-body">Your contact details and information associated with your account will be collected and used for the support and administration of your account.</p>
<p class="govuk-body">We will not:</p>
<ul class="govuk-list govuk-list--bullet">
<li>Use or disclose this information for other purposes (except where we’re legally required to do so)</li>
<li>Use your details for any marketing purposes or for any reason unrelated to the use of your account</li>
</ul>
<p class="govuk-body">We may update these terms and conditions at any time without notice. You’ll agree to any changes if you continue to use this service after the terms and conditions have been updated.</p>
</div>
</div>

Loading

0 comments on commit 05be832

Please sign in to comment.