-
-
-
-
-
Resource Version ID: @Model.ResourceVersionId
-
- @if (Model.Providers != null && Model.Providers.Count > 0)
- {
- - Developed with
- @foreach (var provider in Model.Providers)
- {
- -
- @Html.DisplayFor(model =>provider.Name)
-
- }
- }
- @if (Model.VersionStatusEnum == VersionStatusEnum.Published)
- {
- - URL
- -
-
- @String.Format("{0}Resource/{1}", webSettings.Value.LearningHubUrl, Model.DefaultResourceReferenceId)
-
-
- }
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- - Audience Access Level
- -
- @ResourceAccessiblityHelper.GetResourceAccessibilityLevelText(Model.ResourceAccessibilityEnum)
-
- - Title
- -
- @Html.DisplayFor(model => model.Title)
-
- - Description
- -
- @Html.Raw(Model.Description)
-
- - Additional Information
- -
- @Html.Raw(Model.AdditionalInformation)
-
- - Authors
- -
- @Html.Raw(Model.Authors.Any() ? string.Join(",", Model.Authors) : "None specified")
-
- - Keywords
- -
- @Html.Raw(Model.Keywords.Any() ? string.Join(",", Model.Keywords) : "None specified")
-
- @if (Model.VersionStatusEnum == VersionStatusEnum.Published
- || Model.VersionStatusEnum == VersionStatusEnum.Unpublished)
- {
- - Version
- -
- @Html.DisplayFor(model => model.VersionDescription)
-
- }
- - Version Status
- -
- @Html.DisplayFor(model => model.VersionStatusDescription)
-
- - Create User
- -
- @Html.DisplayFor(model => model.CreateUser)
-
- - Create Date
- -
- @Model.CreateDate.DateTime
-
-
-
-
-
+
-
-
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.Article)
- {
-
-
Resource Version ID: @Model.ResourceVersionId
-
- - Resource Version Id
- -
- @Html.DisplayFor(model => model.ResourceVersionId)
-
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- - Content
- -
- @Html.Raw(Model.ArticleDetails.Content)
-
- - Attachments
- -
- @if (Model.ArticleDetails.Files.Any())
- {
- @(await Html.PartialAsync("_Files", Model.ArticleDetails.Files))
- }
- else
- {
- @Html.Raw("None")
- }
-
-
-
- }
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.Audio)
- {
-
- @if (Model.AudioDetails.File == null || Model.AudioDetails.TranscriptFile == null)
- {
-
- @if (Model.AudioDetails.File == null)
- {
- @Html.Raw("No Audio File is associated with this Resource Version")
- }
- @if (Model.AudioDetails.TranscriptFile == null)
- {
- @Html.Raw("No Transcript File is associated with this Resource Version")
- }
-
- }
-
Resource Reference ID: @Model.DefaultResourceReferenceId
-
- - Resource Version Id
- -
- @Html.DisplayFor(model => model.ResourceVersionId)
-
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- @if (@Model.AudioDetails.File != null)
- {
- - Audio File
- -
- @Model.AudioDetails.File.FileName
-
- - Audio File Path
- -
- @Model.AudioDetails.File.FilePath
-
- }
- @if (@Model.AudioDetails.TranscriptFile != null)
- {
- - Transcript File
- -
- @Model.AudioDetails.TranscriptFile.FileName
-
- - Transcript File Path
- -
- @Model.AudioDetails.TranscriptFile.FilePath
-
- }
-
-
- }
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.Case)
- {
-
-
Resource Version ID: @Model.ResourceVersionId
-
- - Resource Version Id
- -
- @Html.DisplayFor(model => model.ResourceVersionId)
-
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- @if (Model.CaseDetails is { BlockCollection: { } })
- {
- if (Model.CaseDetails.BlockCollection.Blocks != null)
- {
- - Number of Blocks
- -
- @Html.DisplayFor(model => model.CaseDetails.BlockCollection.Blocks.Count)
-
- }
- }
-
-
- @if (Model.CaseDetails is { BlockCollection: { } })
- {
-
- }
-
- }
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.Embedded)
- {
-
-
Resource Reference ID: @Model.DefaultResourceReferenceId
-
- - Resource Version Id
- -
- @Html.DisplayFor(model => model.ResourceVersionId)
-
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- - Embed Code
- -
- @Html.DisplayFor(model => model.EmbedCodeDetails.EmbedCode)
-
-
-
- }
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.GenericFile)
- {
-
- @if (Model.GenericFileDetails == null || Model.GenericFileDetails.File == null)
- {
-
- @Html.Raw("No File is associated with this Resource Version")
-
- }
-
Resource Reference ID: @Model.DefaultResourceReferenceId
-
- - Resource Version Id
- -
- @Html.DisplayFor(model => model.ResourceVersionId)
-
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- @if (Model.GenericFileDetails != null && @Model.GenericFileDetails.File != null)
- {
- - File
- -
- @Model.GenericFileDetails.File.FileName
- (@Model.GenericFileDetails.File.FileType.Name)
-
- - File Path
- -
- @Model.GenericFileDetails.File.FilePath
-
- -
-
-
- -
-
-
- }
-
-
- }
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.Image)
- {
-
- @if (Model.ImageDetails.File == null)
- {
-
- @if (Model.ImageDetails.File == null)
- {
- @Html.Raw("No Image File is associated with this Resource Version")
- }
-
- }
-
Resource Reference ID: @Model.DefaultResourceReferenceId
-
- - Resource Version Id
- -
- @Html.DisplayFor(model => model.ResourceVersionId)
-
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- @if (@Model.ImageDetails.File != null)
- {
- - Image File
- -
- @Model.ImageDetails.File.FileName
- (@Model.ImageDetails.File.FileType.Name)
-
- - Image File Path
- -
- @Model.ImageDetails.File.FilePath
-
- }
- - Alt Tag
- -
- @Html.DisplayFor(model => model.ImageDetails.AltTag)
-
-
-
- }
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.Video)
- {
-
- @if (Model.VideoDetails.File == null || Model.VideoDetails.TranscriptFile == null || Model.VideoDetails.ClosedCaptionsFile == null)
- {
-
- @if (Model.VideoDetails.File == null)
- {
- @Html.Raw("
No Video File is associated with this Resource Version")
- }
- @if (Model.VideoDetails.TranscriptFile == null)
- {
- @Html.Raw("No Transcript File is associated with this Resource Version")
- }
- @if (Model.VideoDetails.ClosedCaptionsFile == null)
- {
- @Html.Raw("No Closed Captions File is associated with this Resource Version")
- }
-
- }
-
Resource Reference ID: @Model.DefaultResourceReferenceId
-
- - Resource Version Id
- -
- @Html.DisplayFor(model => model.ResourceVersionId)
-
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- @if (@Model.VideoDetails.File != null)
- {
- - Video File
- -
- @Model.VideoDetails.File.FileName
-
- - Video File Path
- -
- @Model.VideoDetails.File.FilePath
-
- }
- @if (@Model.VideoDetails.TranscriptFile != null)
- {
- - Transcript File
- -
- @Model.VideoDetails.TranscriptFile.FileName
-
- - Transcript File Path
- -
- @Model.VideoDetails.TranscriptFile.FilePath
-
- }
- @if (@Model.VideoDetails.ClosedCaptionsFile != null)
- {
- - Closed Captions File
- -
- @Model.VideoDetails.ClosedCaptionsFile.FileName
-
- - Closed Captions File Path
- -
- @Model.VideoDetails.ClosedCaptionsFile.FilePath
-
- }
-
-
- }
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.WebLink)
- {
-
-
Resource Reference ID: @Model.DefaultResourceReferenceId
-
- - Resource Version Id
- -
- @Html.DisplayFor(model => model.ResourceVersionId)
-
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- - Url
- -
- @Html.DisplayFor(model => model.WebLinkDetails.Url)
-
- - Display Text
- -
- @Html.DisplayFor(model => model.WebLinkDetails.DisplayText)
-
-
-
- }
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.Scorm)
- {
-
-
Resource Reference ID: @Model.DefaultResourceReferenceId
-
- - Resource Version Id
- - @Html.DisplayFor(model => model.ResourceVersionId)
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- - ESR Link
- - @Model.ScormDetails.HostedContentUrl
- - Zip File
- -
- @Model.ScormDetails.File.FileName
-
- - Allowed Download
- - @(Model.ScormDetails.CanDownload ? "Yes" : "No")
- - Forced clearing of user suspend data
- - @(Model.ScormDetails.ClearSuspendData ? "Yes" : "No")
- - Content Folder
- - @Model.ScormDetails.ContentFilePath
-
-
- }
-
- @if (Model.ResourceTypeEnum == ResourceTypeEnum.Assessment)
- {
-
-
Resource Version ID: @Model.ResourceVersionId
-
- - Resource Version Id
- -
- @Html.DisplayFor(model => model.ResourceVersionId)
-
- - Resource Type
- -
- @Html.DisplayFor(model => model.ResourceTypeDescription)
-
- @if (Model.AssessmentDetails is { AssessmentContent: { } })
- {
- - Assessment Type
- -
- @Html.DisplayFor(model => model.AssessmentDetails.AssessmentType)
-
- if (Model.AssessmentDetails.PassMark != null)
- {
- - Pass Mark
- -
- @Html.DisplayFor(model => model.AssessmentDetails.PassMark)
-
- }
- if (Model.AssessmentDetails.MaximumAttempts != null)
- {
- - Maximum Attempts
- -
- @Html.DisplayFor(model => model.AssessmentDetails.MaximumAttempts)
-
- }
- - Answer in order
- -
- @(Model.AssessmentDetails.AnswerInOrder ? "Yes" : "No")
-
- }
-
- @if (Model.AssessmentDetails is { EndGuidance: { } } && Model.AssessmentDetails.EndGuidance.Blocks != null)
- {
-
- - End Guidance: Number of Blocks
- -
- @Html.DisplayFor(model => model.AssessmentDetails.EndGuidance.Blocks.Count)
-
-
-
- }
-
- @if (Model.AssessmentDetails is { AssessmentContent: { } } && Model.AssessmentDetails.AssessmentContent.Blocks != null)
- {
-
- - Content: Number of Blocks
- -
- @Html.DisplayFor(model => model.AssessmentDetails.AssessmentContent.Blocks.Count)
-
-
-
- }
-
- }
-
+
+
+
+ @if (this.ViewBag.Status == "Success")
+ {
+
+
+
Successfully added the Dev ID.
-
-
-
+ }
+ @if (this.ViewBag.Status == "Duplicate")
+ {
+
-
-
-
+ }
+ else if (this.ViewBag.Status == "Enter a Dev id for the resource")
+ {
+
+
You must enter a Dev ID.
- @if (Model.HasValidationErrors)
- {
-
- }
+ }
+
+
- }
+
+ @if (Model.HasValidationErrors)
+ {
+
+ }
+
+ }
@section Scripts{
-
+
}
diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/_DevIdDetails.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/_DevIdDetails.cshtml
new file mode 100644
index 000000000..1af9e2808
--- /dev/null
+++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Resource/_DevIdDetails.cshtml
@@ -0,0 +1,30 @@
+@model LearningHub.Nhs.Models.Resource.ResourceVersionDevIdViewModel
+
+@{
+ ViewData["Title"] = "Add development Id ";
+ var errorHasOccurred = !ViewData.ModelState.IsValid;
+}
+
\ No newline at end of file
diff --git a/AdminUI/LearningHub.Nhs.AdminUI/Views/Shared/_Layout.cshtml b/AdminUI/LearningHub.Nhs.AdminUI/Views/Shared/_Layout.cshtml
index 3f972659a..d12be205a 100644
--- a/AdminUI/LearningHub.Nhs.AdminUI/Views/Shared/_Layout.cshtml
+++ b/AdminUI/LearningHub.Nhs.AdminUI/Views/Shared/_Layout.cshtml
@@ -2,83 +2,84 @@
-
-
-
@ViewData["Title"] - Learning Hub Administration
-
-
-
+
+
+
@ViewData["Title"] - Learning Hub Administration
+
+
+
-
+
-
-
-
-
-
-
-
-
-
- @RenderSection("Styles", required: false)
- @await Html.PartialAsync("_GoogleAnalytics")
-
+
+
+
+
+
+
+
+
+
+ @RenderSection("Styles", required: false)
+ @await Html.PartialAsync("_GoogleAnalytics")
+
-
-
-
-
- @{
- var mainWidth = IsSectionDefined("SideMenu") ? "col-sm-9 col-lg-9 col-xl-10 pageWithMenu" : "col-sm-12";
- }
-
- @if (IsSectionDefined("SideMenu"))
- {
-
- }
-
- @RenderBody()
-
-
-
-
-
+
+
+
+
+ @{
+ var mainWidth = IsSectionDefined("SideMenu") ? "col-sm-9 col-lg-9 col-xl-10 pageWithMenu" : "col-sm-12";
+ }
+
+ @if (IsSectionDefined("SideMenu"))
+ {
+
+ }
+
+ @RenderBody()
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- @**@
-
- @**@
-
- @RenderSection("Scripts", required: false)
+
+
+
+
+
+
+
+
+
+ @**@
+
+ @**@
+
+ @RenderSection("Scripts", required: false)
-
\ No newline at end of file
+
+@await Component.InvokeAsync("Version")
diff --git a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs
index dac3a38e9..979c1ac33 100644
--- a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs
+++ b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs
@@ -429,6 +429,7 @@ public async Task
CreateAccountCountrySearch()
public async Task CreateAccountCountrySelection(AccountCreationViewModel accountCreationViewModel)
{
var accountDetails = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (!string.IsNullOrWhiteSpace(accountCreationViewModel.FilterText))
{
string filterText = Regex.Replace(accountCreationViewModel.FilterText, "[:!@#$%^&*()}{|\":?><\\[\\]\\;'/.,~\\\"\"\\'\\\\/]", " ");
@@ -469,41 +470,55 @@ public async Task CreateAccountRegionSelection(AccountCreationVie
{
var countryCheck = int.TryParse(accountCreationViewModel.CountryId, out int countryId);
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
+ if (accountCreationViewModel.CountryId != null)
+ {
+ accountCreation.CountryId = accountCreationViewModel.CountryId;
+ }
+
if (string.IsNullOrWhiteSpace(accountCreationViewModel.CountryId) || !countryCheck)
{
this.ModelState.AddModelError("CountryId", CommonValidationErrorMessages.CountryRequired);
var countries = await this.countryService.GetFilteredAsync(accountCreationViewModel.FilterText);
return this.View("CreateAccountCountrySelection", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, CountryList = countries.ToList(), ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
}
-
- accountCreation.CountryId = accountCreationViewModel.CountryId;
- await this.multiPageFormService.SetMultiPageFormData(accountCreation, MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
- if (countryId != 1)
+ else if (accountCreation.CountryId == "1")
{
- accountCreationViewModel.RegionId = string.Empty;
- accountCreation.RegionId = string.Empty;
await this.multiPageFormService.SetMultiPageFormData(accountCreation, MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
-
- if (accountCreation.IsLoginWizard)
+ var regionData = await this.regionService.GetAllPagedAsync(accountCreationViewModel.CurrentPageIndex, UserRegistrationContentPageSize);
+ return this.View(new AccountCreationListViewModel { Region = regionData.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = regionData.Item1, PageSize = UserRegistrationContentPageSize, HasItems = regionData.Item1 > 0, CurrentPage = accountCreationViewModel.CurrentPageIndex }, RegionId = accountCreation.RegionId, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
+ }
+ else
+ {
+ accountCreation.CountryId = accountCreationViewModel.CountryId;
+ await this.multiPageFormService.SetMultiPageFormData(accountCreation, MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ if (countryId != 1)
{
- return this.CheckConfirmationUpdate() ? this.RedirectToAction("AccountConfirmation", "LoginWizard") : this.RedirectToAction("NextStage", "LoginWizard");
- }
+ accountCreationViewModel.RegionId = string.Empty;
+ accountCreation.RegionId = string.Empty;
+ await this.multiPageFormService.SetMultiPageFormData(accountCreation, MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
- return this.CheckConfirmationUpdate() ? this.RedirectToAction("CreateAccountConfirmation", new AccountCreationViewModel { LocationId = accountCreation.LocationId }) : this.RedirectToAction("CreateAccountSearchRole", accountCreationViewModel);
- }
+ if (accountCreation.IsLoginWizard)
+ {
+ return this.CheckConfirmationUpdate() ? this.RedirectToAction("AccountConfirmation", "LoginWizard") : this.RedirectToAction("NextStage", "LoginWizard");
+ }
- switch (accountCreationViewModel.AccountCreationPagingEnum)
- {
- case AccountCreationPagingEnum.NextPageChange:
- accountCreationViewModel.CurrentPageIndex += 1;
- break;
+ return this.CheckConfirmationUpdate() ? this.RedirectToAction("CreateAccountConfirmation", new AccountCreationViewModel { LocationId = accountCreation.LocationId }) : this.RedirectToAction("CreateAccountSearchRole", accountCreationViewModel);
+ }
- case AccountCreationPagingEnum.PreviousPageChange:
- accountCreationViewModel.CurrentPageIndex -= 1;
- break;
- case AccountCreationPagingEnum.Default:
- accountCreationViewModel.CurrentPageIndex = 1;
- break;
+ switch (accountCreationViewModel.AccountCreationPagingEnum)
+ {
+ case AccountCreationPagingEnum.NextPageChange:
+ accountCreationViewModel.CurrentPageIndex += 1;
+ break;
+
+ case AccountCreationPagingEnum.PreviousPageChange:
+ accountCreationViewModel.CurrentPageIndex -= 1;
+ break;
+ case AccountCreationPagingEnum.Default:
+ accountCreationViewModel.CurrentPageIndex = 1;
+ break;
+ }
}
var region = await this.regionService.GetAllPagedAsync(accountCreationViewModel.CurrentPageIndex, UserRegistrationContentPageSize);
@@ -522,10 +537,10 @@ public async Task CreateAccountRegionSelection(AccountCreationVie
public async Task CreateAccountSubmitRegionSelection(AccountCreationViewModel accountCreationViewModel)
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
-
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (string.IsNullOrWhiteSpace(accountCreationViewModel.RegionId))
{
- if (accountCreation.CountryId == "1")
+ if (accountCreation.CountryId == "1" || accountCreation.CountryId == null)
{
this.ModelState.AddModelError("RegionId", CommonValidationErrorMessages.RegionRequired);
var region = await this.regionService.GetAllPagedAsync(1, UserRegistrationContentPageSize);
@@ -533,6 +548,11 @@ public async Task CreateAccountSubmitRegionSelection(AccountCreat
}
}
+ if (accountCreationViewModel.CountryId != null)
+ {
+ accountCreation.CountryId = accountCreationViewModel.CountryId;
+ }
+
accountCreation.RegionId = accountCreationViewModel.RegionId;
await this.multiPageFormService.SetMultiPageFormData(accountCreation, MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
@@ -546,7 +566,7 @@ public async Task CreateAccountSubmitRegionSelection(AccountCreat
return this.CheckConfirmationUpdate() ? this.RedirectToAction("AccountConfirmation", "LoginWizard") : this.RedirectToAction("NextStage", "LoginWizard");
}
- return this.CheckConfirmationUpdate() ? this.RedirectToAction("CreateAccountConfirmation", new AccountCreationViewModel { LocationId = accountCreation.LocationId }) : this.RedirectToAction("CreateAccountSearchRole", new AccountCreationViewModel() { CountryId = accountCreation.CountryId });
+ return this.CheckConfirmationUpdate() ? this.RedirectToAction("CreateAccountConfirmation", new AccountCreationViewModel { LocationId = accountCreation.LocationId }) : this.RedirectToAction("CreateAccountSearchRole", new AccountCreationViewModel() { CountryId = accountCreation.CountryId, RegionId = accountCreation.RegionId });
}
///
@@ -575,13 +595,14 @@ public async Task CreateAccountSearchRole(AccountCreationViewMode
public async Task CreateAccountCurrentRole(AccountCreationViewModel accountCreationViewModel)
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (!string.IsNullOrWhiteSpace(accountCreationViewModel.FilterText))
{
string filterText = Regex.Replace(accountCreationViewModel.FilterText, "[:!@#$%^&*()}{|\":?><\\[\\]\\;'/.,~\\\"\"\\'\\\\/]", " ");
if (string.IsNullOrWhiteSpace(filterText))
{
this.ModelState.AddModelError("FilterText", CommonValidationErrorMessages.SearchTermRequired);
- return this.View("CreateAccountSearchRole", new AccountCreationViewModel { RegionId = accountCreation.RegionId, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
+ return this.View("CreateAccountSearchRole", new AccountCreationViewModel { CountryId = accountCreation.CountryId, RegionId = accountCreation.RegionId, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
}
}
@@ -598,7 +619,7 @@ public async Task CreateAccountCurrentRole(AccountCreationViewMod
else
{
this.ModelState.AddModelError("FilterText", CommonValidationErrorMessages.SearchTermRequired);
- return this.View("CreateAccountSearchRole", new AccountCreationViewModel { RegionId = accountCreation.RegionId, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
+ return this.View("CreateAccountSearchRole", new AccountCreationViewModel { CountryId = accountCreation.CountryId, RegionId = accountCreation.RegionId, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
}
}
@@ -631,15 +652,17 @@ public async Task CreateAccountCurrentRole(AccountCreationViewMod
public async Task CreateAccountProfessionalRegNumber(AccountCreationViewModel accountCreationViewModel)
{
var roleCheck = int.TryParse(accountCreationViewModel.CurrentRole, out int roleId);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
+ var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+
if (string.IsNullOrWhiteSpace(accountCreationViewModel.CurrentRole) || !roleCheck)
{
this.ModelState.AddModelError("CurrentRole", CommonValidationErrorMessages.RoleRequired);
var jobroles = await this.jobRoleService.GetPagedFilteredAsync(accountCreationViewModel.FilterText, 1, UserRegistrationContentPageSize);
- return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, RoleList = jobroles.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = jobroles.Item1, PageSize = UserRegistrationContentPageSize, HasItems = jobroles.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
+ return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, CountryId = accountCreation.CountryId, RoleList = jobroles.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = jobroles.Item1, PageSize = UserRegistrationContentPageSize, HasItems = jobroles.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
}
var jobrole = await this.jobRoleService.GetByIdAsync(roleId);
- var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
accountCreation.CurrentRole = jobrole.Id.ToString();
accountCreation.CurrentRoleName = jobrole.Name;
accountCreation.MedicalCouncilId = jobrole.MedicalCouncilId;
@@ -662,6 +685,7 @@ public async Task CreateAccountProfessionalRegNumber(AccountCreat
public async Task CreateAccountGradeSelection(AccountCreationViewModel accountCreationViewModel)
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
int gradePageSize = UserRegistrationContentPageSize + 5;
var roleCheck = int.TryParse(accountCreation.CurrentRole, out int roleId);
if (!roleCheck || roleId == 0)
@@ -672,7 +696,7 @@ public async Task CreateAccountGradeSelection(AccountCreationView
if (string.IsNullOrWhiteSpace(accountCreationViewModel.RegistrationNumber) && accountCreation.MedicalCouncilId.HasValue && (int)accountCreation.MedicalCouncilId > 0)
{
- this.ModelState.AddModelError("RegistrationNumber", $"You must provide a {accountCreation.MedicalCouncilCode} Number");
+ this.ModelState.AddModelError("RegistrationNumber", $"{accountCreation.MedicalCouncilName} Number is required");
this.ViewBag.Job = await this.jobRoleService.GetByIdAsync(roleId);
accountCreationViewModel.CurrentRole = roleId.ToString();
return this.View("CreateAccountProfessionalRegNumber", accountCreationViewModel);
@@ -726,11 +750,12 @@ public async Task CreateAccountGradeSelection(AccountCreationView
public async Task CreateAccountPrimarySpecialty(AccountCreationViewModel accountCreationViewModel)
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
var gradeCheck = int.TryParse(accountCreationViewModel.GradeId, out int gradeId);
if (string.IsNullOrWhiteSpace(accountCreationViewModel.GradeId) || !gradeCheck)
{
int gradePageSize = UserRegistrationContentPageSize + 5;
- this.ModelState.AddModelError(string.Empty, CommonValidationErrorMessages.GradeRequired);
+ this.ModelState.AddModelError("GradeId", CommonValidationErrorMessages.GradeRequired);
var gradeLevel = await this.gradeService.GetPagedGradesForJobRoleAsync(int.Parse(accountCreation.CurrentRole), 1, gradePageSize);
return this.View("CreateAccountGradeSelection", new AccountCreationListViewModel { GradeList = gradeLevel.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = gradeLevel.Item1, PageSize = gradePageSize, HasItems = gradeLevel.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
}
@@ -758,6 +783,7 @@ public async Task CreateAccountPrimarySpecialty(AccountCreationVi
public async Task CreateAccountPrimarySpecialtySelection(AccountCreationViewModel accountCreationViewModel)
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (accountCreationViewModel.PrimarySpecialtyId?.ToLower() == "not applicable")
{
var specialties = await this.specialtyService.GetSpecialtiesAsync();
@@ -833,6 +859,7 @@ public async Task CreateAccountWorkStartDate(AccountCreationViewM
{
int specialtyId;
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (accountCreationViewModel.PrimarySpecialtyId?.ToLower() == "not applicable")
{
var specialties = await this.specialtyService.GetSpecialtiesAsync();
@@ -852,7 +879,7 @@ public async Task CreateAccountWorkStartDate(AccountCreationViewM
this.ModelState.AddModelError("PrimarySpecialtyId", CommonValidationErrorMessages.SpecialtyNotApplicable);
}
- return this.View("CreateAccountPrimarySpecialtySelection", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation, SpecialtyList = shortlist.Item2, OptionalSpecialtyItem = optionalSpecialty.FirstOrDefault(x => x.Name.ToLower() == "not applicable"), AccountCreationPaging = new AccountCreationPagingModel { TotalItems = shortlist.Item1, PageSize = UserRegistrationContentPageSize, HasItems = shortlist.Item1 > 0, CurrentPage = 1 } });
+ return this.View("CreateAccountPrimarySpecialtySelection", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, GradeId = accountCreation.GradeId, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation, SpecialtyList = shortlist.Item2, OptionalSpecialtyItem = optionalSpecialty.FirstOrDefault(x => x.Name.ToLower() == "not applicable"), AccountCreationPaging = new AccountCreationPagingModel { TotalItems = shortlist.Item1, PageSize = UserRegistrationContentPageSize, HasItems = shortlist.Item1 > 0, CurrentPage = 1 } });
}
accountCreation.PrimarySpecialtyId = accountCreationViewModel.PrimarySpecialtyId;
@@ -880,6 +907,7 @@ public async Task CreateAccountWorkStartDate(AccountCreationViewM
[TypeFilter(typeof(RedirectMissingMultiPageFormData), Arguments = new object[] { nameof(MultiPageFormDataFeature.AddRegistrationPrompt) })]
public async Task CreateAccountStartDate(AccountCreationDateViewModel accountCreationDateViewModel)
{
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (!this.ModelState.IsValid)
{
return this.View("CreateAccountWorkStartDate", accountCreationDateViewModel);
@@ -934,6 +962,7 @@ public async Task CreateAccountStartDate(bool? returnToConfirmati
public async Task CreateAccountWorkPlaceSearch()
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (!string.IsNullOrWhiteSpace(accountCreation.LocationId) && !this.CheckConfirmationUpdate())
{
return this.RedirectToAction("CreateAccountWorkPlace", new AccountCreationViewModel { LocationId = accountCreation.LocationId });
@@ -953,6 +982,7 @@ public async Task CreateAccountWorkPlaceSearch()
public async Task CreateAccountWorkPlace(AccountCreationViewModel accountCreationViewModel)
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (string.IsNullOrWhiteSpace(accountCreationViewModel.FilterText))
{
if (!string.IsNullOrWhiteSpace(accountCreation.LocationId))
@@ -995,7 +1025,7 @@ public async Task CreateAccountWorkPlace(AccountCreationViewModel
public async Task CreateAccountConfirmation(AccountCreationViewModel accountCreationViewModel)
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
-
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (accountCreation.AccountCreationType == AccountCreationTypeEnum.FullAccess)
{
var placeOfWorkCheck = int.TryParse(accountCreationViewModel.LocationId, out int locationId);
@@ -1032,7 +1062,7 @@ public async Task CreateAccountConfirmation()
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
this.ViewBag.AccountCreationType = accountCreation.AccountCreationType;
-
+ AccountCreationFormHelper.PopulateGroupedFormControlMetadata(this.ViewData);
if (accountCreation.CountryId == "1" && (string.IsNullOrWhiteSpace(accountCreation.RegionId) || accountCreation.RegionId == "0"))
{
this.ModelState.AddModelError(string.Empty, CommonValidationErrorMessages.RegionRequiredSummary);
diff --git a/LearningHub.Nhs.WebUI/Controllers/ResourceController.cs b/LearningHub.Nhs.WebUI/Controllers/ResourceController.cs
index 7775ec6cd..5df61185e 100644
--- a/LearningHub.Nhs.WebUI/Controllers/ResourceController.cs
+++ b/LearningHub.Nhs.WebUI/Controllers/ResourceController.cs
@@ -189,6 +189,9 @@ public async Task Index(int resourceReferenceId, bool? acceptSens
ActivityStart = DateTime.UtcNow, // TODO: What about user's timezone offset when Javascript is disabled? Needs JavaScript.
ActivityStatus = ActivityStatusEnum.Completed,
};
+
+ // setting time delay to avoid multiple records in same time-TD-4299
+ await Task.Delay(10000);
await this.activityService.CreateResourceActivityAsync(activity);
}
diff --git a/LearningHub.Nhs.WebUI/Controllers/SearchController.cs b/LearningHub.Nhs.WebUI/Controllers/SearchController.cs
index 7272e9a27..ff1afba0d 100644
--- a/LearningHub.Nhs.WebUI/Controllers/SearchController.cs
+++ b/LearningHub.Nhs.WebUI/Controllers/SearchController.cs
@@ -6,6 +6,7 @@ namespace LearningHub.Nhs.WebUI.Controllers
using System.Net.Http;
using System.Threading.Tasks;
using LearningHub.Nhs.Models.Search;
+ using LearningHub.Nhs.Models.Search.SearchClick;
using LearningHub.Nhs.WebUI.Filters;
using LearningHub.Nhs.WebUI.Interfaces;
using LearningHub.Nhs.WebUI.Models.Search;
@@ -314,5 +315,52 @@ public async Task GetAutoSuggestion(string term)
return this.PartialView("_AutoComplete", autoSuggestions);
}
+
+ ///
+ /// Records the AutoSuggestion Click logs.
+ ///
+ /// the term.
+ /// the searchType.
+ /// click Payload Model.
+ /// itemIndex.
+ /// total Number Of Hits.
+ /// containerId.
+ /// name.
+ /// query.
+ /// userQuery.
+ /// searchId.
+ /// timeOfSearch.
+ /// title.
+ /// Action result.
+ [HttpGet("record-autosuggestion-click")]
+ public IActionResult RecordAutoSuggestionClick(string term, string url, string clickTargetUrl, int itemIndex, int totalNumberOfHits, string containerId, string name, string query, string userQuery, string searchId, long timeOfSearch, string title)
+ {
+ AutoSuggestionClickPayloadModel clickPayloadModel = new AutoSuggestionClickPayloadModel
+ {
+ ClickTargetUrl = clickTargetUrl,
+ ContainerId = containerId,
+ HitNumber = itemIndex,
+ TimeOfClick = timeOfSearch,
+ DocumentFields = new SearchClickDocumentModel
+ {
+ Name = name,
+ Title = title,
+ },
+ SearchSignal = new SearchClickSignalModel
+ {
+ Query = query,
+ SearchId = searchId,
+ TimeOfSearch = timeOfSearch,
+ UserQuery = userQuery,
+ Stats = new SearchClickStatsModel
+ {
+ TotalHits = totalNumberOfHits,
+ },
+ },
+ };
+
+ this.searchService.SendAutoSuggestionClickActionAsync(clickPayloadModel);
+ return this.Redirect(url);
+ }
}
}
\ No newline at end of file
diff --git a/LearningHub.Nhs.WebUI/Helpers/AccountCreationFormHelper.cs b/LearningHub.Nhs.WebUI/Helpers/AccountCreationFormHelper.cs
new file mode 100644
index 000000000..657c0828f
--- /dev/null
+++ b/LearningHub.Nhs.WebUI/Helpers/AccountCreationFormHelper.cs
@@ -0,0 +1,28 @@
+namespace LearningHub.Nhs.WebUI.Helpers
+{
+ using System.Collections.Generic;
+ using Microsoft.AspNetCore.Mvc.ViewFeatures;
+
+ ///
+ /// Defines the .
+ ///
+ public static class AccountCreationFormHelper
+ {
+ ///
+ /// The PopulateGroupedFormControlMetadata.
+ ///
+ /// viewData.
+ public static void PopulateGroupedFormControlMetadata(ViewDataDictionary viewData)
+ {
+ viewData["GroupedFormControlMetadata"] = new Dictionary
+ {
+ { "CountryId", true },
+ { "RegionId", true },
+ { "CurrentRole", true },
+ { "PrimarySpecialtyId", true },
+ { "GradeId", true },
+ { "LocationId", true },
+ };
+ }
+ }
+}
diff --git a/LearningHub.Nhs.WebUI/Interfaces/IFileService.cs b/LearningHub.Nhs.WebUI/Interfaces/IFileService.cs
index c74a1681f..eb94d0185 100644
--- a/LearningHub.Nhs.WebUI/Interfaces/IFileService.cs
+++ b/LearningHub.Nhs.WebUI/Interfaces/IFileService.cs
@@ -5,6 +5,7 @@
using System.Threading.Tasks;
using Azure.Storage.Files.Shares.Models;
using LearningHub.Nhs.Models.Resource;
+ using LearningHub.Nhs.WebUI.Models;
///
/// Defines the .
@@ -25,7 +26,8 @@ public interface IFileService
/// File path.
/// File name.
/// A representing the result of the asynchronous operation.
- Task DownloadFileAsync(string filePath, string fileName);
+ // Task DownloadFileAsync(string filePath, string fileName);
+ Task DownloadFileAsync(string filePath, string fileName);
///
/// The StreamFileAsync.
diff --git a/LearningHub.Nhs.WebUI/Interfaces/ISearchService.cs b/LearningHub.Nhs.WebUI/Interfaces/ISearchService.cs
index 8a2f0aec1..3f083bc38 100644
--- a/LearningHub.Nhs.WebUI/Interfaces/ISearchService.cs
+++ b/LearningHub.Nhs.WebUI/Interfaces/ISearchService.cs
@@ -3,6 +3,7 @@
using System.Security.Principal;
using System.Threading.Tasks;
using LearningHub.Nhs.Models.Search;
+ using LearningHub.Nhs.Models.Search.SearchClick;
using LearningHub.Nhs.WebUI.Models.Search;
///
@@ -91,5 +92,12 @@ public interface ISearchService
/// The term.
/// The .
Task GetAutoSuggestionList(string term);
+
+ ///
+ /// The Send AutoSuggestion Click Action Async.
+ ///
+ /// The click Payload Model.
+ /// The .
+ Task SendAutoSuggestionClickActionAsync(AutoSuggestionClickPayloadModel clickPayloadModel);
}
}
diff --git a/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj b/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj
index f20842a9a..47744a321 100644
--- a/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj
+++ b/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj
@@ -2,11 +2,14 @@
net6.0
- InProcess
+ 1.0.0.0
+ 1.0.0.0
+ 1.0.0
+ InProcess
a2ecb5d2-cf13-4551-9cb6-3d86dfbcf8ef
true
true
- x64
+ x64
true
@@ -104,11 +107,11 @@
-
+
-
+
@@ -125,7 +128,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
@@ -175,72 +178,76 @@
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
-
+
+
+
+
+
diff --git a/LearningHub.Nhs.WebUI/Models/FileDownloadResponse.cs b/LearningHub.Nhs.WebUI/Models/FileDownloadResponse.cs
new file mode 100644
index 000000000..8036e9320
--- /dev/null
+++ b/LearningHub.Nhs.WebUI/Models/FileDownloadResponse.cs
@@ -0,0 +1,25 @@
+namespace LearningHub.Nhs.WebUI.Models
+{
+ using System.IO;
+
+ ///
+ /// Defines the .
+ ///
+ public class FileDownloadResponse
+ {
+ ///
+ /// Gets or sets the Content.
+ ///
+ public Stream Content { get; set; }
+
+ ///
+ /// Gets or sets the ContentType.
+ ///
+ public string ContentType { get; set; }
+
+ ///
+ /// Gets or sets the ContentType.
+ ///
+ public long ContentLength { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/bookmark/togglebookmark.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/bookmark/togglebookmark.vue
index bfcace2de..658024396 100644
--- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/bookmark/togglebookmark.vue
+++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/bookmark/togglebookmark.vue
@@ -24,7 +24,8 @@
diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/catalogue/catalogueaccessrequest.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/catalogue/catalogueaccessrequest.vue
index 1404eba89..89d5bba9d 100644
--- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/catalogue/catalogueaccessrequest.vue
+++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/catalogue/catalogueaccessrequest.vue
@@ -98,7 +98,8 @@
diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/catalogue/managecatalogue.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/catalogue/managecatalogue.vue
index 371ac968b..d76b0bef1 100644
--- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/catalogue/managecatalogue.vue
+++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/catalogue/managecatalogue.vue
@@ -14,10 +14,14 @@