Skip to content

Commit

Permalink
Merge pull request #984 from SkillsFundingAgency/CON-3587-Make-submis…
Browse files Browse the repository at this point in the history
…sion-pages-consistent

CON-3587 Make submission pages consistent
  • Loading branch information
Paul Howes authored Sep 2, 2021
2 parents 8df624b + ce92b61 commit 2aadc90
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public async Task<VacancyReviewedConfirmationViewModel> GetVacancyReviewedOrches
{
var vacancy = await Utility.GetAuthorisedVacancyAsync(_client, _vacancyClient, vrm, RouteNames.Reviewed_Index_Get);
var employer = await _client.GetProviderEmployerVacancyDataAsync(vrm.Ukprn, vacancy.EmployerAccountId);
var preferences = await _vacancyClient.GetUserNotificationPreferencesAsync(vacancyUser.UserId);

if (vacancy.Status != VacancyStatus.Review)
throw new InvalidStateException(string.Format(ErrorMessages.VacancyNotReviewedSuccessfully, vacancy.Title));
Expand All @@ -34,7 +35,8 @@ public async Task<VacancyReviewedConfirmationViewModel> GetVacancyReviewedOrches
Title = vacancy.Title,
VacancyReference = vacancy.VacancyReference?.ToString(),
EmployerName = employer.Name,
IsResubmit = vacancy.ReviewDate.HasValue
IsResubmit = vacancy.ReviewCount > 1,
IsVacancyRejectedByEmployerNotificationSelected = preferences.NotificationTypes.HasFlag(NotificationTypes.VacancyRejectedByEmployer)
};

return vm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public async Task<VacancySubmittedConfirmationViewModel> GetVacancySubmittedConf
Title = vacancy.Title,
VacancyReference = vacancy.VacancyReference?.ToString(),
IsResubmit = isResubmit,
HasNotificationsSet = preferences != null && preferences.NotificationTypes > NotificationTypes.None
HasNotificationsSet = preferences != null && preferences.NotificationTypes > NotificationTypes.None,
IsVacancyRejectedByESFANotificationSelected = preferences.NotificationTypes.HasFlag(NotificationTypes.VacancyRejected)
};

return vm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public class VacancyReviewedConfirmationViewModel
public bool HasVacancyReference => !string.IsNullOrEmpty(VacancyReference);
public string EmployerName { get; set; }
public bool IsResubmit { get; set; }
public bool IsVacancyRejectedByEmployerNotificationSelected { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public class VacancySubmittedConfirmationViewModel

public bool HasVacancyReference => !string.IsNullOrEmpty(VacancyReference);
public bool HasNotificationsSet { get; set; }
public bool IsVacancyRejectedByESFANotificationSelected { get; set; }
}
}
29 changes: 21 additions & 8 deletions src/Provider/Provider.Web/Views/Reviewed/Confirmation.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,38 @@
</p>
</div>
</div>

<h2 class="govuk-heading-m">What happens next</h2>

<p class="govuk-body">
@Model.EmployerName needs to approve the vacancy.
</p>

<p class="govuk-body">
If they approve the vacancy, we’ll do a final review and then post it on Find an apprenticeship.
If @Model.EmployerName approves the vacancy, the <abbr>ESFA</abbr> will do a final review and then post it on 'Find an apprenticeship'.
</p>


@if (Model.IsVacancyRejectedByEmployerNotificationSelected)
{
<p class="govuk-body">
If @Model.EmployerName reject the vacancy, it will come back to you to edit and resubmit. We will let you know by email if you need to make any edits.
</p>
}
else
{
<p class="govuk-body">
If the vacancy is rejected by either @Model.EmployerName or the <abbr>ESFA</abbr> and you need to make edits, they will tell you in the rejected vacancies of your Recruitment dashboard.
</p>
}

<p class="govuk-body">
If they reject the vacancy, it will come back to you to edit and resubmit.
<a class="govuk-link" asp-route="@RouteNames.ManageNotifications_Get">Manage the frequency of your recruitment emails</a>
</p>

<p class="govuk-body">
<a class="govuk-link" asp-route="@RouteNames.Vacancies_Get">Return to recruitment dashboard</a>
<a class="govuk-link" asp-route="@RouteNames.Dashboard_Get">Return to recruitment</a>
</p>

<p class="govuk-body">
<a class="govuk-link" asp-route="@RouteNames.Employer_Get">Create another vacancy</a>
</p>
Expand Down
62 changes: 36 additions & 26 deletions src/Provider/Provider.Web/Views/Submitted/Confirmation.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,52 @@
ViewBag.GaData.Vpv = "/recruitment/provider/page-vacancy-submitted-for-approval";
}

<h1 class="govuk-heading-l">@Model.Title</h1>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div asp-hide="@Model.IsResubmit" class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">
Vacancy submitted for approval
<div class="govuk-panel govuk-panel--confirmation">
<h1 asp-hide="@Model.IsResubmit" class="govuk-panel__title">
Vacancy submitted to ESFA
</h1>
<h1 asp-show="@Model.IsResubmit" class="govuk-panel__title">
Vacancy resubmitted to ESFA
</h1>
<div class="govuk-panel__body">
<p asp-show="@Model.HasVacancyReference">
The vacancy reference number is <br>
Your reference number <br>
<strong class="govuk-!-font-weight-bold">VAC@(Model.VacancyReference)</strong>
</p>
</div>
</div>
<div asp-show="@Model.IsResubmit" class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">
Vacancy resubmitted for approval
</h1>
</div>
<h2 class="govuk-heading-m">Next steps</h2>

