Skip to content
Snippets Groups Projects
Commit d2798d60 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent d8211a0e
No related branches found
No related tags found
No related merge requests found
Showing
with 66 additions and 132 deletions
/* eslint-disable class-methods-use-this, no-unused-vars */
/* eslint-disable class-methods-use-this */
 
import $ from 'jquery';
 
Loading
Loading
@@ -61,7 +61,7 @@ export default class TemplateSelector {
return this.requestFile(item);
}
 
requestFile(item) {
requestFile() {
// This `requestFile` method is an abstract method that should
// be added by all subclasses.
}
Loading
Loading
/* eslint-disable func-names, no-var, prefer-arrow-callback, no-else-return, consistent-return, prefer-template, one-var, no-unused-vars, no-return-assign, no-unused-expressions, no-sequences */
/* eslint-disable func-names, no-var, prefer-arrow-callback, no-else-return, consistent-return, prefer-template, one-var, no-return-assign, no-unused-expressions, no-sequences */
 
import $ from 'jquery';
 
Loading
Loading
@@ -12,11 +12,8 @@ export default class ImageFile {
this.requestImageInfo(
$('.two-up.view .frame.deleted img', this.file),
(function(_this) {
return function(deletedWidth, deletedHeight) {
return _this.requestImageInfo($('.two-up.view .frame.added img', _this.file), function(
width,
height,
) {
return function() {
return _this.requestImageInfo($('.two-up.view .frame.added img', _this.file), function() {
_this.initViewModes();
 
// Load two-up view after images are loaded
Loading
Loading
@@ -112,7 +109,7 @@ export default class ImageFile {
maxHeight = 0;
$('.frame', view)
.each(
(function(_this) {
(function() {
return function(index, frame) {
var height, width;
width = $(frame).width();
Loading
Loading
@@ -196,13 +193,7 @@ export default class ImageFile {
return $('.onion-skin.view', this.file).each(
(function(_this) {
return function(index, view) {
var $frame,
$track,
$dragger,
$frameAdded,
framePadding,
ref,
dragging = false;
var $frame, $track, $dragger, $frameAdded, framePadding, ref;
(ref = _this.prepareFrames(view)), ([maxWidth, maxHeight] = ref);
$frame = $('.onion-skin-frame', view);
$frameAdded = $('.frame.added', view);
Loading
Loading
/* eslint-disable func-names, no-underscore-dangle, no-var, one-var, vars-on-top, no-unused-vars, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func */
/* global fuzzaldrinPlus */
/* eslint-disable func-names, no-underscore-dangle, no-var, one-var, vars-on-top, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func */
 
import $ from 'jquery';
import _ from 'underscore';
Loading
Loading
@@ -66,12 +65,10 @@ GitLabDropdownInput = (function() {
})();
 
GitLabDropdownFilter = (function() {
var ARROW_KEY_CODES, BLUR_KEYCODES, HAS_VALUE_CLASS;
var BLUR_KEYCODES, HAS_VALUE_CLASS;
 
BLUR_KEYCODES = [27, 40];
 
ARROW_KEY_CODES = [38, 40];
HAS_VALUE_CLASS = 'has-value';
 
function GitLabDropdownFilter(input, options) {
Loading
Loading
@@ -877,9 +874,8 @@ GitLabDropdown = (function() {
};
 
GitLabDropdown.prototype.addArrowKeyEvent = function() {
var $input, ARROW_KEY_CODES, selector;
var ARROW_KEY_CODES, selector;
ARROW_KEY_CODES = [38, 40];
$input = this.dropdown.find('.dropdown-input-field');
selector = SELECTABLE_CLASSES;
if (this.dropdown.find('.dropdown-toggle-page').length) {
selector = '.dropdown-page-one ' + selector;
Loading
Loading
/* eslint-disable no-var, one-var, no-unused-vars, consistent-return */
/* eslint-disable no-var, one-var, consistent-return */
 
import $ from 'jquery';
import axios from './lib/utils/axios_utils';
import { addDelimiter } from './lib/utils/text_utility';
import flash from './flash';
import TaskList from './task_list';
import CreateMergeRequestDropdown from './create_merge_request_dropdown';
import IssuablesHelper from './helpers/issuables_helper';
import { __ } from './locale';
Loading
Loading
/* eslint-disable class-methods-use-this, no-underscore-dangle, no-param-reassign, no-unused-vars, func-names */
/* eslint-disable class-methods-use-this, no-underscore-dangle, no-param-reassign, func-names */
 
import $ from 'jquery';
import Sortable from 'sortablejs';
Loading
Loading
@@ -50,7 +50,7 @@ export default class LabelManager {
$(e.currentTarget).tooltip('hide');
}
 
toggleEmptyState($label, $btn, action) {
toggleEmptyState() {
this.emptyState.classList.toggle(
'hidden',
Boolean(this.prioritizedLabels[0].querySelector(':scope > li')),
Loading
Loading
@@ -61,7 +61,6 @@ export default class LabelManager {
if (persistState == null) {
persistState = true;
}
const _this = this;
const url = $label.find('.js-toggle-priority').data('url');
let $target = this.prioritizedLabels;
let $from = this.otherLabels;
Loading
Loading
/* eslint-disable no-useless-return, func-names, no-var, no-underscore-dangle, prefer-arrow-callback, one-var, no-unused-vars, prefer-template, no-new, consistent-return, object-shorthand, no-shadow, no-param-reassign, vars-on-top, no-lonely-if, no-else-return, dot-notation, no-empty */
/* eslint-disable no-useless-return, func-names, no-var, no-underscore-dangle, prefer-arrow-callback, one-var, prefer-template, no-new, consistent-return, object-shorthand, no-shadow, no-param-reassign, vars-on-top, no-lonely-if, no-else-return, dot-notation, no-empty */
/* global Issuable */
/* global ListLabel */
 
Loading
Loading
@@ -26,7 +26,6 @@ export default class LabelsSelect {
 
$els.each(function(i, dropdown) {
var $block,
$colorPreview,
$dropdown,
$form,
$loading,
Loading
Loading
@@ -35,8 +34,6 @@ export default class LabelsSelect {
$value,
abilityName,
defaultLabel,
enableLabelCreateButton,
issueURLSplit,
issueUpdateURL,
labelUrl,
namespacePath,
Loading
Loading
@@ -47,16 +44,11 @@ export default class LabelsSelect {
showNo,
$sidebarLabelTooltip,
initialSelected,
$toggleText,
fieldName,
useId,
propertyName,
showMenuAbove,
$container,
$dropdownContainer;
$dropdown = $(dropdown);
$dropdownContainer = $dropdown.closest('.labels-filter');
$toggleText = $dropdown.find('.dropdown-toggle-text');
namespacePath = $dropdown.data('namespacePath');
projectPath = $dropdown.data('projectPath');
issueUpdateURL = $dropdown.data('issueUpdate');
Loading
Loading
@@ -77,10 +69,6 @@ export default class LabelsSelect {
$value = $block.find('.value');
$loading = $block.find('.block-loading').fadeOut();
fieldName = $dropdown.data('fieldName');
useId = $dropdown.is(
'.js-issuable-form-dropdown, .js-filter-bulk-update, .js-label-sidebar-dropdown',
);
propertyName = useId ? 'id' : 'title';
initialSelected = $selectbox
.find('input[name="' + $dropdown.data('fieldName') + '"]')
.map(function() {
Loading
Loading
@@ -124,7 +112,7 @@ export default class LabelsSelect {
axios
.put(issueUpdateURL, data)
.then(({ data }) => {
var labelCount, template, labelTooltipTitle, labelTitles, formattedLabels;
var labelCount, template, labelTooltipTitle, labelTitles;
$loading.fadeOut();
$dropdown.trigger('loaded.gl.dropdown');
$selectbox.hide();
Loading
Loading
@@ -246,12 +234,10 @@ export default class LabelsSelect {
renderRow: function(label) {
var linkEl,
listItemEl,
color,
colorEl,
indeterminate,
removesAll,
selectedClass,
spacing,
i,
marked,
dropdownValue;
Loading
Loading
@@ -378,7 +364,7 @@ export default class LabelsSelect {
}
},
hidden: function() {
var isIssueIndex, isMRIndex, page, selectedLabels;
var isIssueIndex, isMRIndex, page;
page = $('body').attr('data-page');
isIssueIndex = page === 'projects:issues:index';
isMRIndex = page === 'projects:merge_requests:index';
Loading
Loading
@@ -395,9 +381,6 @@ export default class LabelsSelect {
}
if ($dropdown.hasClass('js-multiselect')) {
if ($dropdown.hasClass('js-filter-submit') && (isIssueIndex || isMRIndex)) {
selectedLabels = $dropdown
.closest('form')
.find("input:hidden[name='" + $dropdown.data('fieldName') + "']");
Issuable.filterResults($dropdown.closest('form'));
} else if ($dropdown.hasClass('js-filter-submit')) {
$dropdown.closest('form').submit();
Loading
Loading
@@ -495,7 +478,7 @@ export default class LabelsSelect {
}
}
},
opened: function(e) {
opened: function() {
if ($dropdown.hasClass('js-issue-board-sidebar')) {
const previousSelection = $dropdown.attr('data-selected');
this.selected = previousSelection ? previousSelection.split(',') : [];
Loading
Loading
/* eslint-disable func-names, no-var, no-param-reassign, one-var, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, consistent-return, no-unused-vars */
/* eslint-disable func-names, no-var, no-param-reassign, one-var, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, consistent-return */
import $ from 'jquery';
import { insertText } from '~/lib/utils/common_utils';
 
Loading
Loading
@@ -157,7 +157,7 @@ export function insertMarkdownText({
if (tag === LINK_TAG_PATTERN) {
if (URL) {
try {
const ignoredUrl = new URL(selected);
new URL(selected); // eslint-disable-line no-new
// valid url
tag = '[text]({text})';
select = 'text';
Loading
Loading
/* eslint-disable one-var, no-unused-vars, object-shorthand, no-else-return, no-self-compare, consistent-return, no-param-reassign, no-shadow */
/* eslint-disable one-var, object-shorthand, no-else-return, no-self-compare, consistent-return, no-param-reassign, no-shadow */
/* global Issuable */
/* global ListMilestone */
 
Loading
Loading
@@ -37,7 +37,6 @@ export default class MilestoneSelect {
selectedMilestone,
selectedMilestoneDefault;
const $dropdown = $(dropdown);
const projectId = $dropdown.data('projectId');
const milestonesUrl = $dropdown.data('milestones');
const issueUpdateURL = $dropdown.data('issueUpdate');
const showNo = $dropdown.data('showNo');
Loading
Loading
@@ -48,7 +47,6 @@ export default class MilestoneSelect {
const useId = $dropdown.data('useId');
const defaultLabel = $dropdown.data('defaultLabel');
const defaultNo = $dropdown.data('defaultNo');
const issuableId = $dropdown.data('issuableId');
const abilityName = $dropdown.data('abilityName');
const $selectBox = $dropdown.closest('.selectbox');
const $block = $selectBox.closest('.block');
Loading
Loading
@@ -121,7 +119,7 @@ export default class MilestoneSelect {
fields: ['title'],
},
selectable: true,
toggleLabel: (selected, el, e) => {
toggleLabel: (selected, el) => {
if (selected && 'id' in selected && $(el).hasClass('is-active')) {
return selected.title;
} else {
Loading
Loading
@@ -153,7 +151,7 @@ export default class MilestoneSelect {
},
vue: $dropdown.hasClass('js-issue-board-sidebar'),
clicked: clickEvent => {
const { $el, e } = clickEvent;
const { e } = clickEvent;
let selected = clickEvent.selectedObj;
 
let data, modalStoreFilter;
Loading
Loading
/* eslint-disable func-names, no-var, one-var, no-loop-func, consistent-return, no-unused-vars, prefer-template, prefer-arrow-callback, camelcase */
/* eslint-disable func-names, no-var, one-var, no-loop-func, consistent-return, prefer-template, prefer-arrow-callback, camelcase */
 
import $ from 'jquery';
import { __ } from '../locale';
import axios from '../lib/utils/axios_utils';
import flash from '../flash';
import Raphael from './raphael';
 
export default (function() {
Loading
Loading
@@ -104,7 +103,7 @@ export default (function() {
};
 
BranchGraph.prototype.buildGraph = function() {
var cuday, cumonth, day, j, len, mm, ref;
var cuday, cumonth, day, len, mm, ref;
const { r } = this;
cuday = 0;
cumonth = '';
Loading
Loading
@@ -178,7 +177,7 @@ export default (function() {
 
return $(element).scroll(
(function(_this) {
return function(event) {
return function() {
return _this.renderPartialGraph();
};
})(this),
Loading
Loading
@@ -214,7 +213,7 @@ export default (function() {
};
 
BranchGraph.prototype.appendLabel = function(x, y, commit) {
var label, rect, shortrefs, text, textbox, triangle;
var label, rect, shortrefs, text, textbox;
 
if (!commit.refs) {
return;
Loading
Loading
@@ -239,7 +238,8 @@ export default (function() {
'fill-opacity': 0.5,
stroke: 'none',
});
triangle = r.path(['M', x - 5, y, 'L', x - 15, y - 4, 'L', x - 15, y + 4, 'Z']).attr({
// Generate the triangle right of the tag box
r.path(['M', x - 5, y, 'L', x - 15, y - 4, 'L', x - 15, y + 4, 'Z']).attr({
fill: '#000',
'fill-opacity': 0.5,
stroke: 'none',
Loading
Loading
Loading
Loading
@@ -2,10 +2,9 @@
no-unused-expressions, one-var, default-case,
prefer-template, consistent-return, no-alert, no-return-assign,
no-param-reassign, prefer-arrow-callback, no-else-return, vars-on-top,
no-unused-vars, no-shadow, no-useless-escape, class-methods-use-this */
no-shadow, no-useless-escape, class-methods-use-this */
 
/* global ResolveService */
/* global mrRefreshWidgetUrl */
 
/*
old_notes_spec.js is the spec for the legacy, jQuery notes application. It has nothing to do with the new, fancy Vue notes app.
Loading
Loading
@@ -37,7 +36,6 @@ import {
isMetaKey,
isInMRPage,
} from './lib/utils/common_utils';
import imageDiffHelper from './image_diff/helpers/index';
import { localTimeAgo } from './lib/utils/datetime_utility';
import { sprintf, s__, __ } from './locale';
 
Loading
Loading
@@ -683,7 +681,7 @@ export default class Notes {
);
}
 
updateNoteError($parentTimeline) {
updateNoteError() {
// eslint-disable-next-line no-new
new Flash(
__('Your comment could not be updated! Please check your network connection and try again.'),
Loading
Loading
@@ -697,7 +695,6 @@ export default class Notes {
*/
addDiscussionNote($form, note, isNewDiffComment) {
if ($form.attr('data-resolve-all') != null) {
var projectPath = $form.data('projectPath');
var discussionId = $form.data('discussionId');
var mergeRequestId = $form.data('noteableIid');
 
Loading
Loading
@@ -746,7 +743,6 @@ export default class Notes {
if (currentContent === initialContent) {
this.removeNoteEditForm($el);
} else {
var $buttons = $el.find('.note-form-actions');
var isWidgetVisible = isInViewport($el.get(0));
 
if (!isWidgetVisible) {
Loading
Loading
@@ -766,7 +762,7 @@ export default class Notes {
* Replaces the note text with the note edit form
* Adds a data attribute to the form with the original content of the note for cancellations
*/
showEditForm(e, scrollTo, myLastNote) {
showEditForm(e) {
e.preventDefault();
 
var $target = $(e.target);
Loading
Loading
@@ -850,16 +846,11 @@ export default class Notes {
* Removes the whole discussion if the last note is being removed.
*/
removeNote(e) {
var noteElId, noteId, dataNoteId, $note, lineHolder;
var noteElId, $note;
$note = $(e.currentTarget).closest('.note');
noteElId = $note.attr('id');
noteId = $note.attr('data-note-id');
lineHolder = $(e.currentTarget)
.closest('.notes[data-discussion-id]')
.closest('.notes_holder')
.prev('.line_holder');
$(`.note[id="${noteElId}"]`).each(
(function(_this) {
(function() {
// A same note appears in the "Discussion" and in the "Changes" tab, we have
// to remove all. Using $('.note[id='noteId']') ensure we get all the notes,
// where $('#noteId') would return only one.
Loading
Loading
@@ -1064,25 +1055,8 @@ export default class Notes {
this.setupDiscussionNoteForm($link, newForm);
}
 
toggleDiffNote({
target,
lineType,
forceShow,
showReplyInput = false,
currentUsername,
currentUserAvatar,
currentUserFullname,
}) {
var $link,
addForm,
hasNotes,
newForm,
noteForm,
replyButton,
row,
rowCssToAdd,
targetContent,
isDiffCommentAvatar;
toggleDiffNote({ target, lineType, forceShow, showReplyInput = false }) {
var $link, addForm, hasNotes, newForm, noteForm, replyButton, row, rowCssToAdd;
$link = $(target);
row = $link.closest('tr');
const nextRow = row.next();
Loading
Loading
@@ -1515,7 +1489,7 @@ export default class Notes {
let tempFormContent;
 
// Identify executed quick actions from `formContent`
const executedCommands = availableQuickActions.filter((command, index) => {
const executedCommands = availableQuickActions.filter(command => {
const commandRegex = new RegExp(`/${command.name}`);
return commandRegex.test(formContent);
});
Loading
Loading
@@ -1840,8 +1814,6 @@ export default class Notes {
const $noteBody = $editingNote.find('.js-task-list-container');
const $noteBodyText = $noteBody.find('.note-text');
const { formData, formContent, formAction } = this.getFormData($form);
const $diffFile = $form.closest('.diff-file');
const $notesContainer = $form.closest('.notes');
 
// Cache original comment content
const cachedNoteBodyText = $noteBodyText.html();
Loading
Loading
/* eslint-disable func-names, object-shorthand, no-var, one-var, camelcase, no-param-reassign, no-return-assign, prefer-arrow-callback, consistent-return, no-unused-vars, no-cond-assign, no-else-return */
/* eslint-disable func-names, object-shorthand, no-var, one-var, camelcase, no-param-reassign, no-return-assign, prefer-arrow-callback, consistent-return, no-cond-assign, no-else-return */
import _ from 'underscore';
 
export default {
Loading
Loading
@@ -126,7 +126,7 @@ export default {
_.each(
_.omit(log_entry, 'author_name', 'author_email'),
(function(_this) {
return function(value, key) {
return function(value) {
if (_this.in_range(value.date, date_range)) {
parsed_entry.dates[value.date] = value[field];
parsed_entry.commits += value.commits;
Loading
Loading
/* eslint-disable no-useless-escape, no-var, no-underscore-dangle, func-names, no-unused-vars, no-return-assign, object-shorthand, one-var, consistent-return, class-methods-use-this */
/* eslint-disable no-useless-escape, no-var, no-underscore-dangle, func-names, no-return-assign, object-shorthand, one-var, consistent-return, class-methods-use-this */
 
import $ from 'jquery';
import 'cropper';
import _ from 'underscore';
 
(global => {
(() => {
// Matches everything but the file name
const FILENAMEREGEX = /^.*[\\\/]/;
 
Loading
Loading
@@ -69,7 +69,7 @@ import _ from 'underscore';
this.modalCrop.on('shown.bs.modal', this.onModalShow);
this.modalCrop.on('hidden.bs.modal', this.onModalHide);
this.uploadImageBtn.on('click', this.onUploadImageBtnClick);
this.cropActionsBtn.on('click', function(e) {
this.cropActionsBtn.on('click', function() {
var btn;
btn = this;
return _this.onActionBtnClick(btn);
Loading
Loading
@@ -128,10 +128,10 @@ import _ from 'underscore';
}
 
onActionBtnClick(btn) {
var data, result;
var data;
data = $(btn).data();
if (this.modalCropImg.data('cropper') && data.method) {
return (result = this.modalCropImg.cropper(data.method, data.option));
return this.modalCropImg.cropper(data.method, data.option);
}
}
 
Loading
Loading
@@ -151,12 +151,11 @@ import _ from 'underscore';
}
 
dataURLtoBlob(dataURL) {
var array, binary, i, len, v;
var array, binary, i, len;
binary = atob(dataURL.split(',')[1]);
array = [];
 
for (i = 0, len = binary.length; i < len; i += 1) {
v = binary[i];
array.push(binary.charCodeAt(i));
}
return new Blob([new Uint8Array(array)], {
Loading
Loading
/* eslint-disable func-names, no-var, consistent-return, one-var, no-cond-assign, prefer-template, no-unused-vars, no-return-assign */
/* eslint-disable func-names, no-var, consistent-return, one-var, no-cond-assign, prefer-template, no-return-assign */
 
import $ from 'jquery';
import fuzzaldrinPlus from 'fuzzaldrin-plus';
Loading
Loading
@@ -8,9 +8,8 @@ import { __ } from '~/locale';
 
// highlight text(awefwbwgtc -> <b>a</b>wefw<b>b</b>wgt<b>c</b> )
const highlighter = function(element, text, matches) {
var highlightText, j, lastIndex, len, matchIndex, matchedChars, unmatched;
var j, lastIndex, len, matchIndex, matchedChars, unmatched;
lastIndex = 0;
highlightText = '';
matchedChars = [];
for (j = 0, len = matches.length; j < len; j += 1) {
matchIndex = matches[j];
Loading
Loading
/* eslint-disable func-names, no-var, no-unused-vars, consistent-return, one-var, prefer-template, no-else-return, no-param-reassign */
/* eslint-disable func-names, no-var, consistent-return, one-var, prefer-template, no-else-return, no-param-reassign */
 
import $ from 'jquery';
import _ from 'underscore';
Loading
Loading
@@ -7,7 +7,7 @@ import flash from './flash';
import axios from './lib/utils/axios_utils';
import { sprintf, s__, __ } from './locale';
 
function Sidebar(currentUser) {
function Sidebar() {
this.toggleTodo = this.toggleTodo.bind(this);
this.sidebar = $('aside');
 
Loading
Loading
@@ -15,9 +15,9 @@ function Sidebar(currentUser) {
this.addEventListeners();
}
 
Sidebar.initialize = function(currentUser) {
Sidebar.initialize = function() {
if (!this.instance) {
this.instance = new Sidebar(currentUser);
this.instance = new Sidebar();
}
};
 
Loading
Loading
@@ -77,7 +77,7 @@ Sidebar.prototype.sidebarToggleClicked = function(e, triggered) {
};
 
Sidebar.prototype.toggleTodo = function(e) {
var $btnText, $this, $todoLoading, ajaxType, url;
var $this, ajaxType, url;
$this = $(e.currentTarget);
ajaxType = $this.data('deletePath') ? 'delete' : 'post';
 
Loading
Loading
@@ -140,7 +140,7 @@ Sidebar.prototype.todoUpdateDone = function(data) {
});
};
 
Sidebar.prototype.sidebarDropdownLoading = function(e) {
Sidebar.prototype.sidebarDropdownLoading = function() {
var $loading, $sidebarCollapsedIcon, i, img;
$sidebarCollapsedIcon = $(this)
.closest('.block')
Loading
Loading
@@ -157,7 +157,7 @@ Sidebar.prototype.sidebarDropdownLoading = function(e) {
}
};
 
Sidebar.prototype.sidebarDropdownLoaded = function(e) {
Sidebar.prototype.sidebarDropdownLoaded = function() {
var $sidebarCollapsedIcon, i, img;
$sidebarCollapsedIcon = $(this)
.closest('.block')
Loading
Loading
/* eslint-disable no-return-assign, one-var, no-var, no-unused-vars, consistent-return, object-shorthand, prefer-template, class-methods-use-this, no-lonely-if, vars-on-top */
/* eslint-disable no-return-assign, one-var, no-var, consistent-return, object-shorthand, prefer-template, class-methods-use-this, no-lonely-if, vars-on-top */
 
import $ from 'jquery';
import { escape, throttle } from 'underscore';
import { s__, __, sprintf } from '~/locale';
import { s__, __ } from '~/locale';
import { getIdenticonBackgroundClass, getIdenticonTitle } from '~/helpers/avatar_helper';
import axios from './lib/utils/axios_utils';
import DropdownUtils from './filtered_search/dropdown_utils';
import {
isInGroupsPage,
isInProjectPage,
Loading
Loading
@@ -142,7 +141,7 @@ export class SearchAutocomplete {
});
}
 
getSearchText(selectedObject, el) {
getSearchText(selectedObject) {
return selectedObject.id ? selectedObject.text : '';
}
 
Loading
Loading
@@ -402,7 +401,7 @@ export class SearchAutocomplete {
return this.searchInput.val('').focus();
}
 
onSearchInputBlur(e) {
onSearchInputBlur() {
this.isFocused = false;
this.wrap.removeClass('search-active');
// If input is blank then restore state
Loading
Loading
/* eslint-disable func-names, one-var, no-var, prefer-rest-params, vars-on-top, prefer-arrow-callback, consistent-return, object-shorthand, no-shadow, no-unused-vars, no-else-return, no-self-compare, prefer-template, no-unused-expressions, yoda, prefer-spread, camelcase, no-param-reassign */
/* eslint-disable func-names, one-var, no-var, prefer-rest-params, vars-on-top, prefer-arrow-callback, consistent-return, object-shorthand, no-shadow, no-else-return, no-self-compare, prefer-template, no-unused-expressions, yoda, prefer-spread, camelcase, no-param-reassign */
/* global Issuable */
/* global emitSidebarEvent */
 
Loading
Loading
@@ -405,7 +405,7 @@ function UsersSelect(currentUser, els, options = {}) {
}
},
defaultLabel: defaultLabel,
hidden: function(e) {
hidden: function() {
if ($dropdown.hasClass('js-multiselect')) {
emitSidebarEvent('sidebar.saveAssignees');
}
Loading
Loading
@@ -442,7 +442,6 @@ function UsersSelect(currentUser, els, options = {}) {
if (user.beforeDivider && user.name.toLowerCase() === 'unassigned') {
// Unassigned selected
previouslySelected.each((index, element) => {
const id = parseInt(element.value, 10);
element.remove();
});
emitSidebarEvent('sidebar.removeAllAssignees');
Loading
Loading
@@ -548,7 +547,7 @@ function UsersSelect(currentUser, els, options = {}) {
},
updateLabel: $dropdown.data('dropdownTitle'),
renderRow: function(user) {
var avatar, img, listClosingTags, listWithName, listWithUserName, username;
var avatar, img, username;
username = user.username ? '@' + user.username : '';
avatar = user.avatar_url ? user.avatar_url : gon.default_avatar_url;
 
Loading
Loading
/* eslint-disable func-names, prefer-arrow-callback, no-unused-vars, consistent-return, camelcase, class-methods-use-this */
/* eslint-disable func-names, prefer-arrow-callback, consistent-return, camelcase, class-methods-use-this */
 
// Zen Mode (full screen) textarea
//
Loading
Loading
@@ -62,7 +62,7 @@ export default class ZenMode {
$(document).on(
'zen_mode:leave',
(function(_this) {
return function(e) {
return function() {
return _this.exit();
};
})(this),
Loading
Loading
Loading
Loading
@@ -95,7 +95,7 @@ module Ci
# rubocop: disable CodeReuse/ActiveRecord
def auto_cancelable_pipelines
# TODO: Introduced by https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23464
if Feature.enabled?(:ci_support_interruptible_pipelines, project, default_enabled: true)
if Feature.enabled?(:ci_support_interruptible_pipelines, project, default_enabled: false)
project.ci_pipelines
.where(ref: pipeline.ref)
.where.not(id: pipeline.id)
Loading
Loading
# frozen_string_literal: true
 
class ServiceResponse
def self.success(message: nil, payload: {})
new(status: :success, message: message, payload: payload)
def self.success(message: nil, payload: {}, http_status: :ok)
new(status: :success, message: message, payload: payload, http_status: http_status)
end
 
def self.error(message:, payload: {}, http_status: nil)
Loading
Loading
Loading
Loading
@@ -29,4 +29,4 @@
= yield :push_access_levels
 
.card-footer
= f.submit 'Protect', class: 'btn-success btn', disabled: true
= f.submit 'Protect', class: 'btn-success btn', disabled: true, data: { qa_selector: 'protect_button' }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment