Skip to content

Commit

Permalink
Merge branch 'master' into CON-1957-Adding-apprentice-error-when-acco…
Browse files Browse the repository at this point in the history
…unt-has-deleted-legal-entity
  • Loading branch information
ben1stone-leftdfe committed Jun 24, 2020
2 parents 8ed98b0 + 499add3 commit 2d544d6
Show file tree
Hide file tree
Showing 53 changed files with 1,857 additions and 5,917 deletions.
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
- Open Visual Studio as an administrator
- Open the solution
- Set the following as the startup projects:
- SFA.DAS.CloudService
- SFA.DAS.EmployerAccounts.Web
- SFA.DAS.EmployerFinance.Web
- Running the solution will launch the site in your browser
Expand Down Expand Up @@ -76,14 +75,6 @@ Steps:

![Select Local > ProjectsV13](/docs/img/db3.PNG)

To publish the CosmosDB necessary for the homepage follow these steps:

* Open the SFA.DAS.EAS.Portal.sln
* Set SFA.DAS.EAS.Portal.Worker as the startup project
* Build and run the solution to build the database

** TODO replace the publish with a post deploy step on building**

##### Add configuration to Azure Storage Emulator

The configuration is loaded from azure table storage.
Expand All @@ -99,10 +90,10 @@ The configuration is loaded from azure table storage.

- Create an [Azure] account and set up a table storage
- Create a table called Configuration and copy across these 4 rows from the employer config setup above changing the PartitionKey to "Development" from "LOCAL":
* SFA.DAS.EmployerApprenticeshipsService.Portal_1.0
* SFA.DAS.CommitmentsAPI_1.0
* SFA.DAS.ApprenticeshipInfoServiceAPI_1.0
* SFA.DAS.EmployerApprenticeshipsService.Portal.Client_1.0
* SFA.DAS.EmployerApprenticeshipsService._1.0
* SFA.DAS.EmployerFinance_1.0
* SFA.DAS.EmployerFinanceV2_1.0
* SFA.DAS.EmployerAccounts_1.0

##### Set up enivronment variables

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public void Arrange()
{
AccountLegalEntityId = ExpectedAccountLegalEntityId,
TemplateId = 1,
Id = ExpectedEmployerAgreementId
Id = ExpectedEmployerAgreementId,
SignedDate = DateTime.Now
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public async Task ThenIfTheCommandIsValidTheRepositoryIsCalledWithThePassedParam
_hashingService.Setup(x => x.DecodeValue(_command.HashedAgreementId)).Returns(agreementId);

//Act
await _handler.Handle(_command);
var response = await _handler.Handle(_command);

//Assert
_agreementRepository.Verify(x => x.SignAgreement(It.Is<SignEmployerAgreement>(c => c.SignedDate.Equals(_command.SignedDate)
Expand All @@ -181,6 +181,9 @@ public async Task ThenIfTheCommandIsValidTheRepositoryIsCalledWithThePassedParam
&& c.SignedById.Equals(_owner.UserId)
&& c.SignedByName.Equals($"{_owner.FirstName} {_owner.LastName}")
)));

Assert.AreEqual(OrganisationName, response.LegalEntityName);
Assert.AreEqual(AgreementType, response.AgreementType);
}

[Test]
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc;
using SFA.DAS.Authentication;
using SFA.DAS.EmployerAccounts.Interfaces;
using SFA.DAS.EmployerAccounts.Web.ViewModels;

namespace SFA.DAS.EmployerAccounts.Web.Controllers
{
{
public class CookieConsentController : BaseController
{
public CookieConsentController(
Expand All @@ -19,38 +17,11 @@ ICookieStorageService<FlashMessageViewModel> flashMessage
}

[HttpGet]
[Route("accounts/{HashedAccountId}/cookieConsent/{saved}", Order = 0)]
[Route("accounts/{HashedAccountId}/cookieConsent", Order = 1)]
[Route("cookieConsent/{saved}", Order = 2)]
[Route("cookieConsent", Order = 3)]
public ActionResult Settings(bool saved = false)
{
return View(new { Saved = saved });
}

[HttpPost]
[Route("accounts/{HashedAccountId}/cookieConsent", Order = 0)]
[Route("cookieConsent", Order = 1)]
public ActionResult Settings(bool analyticsConsent, bool marketingConsent)
public ActionResult Settings()
{
var domain = Request.IsLocal ? Request.Url.Host :
Request.Url.Host.IndexOf('.') > 0 ? Request.Url.Host.Substring(Request.Url.Host.IndexOf('.')) :
Request.Url.Host;

var cookies = new List<HttpCookie>
{
new HttpCookie("DASSeenCookieMessage", true.ToString().ToLower()),
new HttpCookie("AnalyticsConsent", analyticsConsent.ToString().ToLower()),
new HttpCookie("MarketingConsent", marketingConsent.ToString().ToLower())
};

cookies.ForEach(x =>
{
x.Domain = domain;
ControllerContext.HttpContext.Response.Cookies.Add(x);
});

return RedirectToAction("Settings", new { saved = true });
return View();
}

[HttpGet]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using SFA.DAS.EmployerAccounts.Queries.GetEmployerAgreement;
Expand Down Expand Up @@ -171,41 +172,9 @@ public async Task<ActionResult> Sign(string agreementId, string hashedAccountId,

if (response.Status == HttpStatusCode.OK)
{
FlashMessageViewModel flashMessage = new FlashMessageViewModel
{
Headline = "Agreement(s) signed",
Severity = FlashMessageSeverityLevel.Success
};

ActionResult result;

if (response.Data.SignedAgreementType == AgreementType.NonLevyExpressionOfInterest)
{
flashMessage.Headline = "Memorandum of Understanding signed";
flashMessage.Message = "You’ve successfully signed the Memorandum of Understanding for your organisation.";
result = RedirectToAction(ControllerConstants.IndexActionName, ControllerConstants.EmployerTeamControllerName);
}
else if (response.Data.HasFurtherPendingAgreements)
{
flashMessage.Headline = "Agreement accepted";
flashMessage.Message = "You've successfully accepted an agreement. You still need to review and accept your other agreements.";

result = RedirectToAction(
ControllerConstants.IndexActionName,
ControllerConstants.EmployerAgreementControllerName,
new { hashedAccountId, agreementSigned = true }
);
}
else
{
flashMessage.Headline = "Agreement accepted";
flashMessage.Message = "You’ve successfully accepted all of your organisation’s agreements.";
result = RedirectToAction(ControllerConstants.IndexActionName, ControllerConstants.EmployerTeamControllerName);
}

AddFlashMessageToCookie(flashMessage);

return result;
ViewBag.CompanyName = response.Data.LegalEntityName;
ViewBag.HasFurtherPendingAgreements = response.Data.HasFurtherPendingAgreements;
return View(ControllerConstants.AcceptedEmployerAgreementViewName);
}

return RedirectToAction(ControllerConstants.SignAgreementActionName, new GetEmployerAgreementRequest { AgreementId = agreementId, ExternalUserId = userInfo, HashedAccountId = hashedAccountId });
Expand Down
Loading

0 comments on commit 2d544d6

Please sign in to comment.