diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 000000000..f1c048c02 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,62 @@ +name: Build and Test + +on: + push: + branches: + - master + - dev + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + build: + runs-on: windows-latest + env: + DOTNET_VERSION: '6.0.x' + + steps: + - uses: actions/checkout@v3 + + - name: Setup .NET Core SDK ${{ env.DOTNET_VERSION }} + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.1.1 + + - name: Setup VSTest + uses: darenm/Setup-VSTest@v1 + + - name: Restore Packages + working-directory: ./Web + run: nuget restore EdubaseWeb.sln + + - name: Build Solution + working-directory: ./Web + run: | + msbuild.exe EdubaseWeb.sln /t:Rebuild /p:platform="Any CPU" /p:configuration="Release" + + ## Currently manually specifying the tests to trigger -- unclear if these can be picked up automatically? + - name: Run Tests + working-directory: ./Web + run: | + vstest.console.exe /Enablecodecoverage .\Edubase.CommonUnitTests\bin\Release\Edubase.CommonUnitTests.dll + vstest.console.exe /Enablecodecoverage .\Edubase.DataUnitTests\bin\Release\Edubase.DataUnitTests.dll + vstest.console.exe /Enablecodecoverage .\Edubase.ServicesUnitTests\bin\Release\Edubase.ServicesUnitTests.dll + vstest.console.exe /Enablecodecoverage .\Edubase.Web.ResourcesUnitTests\bin\Release\Edubase.Web.ResourcesUnitTests.dll + vstest.console.exe /Enablecodecoverage .\Edubase.Web.UIUnitTests\bin\Release\net48\Edubase.Web.UIUnitTests.dll + + + - name: Upload dotnet test results + uses: actions/upload-artifact@v3.1.2 + with: + name: dotnet-results-${{ env.DOTNET_VERSION }} + path: ./Web/TestResults + if: ${{ always() }} diff --git a/Web/Edubase.Services.Texuna/Lookup/LookupApiService.cs b/Web/Edubase.Services.Texuna/Lookup/LookupApiService.cs index 6a4635463..28bbb2c5f 100644 --- a/Web/Edubase.Services.Texuna/Lookup/LookupApiService.cs +++ b/Web/Edubase.Services.Texuna/Lookup/LookupApiService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using System.Security.Principal; using System.Threading.Tasks; using Edubase.Services.Domain; using Edubase.Services.Lookup; @@ -7,7 +8,7 @@ namespace Edubase.Services.Texuna.Lookup { - public class LookupApiService : ILookupService + public class LookupApiService : ILookupService, IUserDependentLookupService { private const string ApiPrefix = "lookup/"; private readonly IHttpClientWrapper _httpClient; @@ -386,6 +387,11 @@ public async Task> CASWardsGetAllAsync() return await GetData("cas-wards"); } + public async Task> EstablishmentStatusesGetAllAsync(IPrincipal user) + { + return (await _httpClient.GetAsync>(ApiPrefix + "establishment-statuses", user)).GetResponse(); + } + private async Task> GetData(string name) { return (await _httpClient.GetAsync>(ApiPrefix + name, diff --git a/Web/Edubase.Services.TexunaUnitTests/Lookup/LookupApiServiceTests.cs b/Web/Edubase.Services.TexunaUnitTests/Lookup/LookupApiServiceTests.cs index 30df4bc17..d1b47cb18 100644 --- a/Web/Edubase.Services.TexunaUnitTests/Lookup/LookupApiServiceTests.cs +++ b/Web/Edubase.Services.TexunaUnitTests/Lookup/LookupApiServiceTests.cs @@ -50,7 +50,8 @@ public void LookupApiService_ConstructorTest() public async Task AsyncLookupsTest(string lookupType) { //use reflection to construct method name - var method = _lookupApiService.GetType().GetMethod($"{lookupType}GetAllAsync"); + var method = _lookupApiService.GetType().GetMethod($"{lookupType}GetAllAsync", + Type.EmptyTypes); var taskResult = method.Invoke(_lookupApiService, null) as Task>; var result = await taskResult; diff --git a/Web/Edubase.Services/Edubase.Services.csproj b/Web/Edubase.Services/Edubase.Services.csproj index 9a541f3ea..b8550cd69 100644 --- a/Web/Edubase.Services/Edubase.Services.csproj +++ b/Web/Edubase.Services/Edubase.Services.csproj @@ -294,6 +294,7 @@ + diff --git a/Web/Edubase.Services/Lookup/IUserDependentLookupService.cs b/Web/Edubase.Services/Lookup/IUserDependentLookupService.cs new file mode 100644 index 000000000..4edc18b6a --- /dev/null +++ b/Web/Edubase.Services/Lookup/IUserDependentLookupService.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Principal; +using System.Text; +using System.Threading.Tasks; +using Edubase.Services.Domain; + +namespace Edubase.Services.Lookup +{ + public interface IUserDependentLookupService + { + Task> EstablishmentStatusesGetAllAsync(IPrincipal user); + } +} diff --git a/Web/Edubase.Web.Resources/IResourcesHelper.cs b/Web/Edubase.Web.Resources/IResourcesHelper.cs index a5c8a4cb9..d31887224 100644 --- a/Web/Edubase.Web.Resources/IResourcesHelper.cs +++ b/Web/Edubase.Web.Resources/IResourcesHelper.cs @@ -7,4 +7,4 @@ public interface IResourcesHelper { string GetResourceStringForEstablishment(string name, eLookupEstablishmentTypeGroup? establishmentType, IPrincipal user); } -} \ No newline at end of file +} diff --git a/Web/Edubase.Web.UI/App_Start/IocConfig.cs b/Web/Edubase.Web.UI/App_Start/IocConfig.cs index b606e933a..39e48ebc9 100644 --- a/Web/Edubase.Web.UI/App_Start/IocConfig.cs +++ b/Web/Edubase.Web.UI/App_Start/IocConfig.cs @@ -164,7 +164,8 @@ private static void RegisterTypes(ContainerBuilder builder) builder.Register(c => new LookupApiService( c.ResolveNamed("LookupHttpClientWrapper"), c.Resolve())) - .As(); + .As() + .As(); builder.RegisterType().As(); builder.RegisterType().As(); diff --git a/Web/Edubase.Web.UI/App_Start/StartupSecureAccess.cs b/Web/Edubase.Web.UI/App_Start/StartupSecureAccess.cs index 89a4c32a6..9ac18d250 100644 --- a/Web/Edubase.Web.UI/App_Start/StartupSecureAccess.cs +++ b/Web/Edubase.Web.UI/App_Start/StartupSecureAccess.cs @@ -30,6 +30,7 @@ public partial class StartupSecureAccess public static string ApplicationIdpEntityId => AppSettings[nameof(ApplicationIdpEntityId)]; public static Uri ExternalAuthDefaultCallbackUrl => new Uri(AppSettings[nameof(ExternalAuthDefaultCallbackUrl)]); public static Uri MetadataLocation => new Uri(AppSettings[nameof(MetadataLocation)]); + public static Uri PublicOrigin => string.IsNullOrWhiteSpace(AppSettings[nameof(PublicOrigin)]) ? null : new Uri(AppSettings[nameof(PublicOrigin)]); public void ConfigureAuth(IAppBuilder app) { @@ -84,6 +85,12 @@ private static Saml2AuthenticationOptions CreateAuthServicesOptions() MinIncomingSigningAlgorithm = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" }; + if (PublicOrigin != null) + { + // Only set if provided via configuration + spOptions.PublicOrigin = PublicOrigin; + } + var authServicesOptions = new Saml2AuthenticationOptions(false) { SPOptions = spOptions }; var idp = new IdentityProvider(new EntityId(MetadataLocation.AbsoluteUri), spOptions) diff --git a/Web/Edubase.Web.UI/Areas/Establishments/Controllers/EstablishmentController.cs b/Web/Edubase.Web.UI/Areas/Establishments/Controllers/EstablishmentController.cs index 9024bb3a2..460d66e76 100644 --- a/Web/Edubase.Web.UI/Areas/Establishments/Controllers/EstablishmentController.cs +++ b/Web/Edubase.Web.UI/Areas/Establishments/Controllers/EstablishmentController.cs @@ -51,6 +51,7 @@ public class EstablishmentController : EduBaseController private readonly IMapper _mapper; private readonly IResourcesHelper _resourcesHelper; private readonly IExternalLookupService _externalLookupService; + private readonly IUserDependentLookupService _lookupService; private readonly ISecurityService _securityService; private readonly Lazy _formKeys; @@ -80,7 +81,8 @@ public EstablishmentController(IEstablishmentReadService establishmentReadServic ICachedLookupService cachedLookupService, IResourcesHelper resourcesHelper, ISecurityService securityService, - IExternalLookupService externalLookupService) + IExternalLookupService externalLookupService, + IUserDependentLookupService lookupService) { _cachedLookupService = cachedLookupService; _establishmentReadService = establishmentReadService; @@ -90,6 +92,7 @@ public EstablishmentController(IEstablishmentReadService establishmentReadServic _resourcesHelper = resourcesHelper; _securityService = securityService; _externalLookupService = externalLookupService; + _lookupService = lookupService; _formKeys = new Lazy( () => Request?.Form?.AllKeys.Select(x => x.GetPart(".")).Distinct().ToArray(), @@ -359,14 +362,20 @@ await Task.WhenAll( PopulateLookupNames(viewModel), PopulateGovernors(viewModel)); - viewModel.AgeRangeToolTip = viewModel.Establishment.TypeId.OneOfThese(ET.OnlineProvider) + viewModel.AgeRangeToolTip = viewModel.Establishment.TypeId.OneOfThese(ET.OnlineProvider) ? _resourcesHelper.GetResourceStringForEstablishment("AgeRangeOnlineProvider", (eLookupEstablishmentTypeGroup?) viewModel.Establishment.EstablishmentTypeGroupId, User) : _resourcesHelper.GetResourceStringForEstablishment("AgeRange", (eLookupEstablishmentTypeGroup?) viewModel.Establishment.EstablishmentTypeGroupId, User); - viewModel.AgeRangeToolTipLink = _resourcesHelper.GetResourceStringForEstablishment("AgeRangeLink", (eLookupEstablishmentTypeGroup?) viewModel.Establishment.EstablishmentTypeGroupId, User); + viewModel.AgeRangeToolTipLink = viewModel.Establishment.TypeId.Equals((int)ET.AcademySecure16to19) + ? string.Empty + : _resourcesHelper.GetResourceStringForEstablishment("AgeRangeLink", (eLookupEstablishmentTypeGroup?) viewModel.Establishment.EstablishmentTypeGroupId, User); + viewModel.SchoolCapacityToolTip = _resourcesHelper.GetResourceStringForEstablishment("SchoolCapacity", (eLookupEstablishmentTypeGroup?) viewModel.Establishment.EstablishmentTypeGroupId, User); - viewModel.SchoolCapacityToolTipLink = _resourcesHelper.GetResourceStringForEstablishment("SchoolCapacityLink", (eLookupEstablishmentTypeGroup?) viewModel.Establishment.EstablishmentTypeGroupId, User); + viewModel.SchoolCapacityToolTipLink = viewModel.Establishment.TypeId.Equals((int)ET.AcademySecure16to19) + ? string.Empty + : _resourcesHelper.GetResourceStringForEstablishment("SchoolCapacityLink", (eLookupEstablishmentTypeGroup?) viewModel.Establishment.EstablishmentTypeGroupId, User); + return View(viewModel); } @@ -885,7 +894,7 @@ private async Task PopulateCCSelectLists(CreateChildrensCentreViewModel viewMode viewModel.GovernanceOptions = (await _cachedLookupService.CCGovernanceGetAllAsync()).ToSelectList(); viewModel.DisadvantagedAreaOptions = (await _cachedLookupService.CCDisadvantagedAreasGetAllAsync()).ToSelectList(); viewModel.DirectProvisionOfEarlyYearsOptions = (await _cachedLookupService.DirectProvisionOfEarlyYearsGetAllAsync()).ToSelectList(); - viewModel.EstablishmentStatusOptions = (await _cachedLookupService.EstablishmentStatusesGetAllAsync()).ToSelectList(); + viewModel.EstablishmentStatusOptions = (await _lookupService.EstablishmentStatusesGetAllAsync(User)).ToSelectList(); viewModel.Address.Counties = (await _cachedLookupService.CountiesGetAllAsync()).ToSelectList(); viewModel.Phases = (await _cachedLookupService.CCPhaseTypesGetAllAsync()).ToSelectList(); await PopulateSelectLists(viewModel); @@ -915,7 +924,8 @@ private async Task PopulateDisplayPolicies(EstablishmentDetailViewModel viewMode private async Task PopulateEditPermissions(EstablishmentDetailViewModel viewModel) { viewModel.UserCanEdit = await _establishmentReadService.CanEditAsync(viewModel.Establishment.Urn.Value, User); - viewModel.TabEditPolicy = new TabEditPolicy(viewModel.Establishment, viewModel.DisplayPolicy, User); + var editPolicyEnvelope = await _establishmentReadService.GetEditPolicyAsync(viewModel.Establishment, User); + viewModel.TabEditPolicy = new TabEditPolicy(viewModel.Establishment, editPolicyEnvelope.EditPolicy, User); } private async Task PopulateEstablishmentPageViewModel(IEstablishmentPageViewModel viewModel, int urn, string selectedTabName) @@ -1051,7 +1061,7 @@ private async Task PopulateSelectLists(ViewModel viewModel) viewModel.LocalAuthorities = localAuthorities.ToSelectList(viewModel.LocalAuthorityId); viewModel.EstablishmentTypes = (await _cachedLookupService.EstablishmentTypesGetAllAsync()).ToSelectList(viewModel.TypeId); viewModel.HeadTitles = (await _cachedLookupService.TitlesGetAllAsync()).ToSelectList(viewModel.HeadTitleId); - viewModel.Statuses = (await _cachedLookupService.EstablishmentStatusesGetAllAsync()).ToSelectList(viewModel.StatusId); + viewModel.Statuses = (await _lookupService.EstablishmentStatusesGetAllAsync(User)).ToSelectList(viewModel.StatusId); viewModel.AdmissionsPolicies = (await _cachedLookupService.AdmissionsPoliciesGetAllAsync()).ToSelectList(viewModel.AdmissionsPolicyId); viewModel.Inspectorates = (await _cachedLookupService.InspectoratesGetAllAsync()).ToSelectList(viewModel.InspectorateId); viewModel.IndependentSchoolTypes = (await _cachedLookupService.IndependentSchoolTypesGetAllAsync()).ToSelectList(viewModel.IndependentSchoolTypeId); diff --git a/Web/Edubase.Web.UI/Areas/Establishments/Models/TabEditPolicy.cs b/Web/Edubase.Web.UI/Areas/Establishments/Models/TabEditPolicy.cs index e9d65de43..9ea04aaa6 100644 --- a/Web/Edubase.Web.UI/Areas/Establishments/Models/TabEditPolicy.cs +++ b/Web/Edubase.Web.UI/Areas/Establishments/Models/TabEditPolicy.cs @@ -1,3 +1,4 @@ +using System.Linq; using System.Security.Principal; using Edubase.Common; using Edubase.Services.Enums; @@ -22,6 +23,12 @@ public class TabEditPolicy public TabEditPolicy(EstablishmentModel model, EstablishmentDisplayEditPolicy policy, IPrincipal principal) { Governance = !(principal.IsInRole(EdubaseRoles.ESTABLISHMENT) && model.StatusId.OneOfThese(ES.Closed)); + Location = new[] + { + // these fields appear on the Locations tab + policy.RSCRegionId, policy.GovernmentOfficeRegionId, policy.AdministrativeDistrictId, policy.AdministrativeWardId, policy.ParliamentaryConstituencyId, + policy.UrbanRuralId, policy.GSSLAId, policy.Easting, policy.Northing, policy.MSOAId, policy.LSOAId + }.Any(x => x == true); } public TabEditPolicy() diff --git a/Web/Edubase.Web.UI/Areas/Establishments/Views/Establishment/Details.cshtml b/Web/Edubase.Web.UI/Areas/Establishments/Views/Establishment/Details.cshtml index 8fd1ab96d..6ba29c865 100644 --- a/Web/Edubase.Web.UI/Areas/Establishments/Views/Establishment/Details.cshtml +++ b/Web/Edubase.Web.UI/Areas/Establishments/Views/Establishment/Details.cshtml @@ -323,7 +323,7 @@

