Commit 6147fdcd authored by Mark Florian's avatar Mark Florian

Merge branch 'lm-replace-random-underscores' into 'master'

Replace underscore with lodash

See merge request gitlab-org/gitlab!29619
parents 90a74188 2befa73d
/* eslint-disable class-methods-use-this, @gitlab/require-i18n-strings */ /* eslint-disable class-methods-use-this, @gitlab/require-i18n-strings */
import $ from 'jquery'; import $ from 'jquery';
import _ from 'underscore'; import { uniq } from 'lodash';
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { __ } from './locale'; import { __ } from './locale';
...@@ -513,7 +513,7 @@ export class AwardsHandler { ...@@ -513,7 +513,7 @@ export class AwardsHandler {
addEmojiToFrequentlyUsedList(emoji) { addEmojiToFrequentlyUsedList(emoji) {
if (this.emoji.isEmojiNameValid(emoji)) { if (this.emoji.isEmojiNameValid(emoji)) {
this.frequentlyUsedEmojis = _.uniq(this.getFrequentlyUsedEmojis().concat(emoji)); this.frequentlyUsedEmojis = uniq(this.getFrequentlyUsedEmojis().concat(emoji));
Cookies.set('frequently_used_emojis', this.frequentlyUsedEmojis.join(','), { expires: 365 }); Cookies.set('frequently_used_emojis', this.frequentlyUsedEmojis.join(','), { expires: 365 });
} }
} }
...@@ -522,9 +522,7 @@ export class AwardsHandler { ...@@ -522,9 +522,7 @@ export class AwardsHandler {
return ( return (
this.frequentlyUsedEmojis || this.frequentlyUsedEmojis ||
(() => { (() => {
const frequentlyUsedEmojis = _.uniq( const frequentlyUsedEmojis = uniq((Cookies.get('frequently_used_emojis') || '').split(','));
(Cookies.get('frequently_used_emojis') || '').split(','),
);
this.frequentlyUsedEmojis = frequentlyUsedEmojis.filter(inputName => this.frequentlyUsedEmojis = frequentlyUsedEmojis.filter(inputName =>
this.emoji.isEmojiNameValid(inputName), this.emoji.isEmojiNameValid(inputName),
); );
......
import $ from 'jquery'; import $ from 'jquery';
import Dropzone from 'dropzone'; import Dropzone from 'dropzone';
import _ from 'underscore'; import { escape as esc } from 'lodash';
import './behaviors/preview_markdown'; import './behaviors/preview_markdown';
import PasteMarkdownTable from './behaviors/markdown/paste_markdown_table'; import PasteMarkdownTable from './behaviors/markdown/paste_markdown_table';
import csrf from './lib/utils/csrf'; import csrf from './lib/utils/csrf';
...@@ -16,7 +16,7 @@ Dropzone.autoDiscover = false; ...@@ -16,7 +16,7 @@ Dropzone.autoDiscover = false;
* @param {String|Object} res * @param {String|Object} res
*/ */
function getErrorMessage(res) { function getErrorMessage(res) {
if (!res || _.isString(res)) { if (!res || typeof res === 'string') {
return res; return res;
} }
...@@ -233,7 +233,7 @@ export default function dropzoneInput(form, config = { parallelUploads: 2 }) { ...@@ -233,7 +233,7 @@ export default function dropzoneInput(form, config = { parallelUploads: 2 }) {
}; };
addFileToForm = path => { addFileToForm = path => {
$(form).append(`<input type="hidden" name="files[]" value="${_.escape(path)}">`); $(form).append(`<input type="hidden" name="files[]" value="${esc(path)}">`);
}; };
const showSpinner = () => $uploadingProgressContainer.removeClass('hide'); const showSpinner = () => $uploadingProgressContainer.removeClass('hide');
......
import _ from 'underscore'; import { escape as esc } from 'lodash';
import { spriteIcon } from './lib/utils/common_utils'; import { spriteIcon } from './lib/utils/common_utils';
const FLASH_TYPES = { const FLASH_TYPES = {
...@@ -39,14 +39,14 @@ const createAction = config => ` ...@@ -39,14 +39,14 @@ const createAction = config => `
class="flash-action" class="flash-action"
${config.href ? '' : 'role="button"'} ${config.href ? '' : 'role="button"'}
> >
${_.escape(config.title)} ${esc(config.title)}
</a> </a>
`; `;
const createFlashEl = (message, type) => ` const createFlashEl = (message, type) => `
<div class="flash-${type}"> <div class="flash-${type}">
<div class="flash-text"> <div class="flash-text">
${_.escape(message)} ${esc(message)}
<div class="close-icon-wrapper js-close-icon"> <div class="close-icon-wrapper js-close-icon">
${spriteIcon('close', 'close-icon')} ${spriteIcon('close', 'close-icon')}
</div> </div>
......
import $ from 'jquery'; import $ from 'jquery';
import '@gitlab/at.js'; import '@gitlab/at.js';
import _ from 'underscore'; import { escape as esc, template } from 'lodash';
import SidebarMediator from '~/sidebar/sidebar_mediator'; import SidebarMediator from '~/sidebar/sidebar_mediator';
import glRegexp from './lib/utils/regexp'; import glRegexp from './lib/utils/regexp';
import AjaxCache from './lib/utils/ajax_cache'; import AjaxCache from './lib/utils/ajax_cache';
import { spriteIcon } from './lib/utils/common_utils'; import { spriteIcon } from './lib/utils/common_utils';
import _ from 'underscore';
function sanitize(str) { function sanitize(str) {
return str.replace(/<(?:.|\n)*?>/gm, ''); return str.replace(/<(?:.|\n)*?>/gm, '');
} }
export function membersBeforeSave(members) { export function membersBeforeSave(members) {
return _.map(members, member => { return members.map(member => {
const GROUP_TYPE = 'Group'; const GROUP_TYPE = 'Group';
let title = ''; let title = '';
...@@ -122,7 +123,7 @@ class GfmAutoComplete { ...@@ -122,7 +123,7 @@ class GfmAutoComplete {
cssClasses.push('has-warning'); cssClasses.push('has-warning');
} }
return _.template(tpl)({ return template(tpl)({
...value, ...value,
className: cssClasses.join(' '), className: cssClasses.join(' '),
}); });
...@@ -692,14 +693,14 @@ GfmAutoComplete.Emoji = { ...@@ -692,14 +693,14 @@ GfmAutoComplete.Emoji = {
// Team Members // Team Members
GfmAutoComplete.Members = { GfmAutoComplete.Members = {
templateFunction({ avatarTag, username, title, icon }) { templateFunction({ avatarTag, username, title, icon }) {
return `<li>${avatarTag} ${username} <small>${_.escape(title)}</small> ${icon}</li>`; return `<li>${avatarTag} ${username} <small>${esc(title)}</small> ${icon}</li>`;
}, },
}; };
GfmAutoComplete.Labels = { GfmAutoComplete.Labels = {
templateFunction(color, title) { templateFunction(color, title) {
return `<li><span class="dropdown-label-box" style="background: ${_.escape( return `<li><span class="dropdown-label-box" style="background: ${esc(color)}"></span> ${esc(
color, title,
)}"></span> ${_.escape(title)}</li>`; )}</li>`;
}, },
}; };
// Issues, MergeRequests and Snippets // Issues, MergeRequests and Snippets
...@@ -709,13 +710,13 @@ GfmAutoComplete.Issues = { ...@@ -709,13 +710,13 @@ GfmAutoComplete.Issues = {
return value.reference || '${atwho-at}${id}'; return value.reference || '${atwho-at}${id}';
}, },
templateFunction({ id, title, reference }) { templateFunction({ id, title, reference }) {
return `<li><small>${reference || id}</small> ${_.escape(title)}</li>`; return `<li><small>${reference || id}</small> ${esc(title)}</li>`;
}, },
}; };
// Milestones // Milestones
GfmAutoComplete.Milestones = { GfmAutoComplete.Milestones = {
templateFunction(title) { templateFunction(title) {
return `<li>${_.escape(title)}</li>`; return `<li>${esc(title)}</li>`;
}, },
}; };
GfmAutoComplete.Loading = { GfmAutoComplete.Loading = {
......
import $ from 'jquery'; import $ from 'jquery';
import _ from 'underscore'; import { escape as esc } from 'lodash';
import { __, sprintf } from './locale'; import { __, sprintf } from './locale';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
import flash from './flash'; import flash from './flash';
...@@ -73,9 +73,9 @@ class ImporterStatus { ...@@ -73,9 +73,9 @@ class ImporterStatus {
const connectingVerb = this.ciCdOnly ? __('connecting') : __('importing'); const connectingVerb = this.ciCdOnly ? __('connecting') : __('importing');
job.find('.import-actions').html( job.find('.import-actions').html(
sprintf( sprintf(
_.escape(__('%{loadingIcon} Started')), esc(__('%{loadingIcon} Started')),
{ {
loadingIcon: `<i class="fa fa-spinner fa-spin" aria-label="${_.escape( loadingIcon: `<i class="fa fa-spinner fa-spin" aria-label="${esc(
connectingVerb, connectingVerb,
)}"></i>`, )}"></i>`,
}, },
......
/* eslint-disable class-methods-use-this, no-new */ /* eslint-disable class-methods-use-this, no-new */
import $ from 'jquery'; import $ from 'jquery';
import { property } from 'underscore'; import { property } from 'lodash';
import IssuableBulkUpdateActions from './issuable_bulk_update_actions'; import IssuableBulkUpdateActions from './issuable_bulk_update_actions';
import MilestoneSelect from './milestone_select'; import MilestoneSelect from './milestone_select';
import issueStatusSelect from './issue_status_select'; import issueStatusSelect from './issue_status_select';
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* global ListLabel */ /* global ListLabel */
import $ from 'jquery'; import $ from 'jquery';
import _ from 'underscore'; import { isEqual, escape as esc, sortBy, template } from 'lodash';
import { sprintf, s__, __ } from './locale'; import { sprintf, s__, __ } from './locale';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
import IssuableBulkUpdateActions from './issuable_bulk_update_actions'; import IssuableBulkUpdateActions from './issuable_bulk_update_actions';
...@@ -76,7 +76,7 @@ export default class LabelsSelect { ...@@ -76,7 +76,7 @@ export default class LabelsSelect {
}) })
.get(); .get();
if (_.isEqual(initialSelected, selected)) return; if (isEqual(initialSelected, selected)) return;
initialSelected = selected; initialSelected = selected;
const data = {}; const data = {};
...@@ -101,7 +101,7 @@ export default class LabelsSelect { ...@@ -101,7 +101,7 @@ export default class LabelsSelect {
let labelCount = 0; let labelCount = 0;
if (data.labels.length && issueUpdateURL) { if (data.labels.length && issueUpdateURL) {
template = LabelsSelect.getLabelTemplate({ template = LabelsSelect.getLabelTemplate({
labels: _.sortBy(data.labels, 'title'), labels: sortBy(data.labels, 'title'),
issueUpdateURL, issueUpdateURL,
enableScopedLabels: scopedLabels, enableScopedLabels: scopedLabels,
scopedLabelsDocumentationLink, scopedLabelsDocumentationLink,
...@@ -269,7 +269,7 @@ export default class LabelsSelect { ...@@ -269,7 +269,7 @@ export default class LabelsSelect {
} }
linkEl.className = selectedClass.join(' '); linkEl.className = selectedClass.join(' ');
linkEl.innerHTML = `${colorEl} ${_.escape(label.title)}`; linkEl.innerHTML = `${colorEl} ${esc(label.title)}`;
const listItemEl = document.createElement('li'); const listItemEl = document.createElement('li');
listItemEl.appendChild(linkEl); listItemEl.appendChild(linkEl);
...@@ -436,7 +436,7 @@ export default class LabelsSelect { ...@@ -436,7 +436,7 @@ export default class LabelsSelect {
if (isScopedLabel(label)) { if (isScopedLabel(label)) {
const prevIds = oldLabels.map(label => label.id); const prevIds = oldLabels.map(label => label.id);
const newIds = boardsStore.detail.issue.labels.map(label => label.id); const newIds = boardsStore.detail.issue.labels.map(label => label.id);
const differentIds = _.difference(prevIds, newIds); const differentIds = prevIds.filter(x => !newIds.includes(x));
$dropdown.data('marked', newIds); $dropdown.data('marked', newIds);
$dropdownMenu $dropdownMenu
.find(differentIds.map(id => `[data-label-id="${id}"]`).join(',')) .find(differentIds.map(id => `[data-label-id="${id}"]`).join(','))
...@@ -483,7 +483,7 @@ export default class LabelsSelect { ...@@ -483,7 +483,7 @@ export default class LabelsSelect {
'<a href="<%- issueUpdateURL.slice(0, issueUpdateURL.lastIndexOf("/")) %>?label_name[]=<%- encodeURIComponent(label.title) %>" class="gl-link gl-label-link has-tooltip" <%= linkAttrs %> title="<%= tooltipTitleTemplate({ label, isScopedLabel, enableScopedLabels, escapeStr }) %>">'; '<a href="<%- issueUpdateURL.slice(0, issueUpdateURL.lastIndexOf("/")) %>?label_name[]=<%- encodeURIComponent(label.title) %>" class="gl-link gl-label-link has-tooltip" <%= linkAttrs %> title="<%= tooltipTitleTemplate({ label, isScopedLabel, enableScopedLabels, escapeStr }) %>">';
const spanOpenTag = const spanOpenTag =
'<span class="gl-label-text" style="background-color: <%= escapeStr(label.color) %>; color: <%= escapeStr(label.text_color) %>;">'; '<span class="gl-label-text" style="background-color: <%= escapeStr(label.color) %>; color: <%= escapeStr(label.text_color) %>;">';
const labelTemplate = _.template( const labelTemplate = template(
[ [
'<span class="gl-label">', '<span class="gl-label">',
linkOpenTag, linkOpenTag,
...@@ -499,7 +499,7 @@ export default class LabelsSelect { ...@@ -499,7 +499,7 @@ export default class LabelsSelect {
return escapeStr(label.text_color === '#FFFFFF' ? label.color : label.text_color); return escapeStr(label.text_color === '#FFFFFF' ? label.color : label.text_color);
}; };
const infoIconTemplate = _.template( const infoIconTemplate = template(
[ [
'<a href="<%= scopedLabelsDocumentationLink %>" class="gl-link gl-label-icon" target="_blank" rel="noopener">', '<a href="<%= scopedLabelsDocumentationLink %>" class="gl-link gl-label-icon" target="_blank" rel="noopener">',
'<i class="fa fa-question-circle"></i>', '<i class="fa fa-question-circle"></i>',
...@@ -507,7 +507,7 @@ export default class LabelsSelect { ...@@ -507,7 +507,7 @@ export default class LabelsSelect {
].join(''), ].join(''),
); );
const scopedLabelTemplate = _.template( const scopedLabelTemplate = template(
[ [
'<span class="gl-label gl-label-scoped" style="color: <%= escapeStr(label.color) %>;">', '<span class="gl-label gl-label-scoped" style="color: <%= escapeStr(label.color) %>;">',
linkOpenTag, linkOpenTag,
...@@ -523,7 +523,7 @@ export default class LabelsSelect { ...@@ -523,7 +523,7 @@ export default class LabelsSelect {
].join(''), ].join(''),
); );
const tooltipTitleTemplate = _.template( const tooltipTitleTemplate = template(
[ [
'<% if (isScopedLabel(label) && enableScopedLabels) { %>', '<% if (isScopedLabel(label) && enableScopedLabels) { %>',
"<span class='font-weight-bold scoped-label-tooltip-title'>Scoped label</span>", "<span class='font-weight-bold scoped-label-tooltip-title'>Scoped label</span>",
...@@ -535,9 +535,9 @@ export default class LabelsSelect { ...@@ -535,9 +535,9 @@ export default class LabelsSelect {
].join(''), ].join(''),
); );
const tpl = _.template( const tpl = template(
[ [
'<% _.each(labels, function(label){ %>', '<% labels.forEach(function(label){ %>',
'<% if (isScopedLabel(label) && enableScopedLabels) { %>', '<% if (isScopedLabel(label) && enableScopedLabels) { %>',
'<span class="d-inline-block position-relative scoped-label-wrapper">', '<span class="d-inline-block position-relative scoped-label-wrapper">',
'<%= scopedLabelTemplate({ label, issueUpdateURL, isScopedLabel, enableScopedLabels, rightLabelTextColor, infoIconTemplate, scopedLabelsDocumentationLink, tooltipTitleTemplate, escapeStr, linkAttrs: \'data-html="true"\' }) %>', '<%= scopedLabelTemplate({ label, issueUpdateURL, isScopedLabel, enableScopedLabels, rightLabelTextColor, infoIconTemplate, scopedLabelsDocumentationLink, tooltipTitleTemplate, escapeStr, linkAttrs: \'data-html="true"\' }) %>',
...@@ -557,7 +557,7 @@ export default class LabelsSelect { ...@@ -557,7 +557,7 @@ export default class LabelsSelect {
scopedLabelTemplate, scopedLabelTemplate,
tooltipTitleTemplate, tooltipTitleTemplate,
isScopedLabel, isScopedLabel,
escapeStr: _.escape, escapeStr: esc,
}); });
} }
......
...@@ -5,7 +5,7 @@ import { escape } from 'lodash'; ...@@ -5,7 +5,7 @@ import { escape } from 'lodash';
@param input (translated) text with parameters (e.g. '%{num_users} users use us') @param input (translated) text with parameters (e.g. '%{num_users} users use us')
@param {Object} parameters object mapping parameter names to values (e.g. { num_users: 5 }) @param {Object} parameters object mapping parameter names to values (e.g. { num_users: 5 })
@param {Boolean} escapeParameters whether parameter values should be escaped (see http://underscorejs.org/#escape) @param {Boolean} escapeParameters whether parameter values should be escaped (see https://lodash.com/docs/4.17.15#escape)
@returns {String} the text with parameters replaces (e.g. '5 users use us') @returns {String} the text with parameters replaces (e.g. '5 users use us')
@see https://ruby-doc.org/core-2.3.3/Kernel.html#method-i-sprintf @see https://ruby-doc.org/core-2.3.3/Kernel.html#method-i-sprintf
......
/* eslint-disable func-names, consistent-return, no-param-reassign */ /* eslint-disable func-names, consistent-return, no-param-reassign */
import $ from 'jquery'; import $ from 'jquery';
import _ from 'underscore';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import flash from './flash'; import flash from './flash';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
...@@ -142,7 +141,7 @@ Sidebar.prototype.sidebarCollapseClicked = function(e) { ...@@ -142,7 +141,7 @@ Sidebar.prototype.sidebarCollapseClicked = function(e) {
}; };
Sidebar.prototype.openDropdown = function(blockOrName) { Sidebar.prototype.openDropdown = function(blockOrName) {
const $block = _.isString(blockOrName) ? this.getBlock(blockOrName) : blockOrName; const $block = typeof blockOrName === 'string' ? this.getBlock(blockOrName) : blockOrName;
if (!this.isOpen()) { if (!this.isOpen()) {
this.setCollapseAfterUpdate($block); this.setCollapseAfterUpdate($block);
this.toggleSidebar('open'); this.toggleSidebar('open');
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* global emitSidebarEvent */ /* global emitSidebarEvent */
import $ from 'jquery'; import $ from 'jquery';
import _ from 'underscore'; import { escape as esc, template, uniqBy } from 'lodash';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
import { s__, __, sprintf } from './locale'; import { s__, __, sprintf } from './locale';
import ModalStore from './boards/stores/modal_store'; import ModalStore from './boards/stores/modal_store';
...@@ -81,7 +81,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -81,7 +81,7 @@ function UsersSelect(currentUser, els, options = {}) {
const userName = currentUserInfo.name; const userName = currentUserInfo.name;
const userId = currentUserInfo.id || currentUser.id; const userId = currentUserInfo.id || currentUser.id;
const inputHtmlString = _.template(` const inputHtmlString = template(`
<input type="hidden" name="<%- fieldName %>" <input type="hidden" name="<%- fieldName %>"
data-meta="<%- userName %>" data-meta="<%- userName %>"
value="<%- userId %>" /> value="<%- userId %>" />
...@@ -205,7 +205,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -205,7 +205,7 @@ function UsersSelect(currentUser, els, options = {}) {
username: data.assignee.username, username: data.assignee.username,
avatar: data.assignee.avatar_url, avatar: data.assignee.avatar_url,
}; };
tooltipTitle = _.escape(user.name); tooltipTitle = esc(user.name);
} else { } else {
user = { user = {
name: s__('UsersSelect|Unassigned'), name: s__('UsersSelect|Unassigned'),
...@@ -219,10 +219,10 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -219,10 +219,10 @@ function UsersSelect(currentUser, els, options = {}) {
return $collapsedSidebar.html(collapsedAssigneeTemplate(user)); return $collapsedSidebar.html(collapsedAssigneeTemplate(user));
}); });
}; };
collapsedAssigneeTemplate = _.template( collapsedAssigneeTemplate = template(
'<% if( avatar ) { %> <a class="author-link" href="/<%- username %>"> <img width="24" class="avatar avatar-inline s24" alt="" src="<%- avatar %>"> </a> <% } else { %> <i class="fa fa-user"></i> <% } %>', '<% if( avatar ) { %> <a class="author-link" href="/<%- username %>"> <img width="24" class="avatar avatar-inline s24" alt="" src="<%- avatar %>"> </a> <% } else { %> <i class="fa fa-user"></i> <% } %>',
); );
assigneeTemplate = _.template( assigneeTemplate = template(
`<% if (username) { %> <a class="author-link bold" href="/<%- username %>"> <% if( avatar ) { %> <img width="32" class="avatar avatar-inline s32" alt="" src="<%- avatar %>"> <% } %> <span class="author"><%- name %></span> <span class="username"> @<%- username %> </span> </a> <% } else { %> <span class="no-value assign-yourself"> `<% if (username) { %> <a class="author-link bold" href="/<%- username %>"> <% if( avatar ) { %> <img width="32" class="avatar avatar-inline s32" alt="" src="<%- avatar %>"> <% } %> <span class="author"><%- name %></span> <span class="username"> @<%- username %> </span> </a> <% } else { %> <span class="no-value assign-yourself">
${sprintf(s__('UsersSelect|No assignee - %{openingTag} assign yourself %{closingTag}'), { ${sprintf(s__('UsersSelect|No assignee - %{openingTag} assign yourself %{closingTag}'), {
openingTag: '<a href="#" class="js-assign-yourself">', openingTag: '<a href="#" class="js-assign-yourself">',
...@@ -248,7 +248,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -248,7 +248,7 @@ function UsersSelect(currentUser, els, options = {}) {
// Potential duplicate entries when dealing with issue board // Potential duplicate entries when dealing with issue board
// because issue board is also managed by vue // because issue board is also managed by vue
const selectedUsers = _.uniq(selectedInputs, false, a => a.value) const selectedUsers = uniqBy(selectedInputs, a => a.value)
.filter(input => { .filter(input => {
const userId = parseInt(input.value, 10); const userId = parseInt(input.value, 10);
const inUsersArray = users.find(u => u.id === userId); const inUsersArray = users.find(u => u.id === userId);
...@@ -543,7 +543,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -543,7 +543,7 @@ function UsersSelect(currentUser, els, options = {}) {
let img = ''; let img = '';
if (user.beforeDivider != null) { if (user.beforeDivider != null) {
`<li><a href='#' class='${selected === true ? 'is-active' : ''}'>${_.escape( `<li><a href='#' class='${selected === true ? 'is-active' : ''}'>${esc(
user.name, user.name,
)}</a></li>`; )}</a></li>`;
} else { } else {
...@@ -672,10 +672,10 @@ UsersSelect.prototype.formatResult = function(user) { ...@@ -672,10 +672,10 @@ UsersSelect.prototype.formatResult = function(user) {
</div> </div>
<div class='user-info'> <div class='user-info'>
<div class='user-name dropdown-menu-user-full-name'> <div class='user-name dropdown-menu-user-full-name'>
${_.escape(user.name)} ${esc(user.name)}
</div> </div>
<div class='user-username dropdown-menu-user-username text-secondary'> <div class='user-username dropdown-menu-user-username text-secondary'>
${!user.invite ? `@${_.escape(user.username)}` : ''} ${!user.invite ? `@${esc(user.username)}` : ''}
</div> </div>
</div> </div>
</div> </div>
...@@ -683,7 +683,7 @@ UsersSelect.prototype.formatResult = function(user) { ...@@ -683,7 +683,7 @@ UsersSelect.prototype.formatResult = function(user) {
}; };
UsersSelect.prototype.formatSelection = function(user) { UsersSelect.prototype.formatSelection = function(user) {
return _.escape(user.name); return esc(user.name);
}; };
UsersSelect.prototype.user = function(user_id, callback) { UsersSelect.prototype.user = function(user_id, callback) {
...@@ -746,7 +746,7 @@ UsersSelect.prototype.renderRow = function(issuableType, user, selected, usernam ...@@ -746,7 +746,7 @@ UsersSelect.prototype.renderRow = function(issuableType, user, selected, usernam
${this.renderRowAvatar(issuableType, user, img)} ${this.renderRowAvatar(issuableType, user, img)}
<span class="d-flex flex-column overflow-hidden"> <span class="d-flex flex-column overflow-hidden">
<strong class="dropdown-menu-user-full-name"> <strong class="dropdown-menu-user-full-name">
${_.escape(user.name)} ${esc(user.name)}
</strong> </strong>
${username ? `<span class="dropdown-menu-user-username">${username}</span>` : ''} ${username ? `<span class="dropdown-menu-user-username">${username}</span>` : ''}
</span> </span>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment