Skip to content

Commit 54eccb5

Browse files
committed
TD-4432: Issue with the 'Keywords' when given in upper case changed to lowercase letters on Contributing resources screens
1 parent 13c99d5 commit 54eccb5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute-resource/components/KeyWordsEditor.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
return this.resourceDetails.resourceVersionId;
6868
},
6969
newKeywordTrimmed(): string {
70-
return this.newKeyword?.trim().replace(/ +(?= )/g, '').toLowerCase();
70+
return this.newKeyword?.trim().replace(/ +(?= )/g, '');
7171
},
7272
},
7373
methods: {
@@ -77,9 +77,9 @@
7777
},
7878
async addKeyword() {
7979
if (this.newKeyword && this.newKeywordTrimmed.length > 0) {
80-
let allTrimmedKeyword = this.newKeywordTrimmed.toLowerCase().split(',');
80+
let allTrimmedKeyword = this.newKeywordTrimmed.split(',');
8181
allTrimmedKeyword = allTrimmedKeyword.filter(e => String(e).trim());
82-
if (!this.resourceDetails.resourceKeywords.find(_keyword => allTrimmedKeyword.includes(_keyword.keyword.toLowerCase()))) {
82+
if (!this.resourceDetails.resourceKeywords.find(_keyword => allTrimmedKeyword.includes(_keyword.keyword))) {
8383
for (var i = 0; i < allTrimmedKeyword.length; i++) {
8484
let item = allTrimmedKeyword[i];
8585
if (item.length > 0 && item.length <= 50) {

LearningHub.Nhs.WebUI/Scripts/vuesrc/contribute/ContentCommon.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331
!Boolean(this.$route.query.initialCreate); // or if the user is editing an existing draft (initialCreate=false)
332332
},
333333
newKeywordTrimmed(): string {
334-
return this.newKeyword?.trim().replace(/ +(?= )/g, '').toLowerCase();
334+
return this.newKeyword?.trim().replace(/ +(?= )/g, '');
335335
},
336336
showProviders(): boolean {
337337
if (!this.$store.state.userProviders) {
@@ -393,7 +393,7 @@
393393
this.keywords = this.resourceDetail.resourceKeywords.map(obj => {
394394
let kw = new KeywordModel();
395395
kw.id = obj.id;
396-
kw.keyword = obj.keyword.toLowerCase();
396+
kw.keyword = obj.keyword;
397397
return kw;
398398
});
399399
if (this.resourceDetail.resourceProviderId > 0) {
@@ -532,9 +532,9 @@
532532
},
533533
async addKeyword() {
534534
if (this.newKeyword && this.newKeywordTrimmed.length > 0) {
535-
let allTrimmedKeyword = this.newKeywordTrimmed.toLowerCase().split(',');
535+
let allTrimmedKeyword = this.newKeywordTrimmed.split(',');
536536
allTrimmedKeyword = allTrimmedKeyword.filter(e => String(e).trim());
537-
if (!this.keywords.find(_keyword => allTrimmedKeyword.includes(_keyword.keyword.toLowerCase()))) {
537+
if (!this.keywords.find(_keyword => allTrimmedKeyword.includes(_keyword.keyword))) {
538538
for (var i = 0; i < allTrimmedKeyword.length; i++) {
539539
let item = allTrimmedKeyword[i];
540540
if (item.length > 0 && item.length <= 50) {

0 commit comments

Comments
 (0)