Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f10524c
Merge pull request #512 from TechnologyEnhancedLearning/Develope/fixe…
ArunimaGeorge Aug 5, 2024
10d728d
Merge pull request #499 from TechnologyEnhancedLearning/Develop/fixes…
ArunimaGeorge Jul 31, 2024
af5bf57
fixes
AnjuJose011 Aug 1, 2024
661c609
Merge pull request #517 from TechnologyEnhancedLearning/Openapi-Changes
AnjuJose011 Aug 5, 2024
d6c4810
Merge pull request #521 from TechnologyEnhancedLearning/MergeActivity…
AnjuJose011 Aug 6, 2024
fb5ab1e
Merge pull request #522 from TechnologyEnhancedLearning/Develop/Featu…
Phil-NHS Aug 7, 2024
bdc69c6
TD-4283: Fixed download issue for elearning resource in firefox browser
ArunimaGeorge Sep 2, 2024
bf9c1db
Merge pull request #565 from TechnologyEnhancedLearning/Develop/Fixes…
ArunimaGeorge Sep 2, 2024
5a04e2a
model versin update
AnjuJose011 Sep 18, 2024
1e07bfc
Merge pull request #593 from TechnologyEnhancedLearning/ModelVersionU…
AnjuJose011 Sep 18, 2024
a1e6a4f
conflicts resolved
AnjuJose011 Sep 18, 2024
882b5f9
Merge pull request #595 from TechnologyEnhancedLearning/MergeVirgoChn…
AnjuJose011 Sep 18, 2024
206f741
Merge pull request #522 from TechnologyEnhancedLearning/Develop/Featu…
Phil-NHS Aug 7, 2024
94e8a54
Merge pull request #522 from TechnologyEnhancedLearning/Develop/Featu…
Phil-NHS Aug 7, 2024
1abcee0
No task, quick fix, to bookmark endpoint which needs oauth token hand…
Phil-NHS Aug 7, 2024
e7ce515
Merge pull request #522 from TechnologyEnhancedLearning/Develop/Featu…
Phil-NHS Aug 7, 2024
aefa90b
Merge pull request #522 from TechnologyEnhancedLearning/Develop/Featu…
Phil-NHS Aug 7, 2024
99c6944
fixes
AnjuJose011 Sep 19, 2024
be5ede2
Merge pull request #596 from TechnologyEnhancedLearning/openapi-contr…
AnjuJose011 Sep 19, 2024
a7ecd8a
TD-4682:fix click logs issue -Find-wise
ArunimaGeorge Sep 20, 2024
1657a06
Merge pull request #601 from TechnologyEnhancedLearning/Develop/Fixes…
ArunimaGeorge Sep 25, 2024
68f66fd
TD-4373-Allow ppsx file type
Swapnamol Sep 27, 2024
03f6801
Merge pull request #615 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Sep 27, 2024
315b4e9
TD-4430: Duplicate keywords issue
ArunimaGeorge Oct 1, 2024
8888bc5
Update Edit.cshtml
ArunimaGeorge Oct 1, 2024
88cdec6
Merge pull request #621 from TechnologyEnhancedLearning/Develop/Fixes…
ArunimaGeorge Oct 1, 2024
0437380
TD-4388: Assessment resource settings need a required field marker
Swapnamol Oct 2, 2024
40a4ff2
Merge pull request #623 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Oct 2, 2024
9d4bc51
TD-4819: LH-Issue showing 'Certificates' section blank on 'My accesse…
Swapnamol Oct 3, 2024
e13ab4b
Merge pull request #628 from TechnologyEnhancedLearning/Develop/Fixes…
Swapnamol Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ obj
/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Database/LearningHub.Nhs.Migration.Staging.Database.dbmdl
/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Database/LearningHub.Nhs.Migration.Staging.Database.jfm
/LearningHub.Nhs.WebUI.AutomatedUiTests/appsettings.Development.json
/OpenAPI/LearningHub.Nhs.OpenApi/appsettings.Development.json
/OpenAPI/LearningHub.Nhs.OpenApi/web.config
/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj.user
/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<PackageReference Include="HtmlSanitizer" Version="6.0.453" />
<PackageReference Include="IdentityModel" Version="4.4.0" />
<PackageReference Include="LearningHub.Nhs.Caching" Version="2.0.2" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.38" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.40" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.19.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
Expand Down
22 changes: 19 additions & 3 deletions AdminUI/LearningHub.Nhs.AdminUI/Views/Catalogue/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@
<span class="input-validation-error keyword-maxlength" style="display: none;">The maximum length is 50 characters.</span>
</div>
</div>
<div class="row">
<div class="col-12">
<span id="keyword-error-span" class="field-validation-error" style="display: none;"></span>
</div>
</div>

