Skip to content

Commit

Permalink
[TM-12] Adds Your transfers page & wraps it in a feature toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyGB committed Apr 30, 2021
1 parent df2bdf0 commit 3aa81a9
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ public static string EmployerIncentivesAction(this UrlHelper helper, string path
return Action(baseUrl, $"{hashedAccountId}/{path}");
}

public static string YourTransfersAction(this UrlHelper helper, string path = "")
{
var configuration = DependencyResolver.Current.GetService<EmployerAccountsConfiguration>();
var baseUrl = configuration.EmployerFinanceBaseUrl;
var hashedAccountId = helper.RequestContext.RouteData.Values[ControllerConstants.AccountHashedIdRouteKeyName];
return Action(baseUrl, $"transfers/{hashedAccountId}");
}

public static string EmployerProjectionsAction(this UrlHelper helper, string path)
{
var configuration = DependencyResolver.Current.GetService<EmployerAccountsConfiguration>();
Expand Down
10 changes: 10 additions & 0 deletions src/SFA.DAS.EmployerAccounts.Web/Views/EmployerTeam/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ else
<p>Apply for the payment, view applications and change your payment details.</p>
</div>
}

@if (Model.Data.ApprenticeshipEmployerType!= ApprenticeshipEmployerType.Levy
&& Html.IsAuthorized("EmployerFeature.TransfersMatching"))
{
<div class="card">
<h3 class="heading-medium"><a href="@Url.YourTransfersAction()">Your transfers</a></h3>
<p>View your 25% transfers balance and manage your transfers, including finding a business to transfer your levy to.</p>
</div>
}

</div>
</section>

Expand Down
17 changes: 17 additions & 0 deletions src/SFA.DAS.EmployerFinance.Web/Controllers/TransfersController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Web.Mvc;
using SFA.DAS.Authorization.Mvc.Attributes;

namespace SFA.DAS.EmployerFinance.Web.Controllers
{
[DasAuthorize("EmployerFeature.TransfersMatching")]
[RoutePrefix("transfers")]
public class TransfersController : Controller
{
[HttpGet]
[Route("{hashedAccountId}")]
public ActionResult Index(string hashedAccountId)
{
return View();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
<Compile Include="Controllers\EmployerTeamController.cs" />
<Compile Include="Controllers\HealthCheckController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\TransfersController.cs" />
<Compile Include="DependencyResolution\ControllerConvention.cs" />
<Compile Include="DependencyResolution\DefaultRegistry.cs" />
<Compile Include="DependencyResolution\IoC.cs" />
Expand Down Expand Up @@ -641,6 +642,7 @@
<Content Include="Views\Shared\_GoogleTagManager.cshtml" />
<Content Include="Views\Shared\_GoogleTagManagerNoScript.cshtml" />
<Content Include="Views\Shared\_ZenDeskApiPush.cshtml" />
<Content Include="Views\Transfers\Index.cshtml" />
</ItemGroup>
<ItemGroup />
<PropertyGroup>
Expand Down
23 changes: 23 additions & 0 deletions src/SFA.DAS.EmployerFinance.Web/Views/Transfers/Index.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

@{
ViewBag.PageID = "transfers";
ViewBag.Section = "transfers";
ViewBag.Title = "Transfers";
ViewBag.AnalyticsData.Vpv = $"/finance/home";
ViewBag.ZenDeskLabel = "eas-finance";
}

<h1 class="heading-xlarge">Your Transfers</h1>

@section breadcrumb {
<div class="breadcrumbs">
<ol role="navigation">
<li><a href="@Url.EmployerAccountsAction("teams")">Home</a></li>
<li><a href="@Url.LegacyEasAccountAction("finance")">Finance</a></li>
<li>@ViewBag.Title</li>
</ol>
</div>
}

@section pageSpecificJS {
}

0 comments on commit 3aa81a9

Please sign in to comment.