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

EHD-1043: Manage Organisations page: Re-wire links to point at new page #593

Merged
merged 1 commit into from
Oct 11, 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
2 changes: 1 addition & 1 deletion GenderPayGap.WebUI/Controllers/CompareController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public IActionResult CompareEmployers(string command, int year = 0)
switch (command.ToLower())
{
case "employer":
return RedirectToAction(nameof(ViewingController.Employer), "Viewing", new {employerIdentifier = args});
return RedirectToAction("ViewEmployerPage", "Redirect", new {employerIdentifier = args});
case "report":
return RedirectToAction(nameof(ViewingController.Report), "Viewing", new {employerIdentifier = args, year});
}
Expand Down
9 changes: 9 additions & 0 deletions GenderPayGap.WebUI/Controllers/RedirectController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using GenderPayGap.WebUI.Classes;
using GenderPayGap.WebUI.Helpers;
using Microsoft.AspNetCore.Mvc;

namespace GenderPayGap.WebUI.Controllers
Expand Down Expand Up @@ -98,5 +99,13 @@ public IActionResult GuidancePdfRedirects()
return Redirect("https://www.gov.uk/government/publications/gender-pay-gap-reporting-guidance-for-employers/closing-your-gender-pay-gap");
}

[HttpGet("/Employer/{employerIdentifier}")]
public IActionResult ViewEmployerPage(string employerIdentifier, int? page = 1)
{
long organisationId = ControllerHelper.DeObfuscateOrganisationIdOrThrow404(employerIdentifier);

return RedirectToAction("Employer", "ViewReports", new {organisationId});
}

}
}
19 changes: 1 addition & 18 deletions GenderPayGap.WebUI/Controllers/ViewingController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
Expand Down Expand Up @@ -119,23 +119,6 @@ public IActionResult SuggestEmployerNameJs(string search)

#endregion

#region Employer details

[HttpGet("~/Employer/{employerIdentifier}")]
public IActionResult Employer(string employerIdentifier, int? page = 1)
{
if (string.IsNullOrWhiteSpace(employerIdentifier))
{
return new HttpBadRequestResult("Missing employer identifier");
}

long organisationId = ControllerHelper.DeObfuscateOrganisationIdOrThrow404(employerIdentifier);

return RedirectToAction("Employer", "ViewReports", new {organisationId});
}

#endregion

#region Reports

[HttpGet("~/EmployerReport/{employerIdentifier}/{year}")]
Expand Down
2 changes: 1 addition & 1 deletion GenderPayGap.WebUI/Views/Admin/ViewOrganisation.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</h1>

<p class="govuk-body">
<a href="@Url.Action("Employer", "Viewing", new {employerIdentifier = Model.Organisation.GetEncryptedId()})"
<a href="@Url.Action("Employer", "ViewReports", new {organisationId = Model.Organisation.OrganisationId})"
class="govuk-link">
'@(Model.Organisation.OrganisationName)' on viewing service
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<partial name="~/Views/Compare/ComparisonBasket.cshtml" model="ViewBag.BasketViewModel"/>
<div class="grid-row">
<div class="column-full">
<a class="link-back" href="@(Url.Action("Employer", new {employerIdentifier}))">View all reports for this employer</a>
<a class="link-back" href="@Url.Action("Employer", "ViewReports", new {organisationId = Model.Organisation.OrganisationId})">View all reports for this employer</a>
<h1 class="heading-large">
<div id="OrganisationName">
@Model.Organisation.OrganisationName
Expand Down
3 changes: 2 additions & 1 deletion GenderPayGap.WebUI/Views/Viewing/Finder/Parts/Results.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using GenderPayGap.Core.Models
@using GenderPayGap.Core.Classes
@model GenderPayGap.WebUI.Models.Search.SearchViewModel

<ul id="SearchResults" class="results">
Expand All @@ -9,7 +10,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h2>
@Html.ActionLink(employer.Name, "Employer", "Viewing", new {employerIdentifier = employer.OrganisationIdEncrypted}, new {data_name = "ViewLink", data_id = employer.OrganisationIdEncrypted, data_loadtestid = employer.Name})
@Html.ActionLink(employer.Name, "Employer", "ViewReports", new {organisationId = Obfuscator.DeObfuscate(employer.OrganisationIdEncrypted)}, new {data_name = "ViewLink", data_id = employer.OrganisationIdEncrypted, data_loadtestid = employer.Name})
</h2>
@if (string.IsNullOrWhiteSpace(employer.PreviousName) == false)
{
Expand Down