Skip to content

Commit

Permalink
Merge pull request #665 from DFE-Digital/ofsted-download
Browse files Browse the repository at this point in the history
Ofsted download
  • Loading branch information
dneed-nimble authored Dec 17, 2024
2 parents c340e51 + 3c54d97 commit 5a30c6e
Show file tree
Hide file tree
Showing 20 changed files with 484 additions and 179 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased][unreleased]

### Added

- Added download for Ofsted specific data to Ofsted pages

## [Release-16][release-16] (production-2024-12-13.4477)

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static string ShowDateStringOrReplaceWithText(this DateTime? date)
{
if (date.HasValue)
{
return date.Value.ToString(StringFormatConstants.ViewDate);
return date.Value.ToString(StringFormatConstants.DisplayDateFormat);
}

return ViewConstants.NoDataText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ namespace DfE.FindInformationAcademiesTrusts.Pages;

public static class StringFormatConstants
{
public const string ViewDate = "d MMM yyyy";
public const string SortDate = "yyyyMMdd";
public const string DisplayDateFormat = "dd MMM yyyy";
public const string SortableDateFormat = "yyyyMMdd";
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.AppointingBody" data-testid="historic-members-appointed">
@governor.AppointingBody
</td>
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfAppointment?.ToString(StringFormatConstants.SortDate)" data-testid="historic-members-from">
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfAppointment?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="historic-members-from">
@governor.DateOfAppointment.ShowDateStringOrReplaceWithText()
</td>
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfTermEnd?.ToString(StringFormatConstants.SortDate)" data-testid="historic-members-to">
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfTermEnd?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="historic-members-to">
@governor.DateOfTermEnd.ShowDateStringOrReplaceWithText()
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.AppointingBody" data-testid="members-appointed">
@governor.AppointingBody
</td>
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfAppointment?.ToString(StringFormatConstants.SortDate)" data-testid="members-from">
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfAppointment?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="members-from">
@governor.DateOfAppointment.ShowDateStringOrReplaceWithText()
</td>
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfTermEnd?.ToString(StringFormatConstants.SortDate)" data-testid="members-to">
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfTermEnd?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="members-to">
@governor.DateOfTermEnd.ShowDateStringOrReplaceWithText()
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.Role" data-testid="trust-leadership-role">
@governor.Role
</td>
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfAppointment?.ToString(StringFormatConstants.SortDate)" data-testid="trust-leadership-from">
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfAppointment?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="trust-leadership-from">
@governor.DateOfAppointment.ShowDateStringOrReplaceWithText()
</td>
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfTermEnd?.ToString(StringFormatConstants.SortDate)" data-testid="trust-leadership-to">
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfTermEnd?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="trust-leadership-to">
@governor.DateOfTermEnd.ShowDateStringOrReplaceWithText()
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.AppointingBody" data-testid="trustees-appointed">
@governor.AppointingBody
</td>
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfAppointment?.ToString(StringFormatConstants.SortDate)" data-testid="trustees-from">
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfAppointment?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="trustees-from">
@governor.DateOfAppointment.ShowDateStringOrReplaceWithText()
</td>
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfTermEnd?.ToString(StringFormatConstants.SortDate)" data-testid="trustees-to">
<td class="govuk-body govuk-table__cell" data-sort-value="@governor.DateOfTermEnd?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="trustees-to">
@governor.DateOfTermEnd.ShowDateStringOrReplaceWithText()
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
<td class="govuk-table__cell govuk-body" data-sort-value="@academy.EstablishmentName" data-testid="ofsted-important-dates-school-name">
@academy.EstablishmentName<br/>
</td>
<td class="govuk-table__cell govuk-body" data-sort-value="@academy.DateAcademyJoinedTrust.ToString(StringFormatConstants.SortDate)" data-testid="ofsted-important-dates-date-joined">
@academy.DateAcademyJoinedTrust.ToString(StringFormatConstants.ViewDate)
<td class="govuk-table__cell govuk-body" data-sort-value="@academy.DateAcademyJoinedTrust.ToString(StringFormatConstants.SortableDateFormat)" data-testid="ofsted-important-dates-date-joined">
@academy.DateAcademyJoinedTrust.ToString(StringFormatConstants.DisplayDateFormat)
</td>
<td class="govuk-table__cell govuk-body" data-sort-value="@academy.CurrentOfstedRating.InspectionDate?.ToString(StringFormatConstants.SortDate)" data-testid="ofsted-important-dates-date-of-current-inspection">
<td class="govuk-table__cell govuk-body" data-sort-value="@academy.CurrentOfstedRating.InspectionDate?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="ofsted-important-dates-date-of-current-inspection">
@academy.CurrentOfstedRating.InspectionDate.ShowDateStringOrReplaceWithText()
</td>
<td class="govuk-table__cell govuk-body" data-sort-value="@academy.PreviousOfstedRating.InspectionDate?.ToString(StringFormatConstants.SortDate)" data-testid="ofsted-important-dates-date-of-previous-inspection">
<td class="govuk-table__cell govuk-body" data-sort-value="@academy.PreviousOfstedRating.InspectionDate?.ToString(StringFormatConstants.SortableDateFormat)" data-testid="ofsted-important-dates-date-of-previous-inspection">
@academy.PreviousOfstedRating.InspectionDate.ShowDateStringOrReplaceWithText()
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public virtual async Task<IActionResult> OnGetExportAsync(string uid)
var sanitizedTrustName =
string.Concat(trustSummary.Name.Where(c => !Path.GetInvalidFileNameChars().Contains(c)));

var fileContents = await ExportService.ExportAcademiesToSpreadsheetAsync(uid);
var fileName = $"{sanitizedTrustName}-{DateTimeProvider.Now:yyyy-MM-dd}.xlsx";
var fileContents = await ExportService.ExportOfstedDataToSpreadsheetAsync(uid);
var fileName = $"Ofsted-{sanitizedTrustName}-{DateTimeProvider.Now:yyyy-MM-dd}.xlsx";
var contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";

return File(fileContents, contentType, fileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<svg class="export-button__icon" width="20" height="20" viewBox="0 0 29 28" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
<path d="M24.968 17.5V22.1667C24.968 22.7855 24.7222 23.379 24.2846 23.8166C23.847 24.2542 23.2535 24.5 22.6347 24.5H6.30135C5.68251 24.5 5.08902 24.2542 4.65143 23.8166C4.21385 23.379 3.96802 22.7855 3.96802 22.1667V17.5M8.63468 11.6667L14.468 17.5M14.468 17.5L20.3014 11.6667M14.468 17.5V3.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
Download all academy data
Download all Ofsted data
</a>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<dd class="govuk-summary-list__value" data-testid="opened-on">
@if (Model.TrustOverview.OpenedDate is not null)
{
@Model.TrustOverview.OpenedDate.Value.ToString(StringFormatConstants.ViewDate)
@Model.TrustOverview.OpenedDate.Value.ToString(StringFormatConstants.DisplayDateFormat)
}
</dd>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public record DataSourceListEntry(DataSourceServiceModel DataSource, IEnumerable
{
public string LastUpdatedText => DataSource.LastUpdated is null
? "Unknown"
: DataSource.LastUpdated.Value.ToString(StringFormatConstants.ViewDate);
: DataSource.LastUpdated.Value.ToString(StringFormatConstants.DisplayDateFormat);

public string? UpdatedByText => DataSource.UpdatedBy == "TRAMs Migration"
? "TRAMS Migration"
Expand Down
Loading

0 comments on commit 5a30c6e

Please sign in to comment.