Middle super output area (MSOA)

- The data presented for the middle super output area (MSOA) is representative of the 2011 census. + The data presented for the middle super output area (MSOA) is representative of the 2021 census.

@@ -332,7 +332,7 @@

Lower super output area (LSOA)

- The data presented for the lower super output area (LSOA) is representative of the 2011 census. + The data presented for the lower super output area (LSOA) is representative of the 2021 census.

diff --git a/Web/Edubase.Web.UI/Areas/Establishments/Views/Establishment/Partials/TabLocation.cshtml b/Web/Edubase.Web.UI/Areas/Establishments/Views/Establishment/Partials/TabLocation.cshtml index 0c2762738..2b8e2cdeb 100644 --- a/Web/Edubase.Web.UI/Areas/Establishments/Views/Establishment/Partials/TabLocation.cshtml +++ b/Web/Edubase.Web.UI/Areas/Establishments/Views/Establishment/Partials/TabLocation.cshtml @@ -19,14 +19,14 @@ }
-
-
Regional schools commissioner (RSC) region
-
@Model.RSCRegionName
-
Government office region (GOR)
@Model.GovernmentOfficeRegionName
+
+
Regional schools commissioner (RSC) region
+
@Model.RSCRegionName
+
District
@Model.AdministrativeDistrictName
diff --git a/Web/Edubase.Web.UI/Areas/Establishments/Views/EstablishmentsSearch/Partials/_EstablishmentSearchResults.cshtml b/Web/Edubase.Web.UI/Areas/Establishments/Views/EstablishmentsSearch/Partials/_EstablishmentSearchResults.cshtml index c16586430..9d68cf7f1 100644 --- a/Web/Edubase.Web.UI/Areas/Establishments/Views/EstablishmentsSearch/Partials/_EstablishmentSearchResults.cshtml +++ b/Web/Edubase.Web.UI/Areas/Establishments/Views/EstablishmentsSearch/Partials/_EstablishmentSearchResults.cshtml @@ -39,7 +39,7 @@ else if (Model.Results.Count > 0) @foreach (var result in Model.Results) {
  • -

    +

    @Html.ActionLink(result.Name.Clean() ?? "(name not recorded)", "Details", "Establishment", @@ -60,16 +60,16 @@ else if (Model.Results.Count > 0) @((result.TypeId != null && Model.EstablishmentTypeLookup.ContainsKey(result.TypeId.Value)) ? Model.EstablishmentTypeLookup[result.TypeId.Value] : "Not recorded") @*@(Model.EstablishmentTypes.FirstOrDefault(x => x.Id == result.TypeId)?.Name ?? "Not recorded")*@ -
    URN:
    -
    @result.Urn
    -
    +
    URN:
    +
    @result.Urn
    +
    LAESTAB:
    -
    @Model.LAESTABs[result]
    -
    Status:
    -
    @(Model.EstablishmentStatuses.FirstOrDefault(x => x.Id == result.StatusId)?.Name ?? "Not recorded")
    -
    Local authority name:
    -
    @(Model.LocalAuthorities.FirstOrDefault(x => x.Id == result.LocalAuthorityId)?.Name ?? "Not recorded")
    +
    @Model.LAESTABs[result]
    +
    Status:
    +
    @(Model.EstablishmentStatuses.FirstOrDefault(x => x.Id == result.StatusId)?.Name ?? "Not recorded")
    +
    Local authority name:
    +
    @(Model.LocalAuthorities.FirstOrDefault(x => x.Id == result.LocalAuthorityId)?.Name ?? "Not recorded")
    @if (Model.SearchType == eSearchType.Location) { var distanceInMiles = Math.Round(Edubase.Common.Spatial.DistanceCalculator.Calculate(Model.LocationSearchCoordinate, result.Location).Miles, 2); diff --git a/Web/Edubase.Web.UI/Areas/Governors/Controllers/GovernorController.cs b/Web/Edubase.Web.UI/Areas/Governors/Controllers/GovernorController.cs index 13b37d4ba..7889c0d70 100644 --- a/Web/Edubase.Web.UI/Areas/Governors/Controllers/GovernorController.cs +++ b/Web/Edubase.Web.UI/Areas/Governors/Controllers/GovernorController.cs @@ -452,10 +452,9 @@ private void PrepopulateFields(GovernorModel model, ReplaceChairViewModel viewMo private async Task RoleAllowed(eLookupGovernorRole roleId, int? groupUId, int? establishmentUrn, IPrincipal user) { - var existingGovernors = await _governorsReadService.GetGovernorListAsync(establishmentUrn, groupUId, user); - if (EnumSets.eSingularGovernorRoles.Contains(roleId)) { + var existingGovernors = await _governorsReadService.GetGovernorListAsync(establishmentUrn, groupUId, user); if (roleId == eLookupGovernorRole.Establishment_SharedChairOfLocalGoverningBody || roleId == eLookupGovernorRole.ChairOfLocalGoverningBody) { diff --git a/Web/Edubase.Web.UI/Areas/Governors/Views/GovernorSearch/Partials/_GovernorSearchResults.cshtml b/Web/Edubase.Web.UI/Areas/Governors/Views/GovernorSearch/Partials/_GovernorSearchResults.cshtml index 869df5a14..635088a41 100644 --- a/Web/Edubase.Web.UI/Areas/Governors/Views/GovernorSearch/Partials/_GovernorSearchResults.cshtml +++ b/Web/Edubase.Web.UI/Areas/Governors/Views/GovernorSearch/Partials/_GovernorSearchResults.cshtml @@ -37,17 +37,17 @@ else if (Model.Count > 0)
    @if (result.EstablishmentUrn.HasValue) { -
    URN:
    -
    @Html.ActionLink(result.EstablishmentUrn.ToString(), "Details", "Establishment", new {id = result.EstablishmentUrn, area = "Establishments", searchQueryString = Model.SearchQueryString, searchSource = eLookupSearchSource.Governors}, null)
    -
    Establishment:
    -
    @Html.ActionLink(result.EstablishmentName ?? "--", "Details", "Establishment", new {id = result.EstablishmentUrn, area = "Establishments", searchQueryString = Model.SearchQueryString, searchSource = eLookupSearchSource.Governors}, null)
    +
    URN:
    +
    @Html.ActionLink(result.EstablishmentUrn.ToString(), "Details", "Establishment", new { id = result.EstablishmentUrn, area = "Establishments", searchQueryString = Model.SearchQueryString, searchSource = eLookupSearchSource.Governors }, null)
    +
    Establishment:
    +
    @Html.ActionLink(result.EstablishmentName ?? "--", "Details", "Establishment", new {id = result.EstablishmentUrn, area = "Establishments", searchQueryString = Model.SearchQueryString, searchSource = eLookupSearchSource.Governors}, null)
    } else { -
    UID:
    -
    @Html.ActionLink(result.GroupUId.ToString(), "Details", "Group", new {id = result.GroupUId, area = "groups", searchQueryString = Model.SearchQueryString, searchSource = eLookupSearchSource.Governors}, null)
    -
    Group:
    -
    @Html.ActionLink(result.GroupName ?? "--", "Details", "Group", new {id = result.GroupUId, area = "groups", searchQueryString = Model.SearchQueryString, searchSource = eLookupSearchSource.Governors}, null)
    +
    UID:
    +
    @Html.ActionLink(result.GroupUId.ToString(), "Details", "Group", new {id = result.GroupUId, area = "groups", searchQueryString = Model.SearchQueryString, searchSource = eLookupSearchSource.Governors}, null)
    +
    Group:
    +
    @Html.ActionLink(result.GroupName ?? "--", "Details", "Group", new {id = result.GroupUId, area = "groups", searchQueryString = Model.SearchQueryString, searchSource = eLookupSearchSource.Governors}, null)
    }
    diff --git a/Web/Edubase.Web.UI/Areas/Groups/Views/Group/Create.cshtml b/Web/Edubase.Web.UI/Areas/Groups/Views/Group/Create.cshtml index fe729ef76..1b379a9e9 100644 --- a/Web/Edubase.Web.UI/Areas/Groups/Views/Group/Create.cshtml +++ b/Web/Edubase.Web.UI/Areas/Groups/Views/Group/Create.cshtml @@ -146,7 +146,7 @@

    @* The same 'value' i.e. @VM.ActionSave is used in the continue button as in the save button, So, the backend code behaves in the same way as in the save button when the continue button is clicked *@ -

  • diff --git a/Web/Edubase.Web.UI/Controllers/DownloadsController.cs b/Web/Edubase.Web.UI/Controllers/DownloadsController.cs index 5d72d9de2..8e776d6c1 100644 --- a/Web/Edubase.Web.UI/Controllers/DownloadsController.cs +++ b/Web/Edubase.Web.UI/Controllers/DownloadsController.cs @@ -279,12 +279,12 @@ public async Task DownloadExtractAsync(string path, string id, str [HttpGet, EdubaseAuthorize, MvcAuthorizeRoles(AuthorizedRoles.CanManageAcademyTrusts)] [Route("Download/MATClosureReport", Name = "DownloadMATClosureReport")] - public async Task DownloadMATClosureReportAsync() + public async Task DownloadMATClosureReportAsync(string filename) { using (var c = IocConfig.CreateHttpClient()) { var requestMessage = await _httpClientHelper.CreateHttpRequestMessageAsync(HttpMethod.Get, "downloads/matclosurereport.csv", User); - var response = (await c.SendAsync(requestMessage)); + var response = await c.SendAsync(requestMessage); if(response.StatusCode == System.Net.HttpStatusCode.NotFound) { @@ -293,7 +293,7 @@ public async Task DownloadMATClosureReportAsync() else { response.EnsureSuccessStatusCode(); - return new FileStreamResult(await response.Content.ReadAsStreamAsync(), response.Content.Headers.ContentType.MediaType) { FileDownloadName = $"SatAndMatClosureReport_{DateTime.Now.Date.ToString("dd-MM-yyyy")}.csv" }; + return new FileStreamResult(await response.Content.ReadAsStreamAsync(), response.Content.Headers.ContentType.MediaType) { FileDownloadName = filename }; } } } diff --git a/Web/Edubase.Web.UI/Models/ToolsViewModel.cs b/Web/Edubase.Web.UI/Models/ToolsViewModel.cs index b39222784..4a8543dbc 100644 --- a/Web/Edubase.Web.UI/Models/ToolsViewModel.cs +++ b/Web/Edubase.Web.UI/Models/ToolsViewModel.cs @@ -237,10 +237,10 @@ public List GetAdminActions(HtmlHelper htmlHelper) retVal.Add(new LinkAction { Link = htmlHelper.RouteLink( - "View closed Companies House single-academy trusts (SATs) and multi-academy trusts (MATs)", + "View closed Companies House single-academy trusts (SATs), secure single-academy trusts (SSATs) and multi-academy trusts (MATs)", "DownloadClosedTrustsInformation"), Description = - "View a list of closed single-academy trusts (SATs) and multi-academy trusts (MATs) currently open on GIAS but reported closed by Companies House." + "View a list of closed single-academy trusts (SATs), secure single-academy trusts (SSATs) and multi-academy trusts (MATs) currently open on GIAS but reported closed by Companies House." }); } diff --git a/Web/Edubase.Web.UI/Views/ChangeHistory/Index.cshtml b/Web/Edubase.Web.UI/Views/ChangeHistory/Index.cshtml index b980f4820..24243520a 100644 --- a/Web/Edubase.Web.UI/Views/ChangeHistory/Index.cshtml +++ b/Web/Edubase.Web.UI/Views/ChangeHistory/Index.cshtml @@ -36,10 +36,10 @@
      -
    • +
    • @Html.RouteLink("Establishment change history", "ChangeHistoryCriteria", new {SelectedTab = SearchViewModel.Tab.Establishments}, new {@class = $"gias-tabs__tab estab"})
    • -
    • +
    • @Html.RouteLink("Group change history", "ChangeHistoryCriteria", new {SelectedTab = SearchViewModel.Tab.Groups}, new {@class = $"gias-tabs__tab group"})
    diff --git a/Web/Edubase.Web.UI/Views/ChangeHistory/Partials/_EstablishmentResults.cshtml b/Web/Edubase.Web.UI/Views/ChangeHistory/Partials/_EstablishmentResults.cshtml index f296d2d8c..85080d4ee 100644 --- a/Web/Edubase.Web.UI/Views/ChangeHistory/Partials/_EstablishmentResults.cshtml +++ b/Web/Edubase.Web.UI/Views/ChangeHistory/Partials/_EstablishmentResults.cshtml @@ -60,7 +60,7 @@ @foreach (var item in Model.Items) { - + @(item.DateChanged?.ToString("d MMMM yyyy")) @(item.EffectiveDate?.ToString("d MMMM yyyy")) @if (!Model.SingleEstablishment) @@ -82,7 +82,7 @@ @item.OldValue } - + @if (item.NewValue != null && RE.IsMatch(item.NewValue)) { var parts = item.NewValue.Split('/').Select(Int32.Parse).ToList(); diff --git a/Web/Edubase.Web.UI/Views/ChangeHistory/Partials/_GroupResults.cshtml b/Web/Edubase.Web.UI/Views/ChangeHistory/Partials/_GroupResults.cshtml index ac6eb6a71..9b9a641f6 100644 --- a/Web/Edubase.Web.UI/Views/ChangeHistory/Partials/_GroupResults.cshtml +++ b/Web/Edubase.Web.UI/Views/ChangeHistory/Partials/_GroupResults.cshtml @@ -58,7 +58,7 @@ @foreach (var item in Model.Items) { - + @(item.RequestedDate?.ToString("d MMMM yyyy")) @if (!Model.SingleGroup) { diff --git a/Web/Edubase.Web.UI/Views/Tools/DownloadClosedTrustsInformation.cshtml b/Web/Edubase.Web.UI/Views/Tools/DownloadClosedTrustsInformation.cshtml index bdade9713..c86610c1a 100644 --- a/Web/Edubase.Web.UI/Views/Tools/DownloadClosedTrustsInformation.cshtml +++ b/Web/Edubase.Web.UI/Views/Tools/DownloadClosedTrustsInformation.cshtml @@ -1,6 +1,6 @@ @{ ViewBag.SiteSection = "tools"; - var fileName = $"SatAndMatClosureReport_{DateTime.Now.Date.ToString("dd-MM-yyyy")}.csv"; + var fileName = $"SsatSatAndMatClosureReport_{DateTime.Now.Date.ToString("dd-MM-yyyy")}.csv"; } @section BreadCrumbs {
    @@ -20,18 +20,18 @@

    Closed single-academy trusts - (SATs) and multi-academy trusts (MATs)

    + (SATs), secure single-academy trusts (SSATs) and multi-academy trusts (MATs)

    - Download the following file to view a list of closed single-academy trusts and multi-academy trusts. + Download the following file to view a list of closed single-academy trusts, secure single-academy trusts and multi-academy trusts. These are currently open on GIAS but reported closed by Companies House.

    - @Html.RouteLink(fileName, "DownloadMatClosureReport") + @Html.RouteLink(fileName, "DownloadMatClosureReport", new { filename = fileName })

    diff --git a/Web/Edubase.Web.UI/Web.config b/Web/Edubase.Web.UI/Web.config index 468c7dad7..bef304900 100644 --- a/Web/Edubase.Web.UI/Web.config +++ b/Web/Edubase.Web.UI/Web.config @@ -268,11 +268,16 @@ - `SessionExpireTimeSpan` The duration (hh:MM:ss) for which the session cookie remains valid, - specifically the `Expires/Max-Age` field on the cookie. - See also: Edubase.Web.UI.StartupSecureAccess.ConfigureAuth + - `PublicOrigin` The URL of the GIAS website, as seen by the Identity Provider (IDP). + This may be required if the GIAS website is hosted behind a proxy/WAF. + Omitting this setting will default to using the value provided by `request.ApplicationUrl`. + See also #157607 and #171878. --> +