Fix escaping for protocol keyword [SCI-8137] (#5147)

This commit is contained in:
aignatov-bio 2023-03-15 16:04:33 +01:00 committed by GitHub
parent 483a7aad5b
commit fedd9e040e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,7 +128,7 @@ var dropdownSelector = (function() {
function refreshDropdownSelection(selector, container) {
container.find('.dropdown-option, .dropdown-group').removeClass('select');
$.each(getCurrentData(container), function(i, selectedOption) {
container.find(`.dropdown-option[data-value="${selectedOption.value}"][data-group="${selectedOption.group || ''}"]`)
container.find(`.dropdown-option[data-value="${_.escape(selectedOption.value)}"][data-group="${selectedOption.group || ''}"]`)
.addClass('select');
});
if (selector.data('select-by-group')) {
@ -736,14 +736,16 @@ var dropdownSelector = (function() {
var title = (data.params && data.params.tooltip) || $('<span>' + label + '</span>').text().trim();
// Add new tag before search field
var tag = $(`<div class="${tagAppearance} ${customClass}" style="${customStyle ? customStyle(data) : ''}" >
<div class="tag-label"
data-ds-tag-group="${data.group}"
data-ds-tag-id="${data.value}">
<div class="tag-label">
</div>
<i class="fas fa-times ${selector.data('config').singleSelect ? 'hidden' : ''}"></i>
</div>`).insertBefore(container.find('.input-field .search-field'));
tag.find('.tag-label').attr('title', title);
tag.find('.tag-label')
.attr('data-ds-tag-group', data.group)
.attr('data-ds-tag-id', data.value)
.attr('title', title);
if (selector.data('config').labelHTML) {
tag.find('.tag-label').html(label);
} else {