Skip to content

Commit 0f85654

Browse files
committed
Fixes redirect controller code, appends "legacy" and formatter changes
1 parent 065bd33 commit 0f85654

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

DigitalLearningSolutions.Web.Tests/Controllers/SuperAdmin/FaqControllerTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ namespace DigitalLearningSolutions.Web.Tests.Controllers.SuperAdmin
1212
using FluentAssertions;
1313
using FluentAssertions.AspNetCore.Mvc;
1414
using NUnit.Framework;
15+
using DigitalLearningSolutions.Data.Extensions;
16+
using Microsoft.Extensions.Configuration;
1517

1618
public class FaqControllerTests
1719
{
@@ -24,12 +26,14 @@ public class FaqControllerTests
2426
private SuperAdminFaqsController controller = null!;
2527

2628
private IFaqsService faqService = null!;
29+
private IConfiguration configuration = null!;
2730

2831
[SetUp]
2932
public void Setup()
3033
{
3134
faqService = A.Fake<IFaqsService>();
32-
controller = new SuperAdminFaqsController(faqService);
35+
configuration = A.Fake<IConfiguration>();
36+
controller = new SuperAdminFaqsController(faqService, configuration);
3337
A.CallTo(() => faqService.GetAllFaqs())
3438
.Returns(faqs);
3539
}

DigitalLearningSolutions.Web/Controllers/SuperAdmin/SuperAdminFaqsController.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,25 @@ public IActionResult Index()
4343

4444
return View("SuperAdminFaqs", model);
4545
}
46+
[Route("Faqs/Manage")]
4647
public IActionResult ManageFaqs()
4748
{
48-
return RedirectToPage(legacyUrl + "tracking/admin-faqs");
49+
return Redirect(legacyUrl + "/tracking/admin-faqs");
4950
}
51+
[Route("Resources")]
5052
public IActionResult Resources()
5153
{
52-
return RedirectToPage(legacyUrl + "tracking/admin-resources");
54+
return Redirect(legacyUrl + "/tracking/admin-resources");
5355
}
56+
[Route("Notifications")]
5457
public IActionResult Notifications()
5558
{
56-
return RedirectToPage(legacyUrl + "tracking/admin-notifications");
59+
return Redirect(legacyUrl + "/tracking/admin-notifications");
5760
}
61+
[Route("Brands")]
5862
public IActionResult Brands()
5963
{
60-
return RedirectToPage(legacyUrl + "tracking/admin-landing");
64+
return Redirect(legacyUrl + "/tracking/admin-landing");
6165
}
6266
}
6367
}

DigitalLearningSolutions.Web/Views/SuperAdmin/Shared/_SystemSideNavMenu.cshtml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
<ul class="nhsuk-list side-nav__list">
66

77
<vc:side-menu-link asp-action="Brands"
8-
asp-controller="SuperAdminFaqs"
9-
link-text="Brands"
10-
is-current-page="@(Model == SuperAdminSystemPage.ManageLists)" />
8+
asp-controller="SuperAdminFaqs"
9+
link-text="Brands (legacy)"
10+
is-current-page="@(Model == SuperAdminSystemPage.ManageLists)" />
1111

1212
<vc:side-menu-link asp-action="Notifications"
13-
asp-controller="SuperAdminFaqs"
14-
link-text="Notifications"
15-
is-current-page="@(Model == SuperAdminSystemPage.Notifications)" />
13+
asp-controller="SuperAdminFaqs"
14+
link-text="Notifications (legacy)"
15+
is-current-page="@(Model == SuperAdminSystemPage.Notifications)" />
1616

1717
<vc:side-menu-link asp-action="Resources"
18-
asp-controller="SuperAdminFaqs"
19-
link-text="Resources"
20-
is-current-page="@(Model == SuperAdminSystemPage.Resources)" />
18+
asp-controller="SuperAdminFaqs"
19+
link-text="Resources (legacy)"
20+
is-current-page="@(Model == SuperAdminSystemPage.Resources)" />
2121

22-
<vc:side-menu-link asp-action="Index"
23-
asp-controller="SuperAdminFaqs"
24-
link-text="FAQs"
25-
is-current-page="@(Model == SuperAdminSystemPage.FAQs)" />
22+
<vc:side-menu-link asp-action="Index"
23+
asp-controller="SuperAdminFaqs"
24+
link-text="FAQs"
25+
is-current-page="@(Model == SuperAdminSystemPage.FAQs)" />
2626
</ul>

0 commit comments

Comments
 (0)