<div asp-show="@Model.HasNotificationsSet">
<p class="govuk-body">We’ll check the vacancy and let you know by email within one working day if you need to make any edits. <esfaFeatureEnabled name="@FeatureNames.SetNotificationPreferences"><a asp-route="@RouteNames.ManageNotifications_Get">Manage your recruitment emails</a>.</esfaFeatureEnabled></p>
<p class="govuk-body">When the vacancy is approved, it will appear on the Find an apprenticeship service.</p>
</div>
<div asp-hide="@Model.HasNotificationsSet">
<p class="govuk-body">We’ll check the vacancy and tell you within one working day on the dashboard if you need to make any edits. <esfaFeatureEnabled name="@FeatureNames.SetNotificationPreferences">Visit <a asp-route="@RouteNames.ManageNotifications_Get">Manage your recruitment emails</a> if you’d also like to get an email.</esfaFeatureEnabled></p>
<p class="govuk-body">When the vacancy is approved, it will appear on the Find an apprenticeship service.</p>
</div>
<h2 class="govuk-heading-m">What happens next</h2>

<div class="govuk-form-group inline">
<div class="govuk-form-group">
<a asp-route="@RouteNames.Vacancies_Get" class="govuk-button">Return to dashboard</a>
<a asp-route="@RouteNames.Employer_Get" class="govuk-link das-button-link">Create another vacancy</a>
</div>
</div>
@if (Model.IsVacancyRejectedByESFANotificationSelected)
{
<p class="govuk-body">
The <abbr>ESFA</abbr> will check the vacancy and let you know by email, within one working day, if you need to make any edits.
</p>
}
else
{
<p class="govuk-body">
The <abbr>ESFA</abbr> will check the vacancy and will tell you within one working day, on the Recruitment dashboard within rejected vacancies, if you need to make any edits.
</p>
}

<p class="govuk-body">
<a class="govuk-link" asp-route="@RouteNames.ManageNotifications_Get">Manage the frequency of your recruitment emails</a>
</p>

<p class="govuk-body">
When the vacancy is approved, it will appear on Find an apprenticeship.
</p>

<p class="govuk-body">
<a class="govuk-link" asp-route="@RouteNames.Dashboard_Get">Return to recruitment</a>
</p>

<p class="govuk-body">
<a class="govuk-link" asp-route="@RouteNames.Employer_Get">Create another vacancy</a>
</p>
</div>
</div>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private Vacancy CreateClone(CloneVacancyCommand message, Vacancy vacancy)
clone.TransferInfo = null;
clone.ReviewByUser = null;
clone.ReviewDate = null;
clone.ReviewCount = 0;
clone.EmployerReviewFieldIndicators = null;
clone.EmployerRejectedReason = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public async Task Handle(ReviewVacancyCommand message, CancellationToken cancell

vacancy.Status = VacancyStatus.Review;
vacancy.ReviewDate = now;
vacancy.ReviewCount += 1;
vacancy.ReviewByUser = message.User;
vacancy.LastUpdatedDate = now;
vacancy.LastUpdatedByUser = message.User;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class Vacancy
public VacancyUser SubmittedByUser { get; set; }
public DateTime? ReviewDate { get; set; }
public VacancyUser ReviewByUser { get; set; }
public int ReviewCount { get; set; }
public DateTime? ApprovedDate { get; set; }
public DateTime? LiveDate { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ private static void AssertKnownProperties(Vacancy original, Vacancy clone)
{nameof(Vacancy.SubmittedDate), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.SubmittedByUser), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.ReviewDate), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.ReviewCount), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.Ignore)},
{nameof(Vacancy.ReviewByUser), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.ApprovedDate), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.LiveDate), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public async Task GivenEmployerDescription_ThenShouldUpdateVacancyWithThatDescri
vacancy.Status.Should().Be(VacancyStatus.Review);
vacancy.ReviewDate.Should().Be(now);
vacancy.ReviewByUser.Should().Be(user);
vacancy.ReviewCount.Should().Be(1);
vacancy.LastUpdatedDate.Should().Be(now);
vacancy.LastUpdatedByUser.Should().Be(user);
vacancy.EmployerDescription.Should().Be(expectedDescription);
Expand Down Expand Up @@ -77,6 +78,7 @@ public async Task ShouldNotChangeEmployerDescriptionIfNotSpecifiedInCommand()
vacancy.Status.Should().Be(VacancyStatus.Review);
vacancy.ReviewDate.Should().Be(now);
vacancy.ReviewByUser.Should().Be(user);
vacancy.ReviewCount.Should().Be(1);
vacancy.LastUpdatedDate.Should().Be(now);
vacancy.LastUpdatedByUser.Should().Be(user);
vacancy.EmployerDescription.Should().Be(expectedDescription);
Expand Down

0 comments on commit 2aadc90

Please sign in to comment.