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

Add latest changes from gitlab-org/gitlab@master

parent 4ab54c22
No related branches found
No related tags found
No related merge requests found
Showing
with 151 additions and 90 deletions
/* 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 */ /* eslint-disable func-names, 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'; import _ from 'underscore';
   
export default { export default {
parse_log: function(log) { parse_log(log) {
var by_author, by_email, data, entry, i, len, total, normalized_email; var by_author, by_email, data, entry, i, len, total, normalized_email;
total = {}; total = {};
by_author = {}; by_author = {};
Loading
@@ -25,15 +25,15 @@ export default {
Loading
@@ -25,15 +25,15 @@ export default {
total = _.toArray(total); total = _.toArray(total);
by_author = _.toArray(by_author); by_author = _.toArray(by_author);
return { return {
total: total, total,
by_author: by_author, by_author,
}; };
}, },
add_date: function(date, collection) { add_date(date, collection) {
collection[date] = {}; collection[date] = {};
return (collection[date].date = date); return (collection[date].date = date);
}, },
add_author: function(author, by_author, by_email) { add_author(author, by_author, by_email) {
var data, normalized_email; var data, normalized_email;
data = {}; data = {};
data.author_name = author.author_name; data.author_name = author.author_name;
Loading
@@ -43,36 +43,36 @@ export default {
Loading
@@ -43,36 +43,36 @@ export default {
by_email[normalized_email] = data; by_email[normalized_email] = data;
return data; return data;
}, },
store_data: function(entry, total, by_author) { store_data(entry, total, by_author) {
this.store_commits(total, by_author); this.store_commits(total, by_author);
this.store_additions(entry, total, by_author); this.store_additions(entry, total, by_author);
return this.store_deletions(entry, total, by_author); return this.store_deletions(entry, total, by_author);
}, },
store_commits: function(total, by_author) { store_commits(total, by_author) {
this.add(total, 'commits', 1); this.add(total, 'commits', 1);
return this.add(by_author, 'commits', 1); return this.add(by_author, 'commits', 1);
}, },
add: function(collection, field, value) { add(collection, field, value) {
if (collection[field] == null) { if (collection[field] == null) {
collection[field] = 0; collection[field] = 0;
} }
return (collection[field] += value); return (collection[field] += value);
}, },
store_additions: function(entry, total, by_author) { store_additions(entry, total, by_author) {
if (entry.additions == null) { if (entry.additions == null) {
entry.additions = 0; entry.additions = 0;
} }
this.add(total, 'additions', entry.additions); this.add(total, 'additions', entry.additions);
return this.add(by_author, 'additions', entry.additions); return this.add(by_author, 'additions', entry.additions);
}, },
store_deletions: function(entry, total, by_author) { store_deletions(entry, total, by_author) {
if (entry.deletions == null) { if (entry.deletions == null) {
entry.deletions = 0; entry.deletions = 0;
} }
this.add(total, 'deletions', entry.deletions); this.add(total, 'deletions', entry.deletions);
return this.add(by_author, 'deletions', entry.deletions); return this.add(by_author, 'deletions', entry.deletions);
}, },
get_total_data: function(parsed_log, field) { get_total_data(parsed_log, field) {
var log, total_data; var log, total_data;
log = parsed_log.total; log = parsed_log.total;
total_data = this.pick_field(log, field); total_data = this.pick_field(log, field);
Loading
@@ -80,7 +80,7 @@ export default {
Loading
@@ -80,7 +80,7 @@ export default {
return d.date; return d.date;
}); });
}, },
pick_field: function(log, field) { pick_field(log, field) {
var total_data; var total_data;
total_data = []; total_data = [];
_.each(log, function(d) { _.each(log, function(d) {
Loading
@@ -88,7 +88,7 @@ export default {
Loading
@@ -88,7 +88,7 @@ export default {
}); });
return total_data; return total_data;
}, },
get_author_data: function(parsed_log, field, date_range) { get_author_data(parsed_log, field, date_range) {
var author_data, log; var author_data, log;
if (date_range == null) { if (date_range == null) {
date_range = null; date_range = null;
Loading
@@ -111,7 +111,7 @@ export default {
Loading
@@ -111,7 +111,7 @@ export default {
return d[field]; return d[field];
}).reverse(); }).reverse();
}, },
parse_log_entry: function(log_entry, field, date_range) { parse_log_entry(log_entry, field, date_range) {
var parsed_entry; var parsed_entry;
parsed_entry = {}; parsed_entry = {};
   
Loading
@@ -138,7 +138,7 @@ export default {
Loading
@@ -138,7 +138,7 @@ export default {
); );
return parsed_entry; return parsed_entry;
}, },
in_range: function(date, date_range) { in_range(date, date_range) {
var ref; var ref;
if (date_range === null || (date_range[0] <= (ref = new Date(date)) && ref <= date_range[1])) { if (date_range === null || (date_range[0] <= (ref = new Date(date)) && ref <= date_range[1])) {
return true; return true;
Loading
Loading
/* eslint-disable func-names, no-var, no-return-assign, object-shorthand, vars-on-top */ /* eslint-disable func-names, no-var, no-return-assign, vars-on-top */
   
import $ from 'jquery'; import $ from 'jquery';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
Loading
@@ -123,7 +123,7 @@ export default class Project {
Loading
@@ -123,7 +123,7 @@ export default class Project {
filterByText: true, filterByText: true,
inputFieldName: $dropdown.data('inputFieldName'), inputFieldName: $dropdown.data('inputFieldName'),
fieldName, fieldName,
renderRow: function(ref) { renderRow(ref) {
var li = refListItem.cloneNode(false); var li = refListItem.cloneNode(false);
   
if (ref.header != null) { if (ref.header != null) {
Loading
@@ -144,13 +144,13 @@ export default class Project {
Loading
@@ -144,13 +144,13 @@ export default class Project {
   
return li; return li;
}, },
id: function(obj, $el) { id(obj, $el) {
return $el.attr('data-ref'); return $el.attr('data-ref');
}, },
toggleLabel: function(obj, $el) { toggleLabel(obj, $el) {
return $el.text().trim(); return $el.text().trim();
}, },
clicked: function(options) { clicked(options) {
const { e } = options; const { e } = options;
e.preventDefault(); e.preventDefault();
if ($(`input[name="${fieldName}"]`).length) { if ($(`input[name="${fieldName}"]`).length) {
Loading
Loading
Loading
@@ -2,35 +2,43 @@
Loading
@@ -2,35 +2,43 @@
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import StageColumnComponent from './stage_column_component.vue'; import StageColumnComponent from './stage_column_component.vue';
import GraphMixin from '../../mixins/graph_component_mixin'; import GraphMixin from '../../mixins/graph_component_mixin';
import GraphWidthMixin from '~/pipelines/mixins/graph_width_mixin';
   
export default { export default {
components: { components: {
StageColumnComponent, StageColumnComponent,
GlLoadingIcon, GlLoadingIcon,
}, },
mixins: [GraphMixin], mixins: [GraphMixin, GraphWidthMixin],
}; };
</script> </script>
<template> <template>
<div class="build-content middle-block js-pipeline-graph"> <div class="build-content middle-block js-pipeline-graph">
<div class="pipeline-visualization pipeline-graph pipeline-tab-content"> <div class="pipeline-visualization pipeline-graph pipeline-tab-content">
<div v-if="isLoading" class="m-auto"><gl-loading-icon :size="3" /></div> <div
:style="{
paddingLeft: `${graphLeftPadding}px`,
paddingRight: `${graphRightPadding}px`,
}"
>
<gl-loading-icon v-if="isLoading" class="m-auto" :size="3" />
   
<ul v-if="!isLoading" class="stage-column-list"> <ul v-if="!isLoading" class="stage-column-list">
<stage-column-component <stage-column-component
v-for="(stage, index) in graph" v-for="(stage, index) in graph"
:key="stage.name" :key="stage.name"
:class="{ :class="{
'append-right-48': shouldAddRightMargin(index), 'append-right-48': shouldAddRightMargin(index),
}" }"
:title="capitalizeStageName(stage.name)" :title="capitalizeStageName(stage.name)"
:groups="stage.groups" :groups="stage.groups"
:stage-connector-class="stageConnectorClass(index, stage)" :stage-connector-class="stageConnectorClass(index, stage)"
:is-first-column="isFirstColumn(index)" :is-first-column="isFirstColumn(index)"
:action="stage.status.action" :action="stage.status.action"
@refreshPipelineGraph="refreshPipelineGraph" @refreshPipelineGraph="refreshPipelineGraph"
/> />
</ul> </ul>
</div>
</div> </div>
</div> </div>
</template> </template>
Loading
@@ -37,7 +37,7 @@ export default {
Loading
@@ -37,7 +37,7 @@ export default {
), ),
{ jobName: action.name }, { jobName: action.name },
); );
// https://gitlab.com/gitlab-org/gitlab-ce/issues/52156 // https://gitlab.com/gitlab-org/gitlab-foss/issues/52156
// eslint-disable-next-line no-alert // eslint-disable-next-line no-alert
if (!window.confirm(confirmationMessage)) { if (!window.confirm(confirmationMessage)) {
return; return;
Loading
Loading
export const CANCEL_REQUEST = 'CANCEL_REQUEST'; export const CANCEL_REQUEST = 'CANCEL_REQUEST';
export const PIPELINES_TABLE = 'PIPELINES_TABLE'; export const PIPELINES_TABLE = 'PIPELINES_TABLE';
export const LAYOUT_CHANGE_DELAY = 300;
import { debounceByAnimationFrame } from '~/lib/utils/common_utils';
import { LAYOUT_CHANGE_DELAY } from '~/pipelines/constants';
export default {
debouncedResize: null,
sidebarMutationObserver: null,
data() {
return {
graphLeftPadding: 0,
graphRightPadding: 0,
};
},
beforeDestroy() {
window.removeEventListener('resize', this.$options.debouncedResize);
if (this.$options.sidebarMutationObserver) {
this.$options.sidebarMutationObserver.disconnect();
}
},
created() {
this.$options.debouncedResize = debounceByAnimationFrame(this.setGraphPadding);
window.addEventListener('resize', this.$options.debouncedResize);
},
mounted() {
this.setGraphPadding();
this.$options.sidebarMutationObserver = new MutationObserver(this.handleLayoutChange);
this.$options.sidebarMutationObserver.observe(document.querySelector('.layout-page'), {
attributes: true,
childList: false,
subtree: false,
});
},
methods: {
setGraphPadding() {
// only add padding to main graph (not inline upstream/downstream graphs)
if (this.type && this.type !== 'main') return;
const container = document.querySelector('.js-pipeline-container');
if (!container) return;
this.graphLeftPadding = container.offsetLeft;
this.graphRightPadding = window.innerWidth - container.offsetLeft - container.offsetWidth;
},
handleLayoutChange() {
// wait until animations finish, then recalculate padding
window.setTimeout(this.setGraphPadding, LAYOUT_CHANGE_DELAY);
},
},
};
import PersistentUserCallout from '~/persistent_user_callout'; import PersistentUserCallout from '~/persistent_user_callout';
   
function initPrivacyPolicyUpdateCallout() { function initPrivacyPolicyUpdateCallout() {
const callout = document.querySelector('.privacy-policy-update-64341'); const callout = document.querySelector('.js-privacy-policy-update');
PersistentUserCallout.factory(callout); PersistentUserCallout.factory(callout);
} }
   
Loading
Loading
/* 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 */ /* eslint-disable no-useless-escape, no-var, no-underscore-dangle, func-names, no-return-assign, one-var, consistent-return, class-methods-use-this */
   
import $ from 'jquery'; import $ from 'jquery';
import 'cropper'; import 'cropper';
Loading
@@ -100,7 +100,7 @@ import _ from 'underscore';
Loading
@@ -100,7 +100,7 @@ import _ from 'underscore';
cropBoxMovable: false, cropBoxMovable: false,
cropBoxResizable: false, cropBoxResizable: false,
toggleDragModeOnDblclick: false, toggleDragModeOnDblclick: false,
built: function() { built() {
const $image = $(this); const $image = $(this);
const container = $image.cropper('getContainerData'); const container = $image.cropper('getContainerData');
const { cropBoxWidth, cropBoxHeight } = _this; const { cropBoxWidth, cropBoxHeight } = _this;
Loading
Loading
/* eslint-disable func-names, no-var, object-shorthand, one-var, no-else-return */ /* eslint-disable func-names, no-var, one-var, no-else-return */
   
import $ from 'jquery'; import $ from 'jquery';
import Api from './api'; import Api from './api';
Loading
@@ -28,7 +28,7 @@ export default function projectSelect() {
Loading
@@ -28,7 +28,7 @@ export default function projectSelect() {
} }
   
$(select).select2({ $(select).select2({
placeholder: placeholder, placeholder,
minimumInputLength: 0, minimumInputLength: 0,
query: (function(_this) { query: (function(_this) {
return function(query) { return function(query) {
Loading
@@ -79,18 +79,18 @@ export default function projectSelect() {
Loading
@@ -79,18 +79,18 @@ export default function projectSelect() {
} }
}; };
})(this), })(this),
id: function(project) { id(project) {
if (simpleFilter) return project.id; if (simpleFilter) return project.id;
return JSON.stringify({ return JSON.stringify({
name: project.name, name: project.name,
url: project.web_url, url: project.web_url,
}); });
}, },
text: function(project) { text(project) {
return project.name_with_namespace || project.name; return project.name_with_namespace || project.name;
}, },
   
initSelection: function(el, callback) { initSelection(el, callback) {
return Api.project(el.val()).then(({ data }) => callback(data)); return Api.project(el.val()).then(({ data }) => callback(data));
}, },
   
Loading
Loading
/* 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 */ /* eslint-disable no-return-assign, one-var, no-var, consistent-return, prefer-template, class-methods-use-this, no-lonely-if, vars-on-top */
   
import $ from 'jquery'; import $ from 'jquery';
import { escape, throttle } from 'underscore'; import { escape, throttle } from 'underscore';
Loading
@@ -171,7 +171,7 @@ export class SearchAutocomplete {
Loading
@@ -171,7 +171,7 @@ export class SearchAutocomplete {
params: { params: {
project_id: this.projectId, project_id: this.projectId,
project_ref: this.projectRef, project_ref: this.projectRef,
term: term, term,
}, },
}) })
.then(response => { .then(response => {
Loading
Loading
Loading
@@ -5,7 +5,7 @@ import { __ } from './locale';
Loading
@@ -5,7 +5,7 @@ import { __ } from './locale';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
import createFlash from './flash'; import createFlash from './flash';
import FilesCommentButton from './files_comment_button'; import FilesCommentButton from './files_comment_button';
import imageDiffHelper from './image_diff/helpers/index'; import initImageDiffHelper from './image_diff/helpers/init_image_diff';
import syntaxHighlight from './syntax_highlight'; import syntaxHighlight from './syntax_highlight';
   
const WRAPPER = '<div class="diff-content"></div>'; const WRAPPER = '<div class="diff-content"></div>';
Loading
@@ -101,7 +101,7 @@ export default class SingleFileDiff {
Loading
@@ -101,7 +101,7 @@ export default class SingleFileDiff {
FilesCommentButton.init($file); FilesCommentButton.init($file);
   
const canCreateNote = $file.closest('.files').is('[data-can-create-note]'); const canCreateNote = $file.closest('.files').is('[data-can-create-note]');
imageDiffHelper.initImageDiff($file[0], canCreateNote); initImageDiffHelper.initImageDiff($file[0], canCreateNote);
   
if (cb) cb(); if (cb) cb();
}) })
Loading
Loading
Loading
@@ -10,12 +10,8 @@ const DEFAULT_SNOWPLOW_OPTIONS = {
Loading
@@ -10,12 +10,8 @@ const DEFAULT_SNOWPLOW_OPTIONS = {
forceSecureTracker: true, forceSecureTracker: true,
eventMethod: 'post', eventMethod: 'post',
contexts: { webPage: true }, contexts: { webPage: true },
// Page tracking tracks a single event when the page loads. formTracking: false,
pageTrackingEnabled: false, linkClickTracking: false,
// Activity tracking tracks when a user is still interacting with the page.
// Events like scrolling and mouse movements are used to determine if the
// user has the tab active and is still actively engaging.
activityTrackingEnabled: false,
}; };
   
const extractData = (el, opts = {}) => { const extractData = (el, opts = {}) => {
Loading
@@ -96,6 +92,9 @@ export function initUserTracking() {
Loading
@@ -96,6 +92,9 @@ export function initUserTracking() {
const opts = Object.assign({}, DEFAULT_SNOWPLOW_OPTIONS, window.snowplowOptions); const opts = Object.assign({}, DEFAULT_SNOWPLOW_OPTIONS, window.snowplowOptions);
window.snowplow('newTracker', opts.namespace, opts.hostname, opts); window.snowplow('newTracker', opts.namespace, opts.hostname, opts);
   
if (opts.activityTrackingEnabled) window.snowplow('enableActivityTracking', 30, 30); window.snowplow('enableActivityTracking', 30, 30);
if (opts.pageTrackingEnabled) window.snowplow('trackPageView'); // must be after enableActivityTracking window.snowplow('trackPageView'); // must be after enableActivityTracking
if (opts.formTracking) window.snowplow('enableFormTracking');
if (opts.linkClickTracking) window.snowplow('enableLinkClickTracking');
} }
/* 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 */ /* eslint-disable func-names, one-var, no-var, prefer-rest-params, vars-on-top, prefer-arrow-callback, consistent-return, no-shadow, no-else-return, no-self-compare, prefer-template, no-unused-expressions, yoda, prefer-spread, camelcase, no-param-reassign */
/* global Issuable */ /* global Issuable */
/* global emitSidebarEvent */ /* global emitSidebarEvent */
   
Loading
@@ -248,8 +248,8 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -248,8 +248,8 @@ function UsersSelect(currentUser, els, options = {}) {
})}</span> <% } %>`, })}</span> <% } %>`,
); );
return $dropdown.glDropdown({ return $dropdown.glDropdown({
showMenuAbove: showMenuAbove, showMenuAbove,
data: function(term, callback) { data(term, callback) {
return _this.users( return _this.users(
term, term,
options, options,
Loading
@@ -261,7 +261,7 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -261,7 +261,7 @@ function UsersSelect(currentUser, els, options = {}) {
}.bind(this), }.bind(this),
); );
}, },
processData: function(term, data, callback) { processData(term, data, callback) {
let users = data; let users = data;
   
// Only show assigned user list when there is no search term // Only show assigned user list when there is no search term
Loading
@@ -326,7 +326,7 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -326,7 +326,7 @@ function UsersSelect(currentUser, els, options = {}) {
} }
anyUser = { anyUser = {
beforeDivider: true, beforeDivider: true,
name: name, name,
id: null, id: null,
}; };
users.unshift(anyUser); users.unshift(anyUser);
Loading
@@ -376,7 +376,7 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -376,7 +376,7 @@ function UsersSelect(currentUser, els, options = {}) {
}, },
selectable: true, selectable: true,
fieldName: $dropdown.data('fieldName'), fieldName: $dropdown.data('fieldName'),
toggleLabel: function(selected, el, glDropdown) { toggleLabel(selected, el, glDropdown) {
const inputValue = glDropdown.filterInput.val(); const inputValue = glDropdown.filterInput.val();
   
if (this.multiSelect && inputValue === '') { if (this.multiSelect && inputValue === '') {
Loading
@@ -404,8 +404,8 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -404,8 +404,8 @@ function UsersSelect(currentUser, els, options = {}) {
return defaultLabel; return defaultLabel;
} }
}, },
defaultLabel: defaultLabel, defaultLabel,
hidden: function() { hidden() {
if ($dropdown.hasClass('js-multiselect')) { if ($dropdown.hasClass('js-multiselect')) {
emitSidebarEvent('sidebar.saveAssignees'); emitSidebarEvent('sidebar.saveAssignees');
} }
Loading
@@ -422,7 +422,7 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -422,7 +422,7 @@ function UsersSelect(currentUser, els, options = {}) {
}, },
multiSelect: $dropdown.hasClass('js-multiselect'), multiSelect: $dropdown.hasClass('js-multiselect'),
inputMeta: $dropdown.data('inputMeta'), inputMeta: $dropdown.data('inputMeta'),
clicked: function(options) { clicked(options) {
const { $el, e, isMarking } = options; const { $el, e, isMarking } = options;
const user = options.selectedObj; const user = options.selectedObj;
   
Loading
@@ -522,10 +522,10 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -522,10 +522,10 @@ function UsersSelect(currentUser, els, options = {}) {
$dropdown.dropdown('toggle'); $dropdown.dropdown('toggle');
} }
}, },
id: function(user) { id(user) {
return user.id; return user.id;
}, },
opened: function(e) { opened(e) {
const $el = $(e.currentTarget); const $el = $(e.currentTarget);
const selected = getSelected(); const selected = getSelected();
if ($dropdown.hasClass('js-issue-board-sidebar') && selected.length === 0) { if ($dropdown.hasClass('js-issue-board-sidebar') && selected.length === 0) {
Loading
@@ -546,7 +546,7 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -546,7 +546,7 @@ function UsersSelect(currentUser, els, options = {}) {
} }
}, },
updateLabel: $dropdown.data('dropdownTitle'), updateLabel: $dropdown.data('dropdownTitle'),
renderRow: function(user) { renderRow(user) {
var avatar, img, username; var avatar, img, username;
username = user.username ? '@' + user.username : ''; username = user.username ? '@' + user.username : '';
avatar = user.avatar_url ? user.avatar_url : gon.default_avatar_url; avatar = user.avatar_url ? user.avatar_url : gon.default_avatar_url;
Loading
@@ -605,7 +605,7 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -605,7 +605,7 @@ function UsersSelect(currentUser, els, options = {}) {
placeholder: __('Search for a user'), placeholder: __('Search for a user'),
multiple: $(select).hasClass('multiselect'), multiple: $(select).hasClass('multiselect'),
minimumInputLength: 0, minimumInputLength: 0,
query: function(query) { query(query) {
return _this.users(query.term, options, function(users) { return _this.users(query.term, options, function(users) {
var anyUser, data, emailUser, index, len, name, nullUser, obj, ref; var anyUser, data, emailUser, index, len, name, nullUser, obj, ref;
data = { data = {
Loading
@@ -638,7 +638,7 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -638,7 +638,7 @@ function UsersSelect(currentUser, els, options = {}) {
name = s__('UsersSelect|Any User'); name = s__('UsersSelect|Any User');
} }
anyUser = { anyUser = {
name: name, name,
id: null, id: null,
}; };
data.results.unshift(anyUser); data.results.unshift(anyUser);
Loading
@@ -661,24 +661,24 @@ function UsersSelect(currentUser, els, options = {}) {
Loading
@@ -661,24 +661,24 @@ function UsersSelect(currentUser, els, options = {}) {
return query.callback(data); return query.callback(data);
}); });
}, },
initSelection: function() { initSelection() {
var args; var args;
args = 1 <= arguments.length ? [].slice.call(arguments, 0) : []; args = 1 <= arguments.length ? [].slice.call(arguments, 0) : [];
return _this.initSelection.apply(_this, args); return _this.initSelection.apply(_this, args);
}, },
formatResult: function() { formatResult() {
var args; var args;
args = 1 <= arguments.length ? [].slice.call(arguments, 0) : []; args = 1 <= arguments.length ? [].slice.call(arguments, 0) : [];
return _this.formatResult.apply(_this, args); return _this.formatResult.apply(_this, args);
}, },
formatSelection: function() { formatSelection() {
var args; var args;
args = 1 <= arguments.length ? [].slice.call(arguments, 0) : []; args = 1 <= arguments.length ? [].slice.call(arguments, 0) : [];
return _this.formatSelection.apply(_this, args); return _this.formatSelection.apply(_this, args);
}, },
dropdownCssClass: 'ajax-users-dropdown', dropdownCssClass: 'ajax-users-dropdown',
// we do not want to escape markup since we are displaying html in results // we do not want to escape markup since we are displaying html in results
escapeMarkup: function(m) { escapeMarkup(m) {
return m; return m;
}, },
}); });
Loading
Loading
Loading
@@ -88,7 +88,8 @@ export default {
Loading
@@ -88,7 +88,8 @@ export default {
mergeButtonText() { mergeButtonText() {
if (this.isMergingImmediately) { if (this.isMergingImmediately) {
return __('Merge in progress'); return __('Merge in progress');
} else if (this.isAutoMergeAvailable) { }
if (this.isAutoMergeAvailable) {
return this.autoMergeText; return this.autoMergeText;
} }
   
Loading
@@ -306,7 +307,7 @@ export default {
Loading
@@ -306,7 +307,7 @@ export default {
</template> </template>
<template v-else> <template v-else>
<span class="bold js-resolve-mr-widget-items-message"> <span class="bold js-resolve-mr-widget-items-message">
{{ __('You can only merge once the items above are resolved') }} {{ mergeDisabledText }}
</span> </span>
</template> </template>
</div> </div>
Loading
Loading
import { __ } from '~/locale'; import { __ } from '~/locale';
   
export const MERGE_DISABLED_TEXT = __('You can only merge once the items above are resolved.');
export default { export default {
computed: { computed: {
isMergeButtonDisabled() { isMergeButtonDisabled() {
Loading
@@ -11,6 +13,9 @@ export default {
Loading
@@ -11,6 +13,9 @@ export default {
this.mr.preventMerge, this.mr.preventMerge,
); );
}, },
mergeDisabledText() {
return MERGE_DISABLED_TEXT;
},
autoMergeText() { autoMergeText() {
// MWPS is currently the only auto merge strategy available in CE // MWPS is currently the only auto merge strategy available in CE
return __('Merge when pipeline succeeds'); return __('Merge when pipeline succeeds');
Loading
Loading
Loading
@@ -37,7 +37,7 @@ export default class MRWidgetService {
Loading
@@ -37,7 +37,7 @@ export default class MRWidgetService {
// two endpoints are requested in order to get MR info: // two endpoints are requested in order to get MR info:
// one which is etag-cached and invalidated and another one which is not cached // one which is etag-cached and invalidated and another one which is not cached
// the idea is to move all the fields to etag-cached endpoint and then perform only one request // the idea is to move all the fields to etag-cached endpoint and then perform only one request
// https://gitlab.com/gitlab-org/gitlab-ce/issues/61559#note_188801390 // https://gitlab.com/gitlab-org/gitlab-foss/issues/61559#note_188801390
const getData = axios.get(this.endpoints.mergeRequestWidgetPath); const getData = axios.get(this.endpoints.mergeRequestWidgetPath);
const getCachedData = axios.get(this.endpoints.mergeRequestCachedWidgetPath); const getCachedData = axios.get(this.endpoints.mergeRequestCachedWidgetPath);
   
Loading
Loading
Loading
@@ -7,7 +7,7 @@ import CiIcon from './ci_icon.vue';
Loading
@@ -7,7 +7,7 @@ import CiIcon from './ci_icon.vue';
* *
* Receives status object containing: * Receives status object containing:
* status: { * status: {
* details_path: "/gitlab-org/gitlab-ce/pipelines/8150156" // url * details_path: "/gitlab-org/gitlab-foss/pipelines/8150156" // url
* group:"running" // used for CSS class * group:"running" // used for CSS class
* icon: "icon_status_running" // used to render the icon * icon: "icon_status_running" // used to render the icon
* label:"running" // used for potential tooltip * label:"running" // used for potential tooltip
Loading
Loading
Loading
@@ -6,7 +6,7 @@ import Icon from '../../vue_shared/components/icon.vue';
Loading
@@ -6,7 +6,7 @@ import Icon from '../../vue_shared/components/icon.vue';
* *
* Receives status object containing: * Receives status object containing:
* status: { * status: {
* details_path: "/gitlab-org/gitlab-ce/pipelines/8150156" // url * details_path: "/gitlab-org/gitlab-foss/pipelines/8150156" // url
* group:"running" // used for CSS class * group:"running" // used for CSS class
* icon: "icon_status_running" // used to render the icon * icon: "icon_status_running" // used to render the icon
* label:"running" // used for potential tooltip * label:"running" // used for potential tooltip
Loading
Loading
<script> <script>
import _ from 'underscore'; import _ from 'underscore';
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon, GlSearchBoxByType } from '@gitlab/ui';
import ProjectListItem from './project_list_item.vue'; import ProjectListItem from './project_list_item.vue';
   
const SEARCH_INPUT_TIMEOUT_MS = 500; const SEARCH_INPUT_TIMEOUT_MS = 500;
Loading
@@ -9,6 +9,7 @@ export default {
Loading
@@ -9,6 +9,7 @@ export default {
name: 'ProjectSelector', name: 'ProjectSelector',
components: { components: {
GlLoadingIcon, GlLoadingIcon,
GlSearchBoxByType,
ProjectListItem, ProjectListItem,
}, },
props: { props: {
Loading
@@ -53,9 +54,6 @@ export default {
Loading
@@ -53,9 +54,6 @@ export default {
isSelected(project) { isSelected(project) {
return Boolean(_.findWhere(this.selectedProjects, { id: project.id })); return Boolean(_.findWhere(this.selectedProjects, { id: project.id }));
}, },
focusSearchInput() {
this.$refs.searchInput.focus();
},
onInput: _.debounce(function debouncedOnInput() { onInput: _.debounce(function debouncedOnInput() {
this.$emit('searched', this.searchQuery); this.$emit('searched', this.searchQuery);
}, SEARCH_INPUT_TIMEOUT_MS), }, SEARCH_INPUT_TIMEOUT_MS),
Loading
@@ -64,12 +62,11 @@ export default {
Loading
@@ -64,12 +62,11 @@ export default {
</script> </script>
<template> <template>
<div> <div>
<input <gl-search-box-by-type
ref="searchInput"
v-model="searchQuery" v-model="searchQuery"
:placeholder="__('Search your projects')" :placeholder="__('Search your projects')"
type="search" type="search"
class="form-control mb-3 js-project-selector-input" class="mb-3"
autofocus autofocus
@input="onInput" @input="onInput"
/> />
Loading
Loading
Loading
@@ -342,7 +342,7 @@ input[type=color].form-control {
Loading
@@ -342,7 +342,7 @@ input[type=color].form-control {
/* /*
Bootstrap 4.1.2 introduced a new default vertical alignment which breaks our icons, Bootstrap 4.1.2 introduced a new default vertical alignment which breaks our icons,
so we need to reset the vertical alignment to the default value. See: so we need to reset the vertical alignment to the default value. See:
- https://gitlab.com/gitlab-org/gitlab-ce/issues/51362 - https://gitlab.com/gitlab-org/gitlab-foss/issues/51362
*/ */
svg { svg {
vertical-align: baseline; vertical-align: baseline;
Loading
Loading
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