</div>
<div class="col-12">
Expand Down Expand Up @@ -341,6 +346,9 @@
} else {
$('#add-keyword').removeAttr('disabled');
}

$('#keyword-error-span').hide();
$('#keyword-error-span').html('');
});

$('#add-keyword').on('click', function () {
Expand All @@ -352,9 +360,11 @@

// Split the input value by commas and trim each keyword
var values = value.split(',').map(function (item) {
return item.trim();
return item.trim().toLowerCase();
});

var duplicateKeywords = [];
$('#keyword-error-span').hide();
values.forEach(function (value) {
if (value && keywords.indexOf(value) === -1) {
keywords.push(value);
Expand All @@ -368,9 +378,15 @@
$(x).attr('name', "Keywords[" + i + "]");
});
}
else
{
duplicateKeywords.push(value);
$('#keyword-error-span').show();
$('#keyword-error-span').html('The keyword(s) have already been added : ' + duplicateKeywords.join(', '))
}
});

$keywordInput.val("");
$keywordInput.val("");
if (keywords.length > 4) {
$('#add-keyword').attr('disabled', 'disabled');
$('#add-keyword-input').attr('disabled', 'disabled');
Expand Down Expand Up @@ -441,4 +457,4 @@

</script>
<script src="~/js/imageInput.js"></script>
}
}
2 changes: 2 additions & 0 deletions LearningHub.Nhs.WebUI/Controllers/CatalogueController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public async Task<IActionResult> Index(int pageIndex = 1, string term = null)
});

catalogues.TotalCount = termCatalogues.TotalHits;
catalogues.GroupId = Guid.NewGuid();
catalogues.Catalogues = termCatalogues.DocumentModel.Select(t => new DashboardCatalogueViewModel
{
Url = t.Url,
Expand All @@ -124,6 +125,7 @@ public async Task<IActionResult> Index(int pageIndex = 1, string term = null)
NodeId = int.Parse(t.Id),
BadgeUrl = t.BadgeUrl,
Providers = t.Providers,
ClickPayload = t.Click.Payload,
}).ToList();
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public async Task<IActionResult> Scorm(int id)
/// <param name="filePath">filePath.</param>
/// <returns>bool.</returns>
//// [ResponseCache(VaryByQueryKeys = new[] { "*" }, Duration = 0, NoStore = true)] // disable caching
//// Removed Request.Headers["Referer"] Referer URL checking based on issue reported in TD-4283
[AllowAnonymous]
[Route("ScormContent/{*filePath}")]
public async Task<IActionResult> ScormContent(string filePath)
Expand All @@ -79,12 +80,6 @@ public async Task<IActionResult> ScormContent(string filePath)

