Skip to content

Commit

Permalink
WEBUI-1504: Tags fix mixed case entry
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuljain-dev committed Oct 14, 2024
1 parent 39183d1 commit 296234e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ui/widgets/nuxeo-selectivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -2422,9 +2422,6 @@ typedArrayTags[weakMapTag] = false;
* term - The search term for which the results are displayed.
*/
showResults(results, options) {
if(options && options.term){
options.term = options.term.toLowerCase();
}
const searchText = options && options.term && options.term.trim();
if (options.add) {
removeElement(this.$('.selectivity-loading'));
Expand All @@ -2438,11 +2435,12 @@ typedArrayTags[weakMapTag] = false;
let resultsHtml = isFilteredResultNotEmpty ? this.renderItems(filteredResults) : '';
if (options.hasMore) {
resultsHtml += this.selectivity.template('loadMore');
} else if (value && Array.isArray(value) && value.includes(options.term)) {
} else if (value && Array.isArray(value) && value.includes(options.term.toLowerCase())) {
resultsHtml = this.selectivity.template('tagExists');
} else if (!resultsHtml && !options.add) {
resultsHtml = this.selectivity.template('noResults', { term: options.term });
}
}

if (resultsHtml) {
this.resultsContainer.innerHTML = '';
removeElement(this.$('.selectivity-loading'));
Expand Down Expand Up @@ -7196,7 +7194,6 @@ typedArrayTags[weakMapTag] = false;
}

options.query = (query) => {
query.term= query.term.toLowerCase();
if (query.term.length < this.minChars) {
query.error(this.i18n('selectivity.minChars', this.minChars));
return;
Expand Down
1 change: 1 addition & 0 deletions ui/widgets/nuxeo-tag-suggestion.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ import { escapeHTML } from './nuxeo-selectivity.js';
}

_newEntryFormatter(term) {
term = term.toLowerCase();
return { id: term, displayLabel: term, newTag: true };
}

Expand Down

0 comments on commit 296234e

Please sign in to comment.