try
{
var referringUrl = this.Request.Headers["Referer"].ToString();
if (string.IsNullOrEmpty(referringUrl))
{
throw new UnauthorizedAccessException("Referer URL is required.");
}

if (!this.User.Identity.IsAuthenticated)
{
throw new UnauthorizedAccessException("User is not authenticated.");
Expand Down
8 changes: 6 additions & 2 deletions LearningHub.Nhs.WebUI/Controllers/SearchController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@ public async Task<IActionResult> RecordCatalogueNavigation(SearchRequestViewMode
/// <param name="timeOfSearch">time of search.</param>
/// <param name="userQuery">user query.</param>
/// <param name="query">search query.</param>
/// <param name="title">the title.</param>
[HttpGet("record-resource-click")]
public void RecordResourceClick(string url, int nodePathId, int itemIndex, int pageIndex, int totalNumberOfHits, string searchText, int resourceReferenceId, Guid groupId, string searchId, long timeOfSearch, string userQuery, string query)
public void RecordResourceClick(string url, int nodePathId, int itemIndex, int pageIndex, int totalNumberOfHits, string searchText, int resourceReferenceId, Guid groupId, string searchId, long timeOfSearch, string userQuery, string query, string title)
{
var searchActionResourceModel = new SearchActionResourceModel
{
Expand All @@ -230,6 +231,7 @@ public void RecordResourceClick(string url, int nodePathId, int itemIndex, int p
TimeOfSearch = timeOfSearch,
UserQuery = userQuery,
Query = query,
Title = title,
};

this.searchService.CreateResourceSearchActionAsync(searchActionResourceModel);
Expand All @@ -251,9 +253,10 @@ public void RecordResourceClick(string url, int nodePathId, int itemIndex, int p
/// <param name="timeOfSearch">time of search.</param>
/// <param name="userQuery">user query.</param>
/// <param name="query">search query.</param>
/// <param name="name">the name.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
[HttpGet("record-catalogue-click")]
public async Task<IActionResult> RecordCatalogueClick(string url, int nodePathId, int itemIndex, int pageIndex, int totalNumberOfHits, string searchText, int catalogueId, Guid groupId, string searchId, long timeOfSearch, string userQuery, string query)
public async Task<IActionResult> RecordCatalogueClick(string url, int nodePathId, int itemIndex, int pageIndex, int totalNumberOfHits, string searchText, int catalogueId, Guid groupId, string searchId, long timeOfSearch, string userQuery, string query, string name)
{
SearchActionCatalogueModel searchActionCatalogueModel = new SearchActionCatalogueModel
{
Expand All @@ -268,6 +271,7 @@ public async Task<IActionResult> RecordCatalogueClick(string url, int nodePathId
TimeOfSearch = timeOfSearch,
UserQuery = userQuery,
Query = query,
Name = name,
};

await this.searchService.CreateCatalogueSearchActionAsync(searchActionCatalogueModel);
Expand Down
2 changes: 1 addition & 1 deletion LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<PackageReference Include="HtmlAgilityPack" Version="1.11.38" />
<PackageReference Include="IdentityModel" Version="4.3.0" />
<PackageReference Include="LearningHub.Nhs.Caching" Version="2.0.0" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.38" />
<PackageReference Include="LearningHub.Nhs.Models" Version="3.0.40" />
<PackageReference Include="linqtotwitter" Version="6.9.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.19.0" />
<PackageReference Include="Microsoft.ApplicationInsights.EventCounterCollector" Version="2.21.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,21 @@

<div class="d-flex">
<div class="selection pr-50">
<div>Provide guidance for the learner at the end of this assessment.</div>
<EditSaveFieldWithCharacterCount
v-model="assessmentDetails.endGuidance.blocks[0].title"
addEditLabel="title"
v-bind:characterLimit="60"
v-bind:isH3="true" />
<ckeditorwithhint v-on:blur="setEndGuidance"
<div>Provide guidance for the learner at the end of this assessment. <i v-if="!IsVisible" class="warningTriangle fas fa-exclamation-triangle warm-yellow"></i></div>
<EditSaveFieldWithCharacterCount v-model="assessmentDetails.endGuidance.blocks[0].title"
addEditLabel="title"
v-bind:characterLimit="60"
v-bind:isH3="true" />
<ckeditorwithhint v-on:blur="setEndGuidance"
v-on:inputValidity="setGuidanceValidity"
:maxLength="1000"
:maxLength="1000"
:initialValue="endGuidance" />
</div>
<div class="tip">
<h3>Tip</h3>
You can offer guidance to the learner at the end of the assessment such as next steps or recommendations on other learning resources to try. </div>
</div>
<Button class="mt-5" color="green" v-on:click="isOpen = false" :disabled="!canSaveAll">Save settings</Button>
<Button class="mt-5" color="green" v-on:click="isOpen = false" :disabled="!IsVisible">Save settings</Button>
</div>
</div>
</v-card>
Expand Down Expand Up @@ -132,6 +131,7 @@
endGuidance: "",
initialGuidance: "",
guidanceValid: true,
IsVisible: false,
}
},
watch: {
Expand All @@ -140,7 +140,7 @@
{
this.assessmentDetails.endGuidance.addBlock(BlockTypeEnum.Text);
}
this.assessmentDetails.endGuidance.blocks[0].textBlock.content = this.endGuidance;
this.assessmentDetails.endGuidance.blocks[0].textBlock.content = this.endGuidance;
},
["assessmentDetails.passMark"](value){ this.assessmentDetails.passMark = this.capNumberFieldBy(value, 100)},
["assessmentDetails.maximumAttempts"](value){ this.assessmentDetails.maximumAttempts = this.capNumberFieldBy(value, 10)},
Expand All @@ -157,6 +157,14 @@
}

this.assessmentDetails.assessmentSettingsAreValid = settingsAreValid;

if (this.endGuidance != "") {
this.IsVisible = true;
}
else {
this.IsVisible = false;
}

return settingsAreValid;
},
},
Expand All @@ -170,9 +178,23 @@
{
this.endGuidance = description;
}

if (this.endGuidance != "") {
this.IsVisible = true;
}
else {
this.IsVisible = false;
}
},
setGuidanceValidity(valid: boolean) {
this.guidanceValid = valid;
if (this.endGuidance == "") {
this.guidanceValid = false;
this.IsVisible = false;
}
else {
this.guidanceValid = valid;
this.IsVisible = true;
}
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="row">
<div class="form-group" v-bind:class="{ 'input-validation-error': keywordError }">
<div class="col-12 mb-0 error-text" v-if="keywordError">
<span class="text-danger">This keyword has already been added.</span>
<span class="text-danger">The keyword(s) have already been added : {{formattedkeywordErrorMessage}}</span>
</div>
<div class="col-12 mb-0 error-text" v-if="keywordLengthExceeded">
<span class="text-danger">
Expand Down Expand Up @@ -60,6 +60,7 @@
newKeyword: '',
keywordError: false,
keywordLengthExceeded: false,
keywordErrorMessage: []
}
},
computed: {
Expand All @@ -69,19 +70,23 @@
newKeywordTrimmed(): string {
return this.newKeyword?.trim().replace(/ +(?= )/g, '').toLowerCase();
},
formattedkeywordErrorMessage(): string {
return this.keywordErrorMessage.join(', ');
},
},
methods: {
keywordChange() {
this.keywordError = false;
this.keywordLengthExceeded = false;
this.keywordErrorMessage = [];
},
async addKeyword() {
if (this.newKeyword && this.newKeywordTrimmed.length > 0) {
this.keywordChange();
let allTrimmedKeyword = this.newKeywordTrimmed.toLowerCase().split(',');
allTrimmedKeyword = allTrimmedKeyword.filter(e => String(e).trim());
if (!this.resourceDetails.resourceKeywords.find(_keyword => allTrimmedKeyword.includes(_keyword.keyword.toLowerCase()))) {
for (var i = 0; i < allTrimmedKeyword.length; i++) {
let item = allTrimmedKeyword[i];
let item = allTrimmedKeyword[i].trim();
if (item.length > 0 && item.length <= 50) {
let newKeywordObj = new KeywordModel({
keyword: item,
Expand All @@ -90,8 +95,11 @@
newKeywordObj = await resourceData.addKeyword(this.resourceVersionId, newKeywordObj);
if (newKeywordObj.id > 0) {
this.resourceDetails.resourceKeywords.push(newKeywordObj);
this.keywordError = false;
this.newKeyword = '';
} else if (newKeywordObj.id == 0) {
this.newKeyword = '';
this.keywordError = true;
this.keywordErrorMessage.push(item);
}
else {
this.keywordError = true;
Expand All @@ -103,10 +111,6 @@
this.keywordLengthExceeded = true;
}
}
}
else {
this.keywordError = true;
}
}
},
async deleteKeyword(keywordId: number) {
Expand Down
25 changes: 15 additions & 10 deletions LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<div class="row">
<div class="form-group" v-bind:class="{ 'input-validation-error': keywordError }">
<div class="col-12 mb-0 error-text" v-if="keywordError">
<span class="text-danger">This keyword has already been added.</span>
<span class="text-danger">The keyword(s) have already been added : {{formattedkeywordErrorMessage}}</span>
</div>
<div class="col-12 mb-0 error-text" v-if="keywordLengthExceeded">
<span class="text-danger">
Expand Down Expand Up @@ -292,6 +292,7 @@
ResourceType,
resourceProviderId: null,
keywordLengthExceeded: false,
keywordErrorMessage:[]
};
},
computed: {
Expand Down Expand Up @@ -340,6 +341,9 @@
return this.$store.state.userProviders.length > 0;
}
},
formattedkeywordErrorMessage(): string {
return this.keywordErrorMessage.join(', ');
},
},
created() {
this.setInitialValues();
Expand Down Expand Up @@ -485,6 +489,7 @@
keywordChange() {
this.keywordError = false;
this.keywordLengthExceeded = false;
this.keywordErrorMessage = [];
},
resetSelectedLicence() {
this.resourceLicenceId = 0;
Expand Down Expand Up @@ -532,11 +537,11 @@
},
async addKeyword() {
if (this.newKeyword && this.newKeywordTrimmed.length > 0) {
this.keywordChange();
let allTrimmedKeyword = this.newKeywordTrimmed.toLowerCase().split(',');
allTrimmedKeyword = allTrimmedKeyword.filter(e => String(e).trim());
if (!this.keywords.find(_keyword => allTrimmedKeyword.includes(_keyword.keyword.toLowerCase()))) {
for (var i = 0; i < allTrimmedKeyword.length; i++) {
let item = allTrimmedKeyword[i];
let item = allTrimmedKeyword[i].trim();
if (item.length > 0 && item.length <= 50) {
let newkeywordObj = new KeywordModel();
newkeywordObj.keyword = item;
Expand All @@ -548,22 +553,22 @@
if (this.resourceDetail.resourceVersionId == 0) {
this.$store.commit('setResourceVersionId', newkeywordObj.resourceVersionId)
}
this.keywordError = false;
this.newKeyword = '';
} else {
} else if (newkeywordObj.id == 0) {
this.newKeyword = '';
this.keywordError = true;
break;
this.keywordErrorMessage.push(item);
}
else {
this.keywordError = true;
break;
}
}
else {
this.keywordLengthExceeded = true;
break;
}
}
}
else {
this.keywordError = true;
}
}
else {
this.newKeyword = '';
Expand Down
Loading
Loading