Commit 80f61b40 authored by 🤖 GitLab Bot 🤖's avatar 🤖 GitLab Bot 🤖

Add latest changes from gitlab-org/gitlab@master

parent 4ab54c22
Pipeline #82968058 failed with stages
in 38 minutes
......@@ -230,6 +230,7 @@ webpack-dev-server:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .only-code-changes
dependencies: ["setup-test-env", "compile-assets", "compile-assets pull-cache"]
variables:
......
......@@ -4,6 +4,7 @@ pages:
- .default-retry
- .default-cache
- .default-only
- .only-code-qa-changes
only:
refs:
- master
......
......@@ -25,7 +25,9 @@ package-and-qa-manual:
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
package-and-qa-manual:master:
extends: .package-and-qa-base
extends:
- .package-and-qa-base
- .only-code-qa-changes
only:
refs:
- master@gitlab-org/gitlab-foss
......
......@@ -6,6 +6,7 @@ cache gems:
- .default-retry
- .default-cache
- .default-before_script
- .only-code-qa-changes
stage: test
dependencies: ["setup-test-env"]
needs: ["setup-test-env"]
......
.tests-metadata-state:
extends: .default-only
extends:
- .default-only
variables:
TESTS_METADATA_S3_BUCKET: "gitlab-ce-cache"
before_script:
......@@ -31,7 +32,9 @@ retrieve-tests-metadata:
- '[[ ! -d "ee/" ]] || [[ -f $EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH ]] || echo "{}" > ${EE_KNAPSACK_RSPEC_SUITE_REPORT_PATH}'
update-tests-metadata:
extends: .tests-metadata-state
extends:
- .tests-metadata-state
- .only-code-changes
stage: post-test
cache:
key: tests_metadata
......
......@@ -2,7 +2,7 @@ import Vue from 'vue';
import Metrics from '~/monitoring/components/embed.vue';
import { createStore } from '~/monitoring/stores';
// TODO: Handle copy-pasting - https://gitlab.com/gitlab-org/gitlab-ce/issues/64369.
// TODO: Handle copy-pasting - https://gitlab.com/gitlab-org/gitlab-foss/issues/64369.
export default function renderMetrics(elements) {
if (!elements.length) {
return;
......
/* eslint-disable func-names, no-var, object-shorthand, prefer-arrow-callback */
/* eslint-disable func-names, no-var, prefer-arrow-callback */
import $ from 'jquery';
import axios from '~/lib/utils/axios_utils';
......@@ -82,7 +82,7 @@ MarkdownPreview.prototype.fetchMarkdownPreview = function(text, url, success) {
})
.then(({ data }) => {
this.ajaxCache = {
text: text,
text,
response: data,
};
success(data);
......
/* eslint-disable func-names, object-shorthand, prefer-arrow-callback */
/* eslint-disable func-names, prefer-arrow-callback */
import $ from 'jquery';
import Dropzone from 'dropzone';
......@@ -32,7 +32,7 @@ export default class BlobFileDropzone {
url: form.attr('action'),
// Rails uses a hidden input field for PUT
// http://stackoverflow.com/questions/21056482/how-to-set-method-put-in-form-tag-in-rails
method: method,
method,
clickable: true,
uploadMultiple: false,
paramName: 'file',
......@@ -42,7 +42,7 @@ export default class BlobFileDropzone {
addRemoveLinks: true,
previewsContainer: '.dropzone-previews',
headers: csrf.headers,
init: function() {
init() {
this.on('addedfile', function() {
toggleLoading(submitButton, submitButtonLoadingIcon, false);
dropzoneMessage.addClass(HIDDEN_CLASS);
......@@ -69,7 +69,7 @@ export default class BlobFileDropzone {
});
},
// Override behavior of adding error underneath preview
error: function(file, errorMessage) {
error(file, errorMessage) {
const stripped = $('<div/>')
.html(errorMessage)
.text();
......
......@@ -50,6 +50,9 @@ export default Vue.extend({
};
},
computed: {
isLoggedIn() {
return Boolean(gon.current_user_id);
},
counterTooltip() {
const { issuesSize } = this.list;
return `${n__('%d issue', '%d issues', issuesSize)}`;
......@@ -106,7 +109,11 @@ export default Vue.extend({
Sortable.create(this.$el.parentNode, sortableOptions);
},
created() {
if (this.list.isExpandable && AccessorUtilities.isLocalStorageAccessSafe()) {
if (
this.list.isExpandable &&
AccessorUtilities.isLocalStorageAccessSafe() &&
!this.isLoggedIn
) {
const isCollapsed = localStorage.getItem(`${this.uniqueKey}.expanded`) === 'false';
this.list.isExpanded = !isCollapsed;
......@@ -120,10 +127,14 @@ export default Vue.extend({
if (this.list.isExpandable) {
this.list.isExpanded = !this.list.isExpanded;
if (AccessorUtilities.isLocalStorageAccessSafe()) {
if (AccessorUtilities.isLocalStorageAccessSafe() && !this.isLoggedIn) {
localStorage.setItem(`${this.uniqueKey}.expanded`, this.list.isExpanded);
}
if (this.isLoggedIn) {
this.list.update();
}
// When expanding/collapsing, the tooltip on the caret button sometimes stays open.
// Close all tooltips manually to prevent dangling tooltips.
$('.tooltip').tooltip('hide');
......
/* eslint-disable func-names, no-new, promise/catch-or-return */
/* eslint-disable func-names, no-new */
import $ from 'jquery';
import { __ } from '~/locale';
import axios from '~/lib/utils/axios_utils';
import flash from '~/flash';
import CreateLabelDropdown from '../../create_label';
import boardsStore from '../stores/boards_store';
......@@ -26,18 +28,23 @@ $(document)
export default function initNewListDropdown() {
$('.js-new-board-list').each(function() {
const $this = $(this);
const $dropdownToggle = $(this);
const $dropdown = $dropdownToggle.closest('.dropdown');
new CreateLabelDropdown(
$this.closest('.dropdown').find('.dropdown-new-label'),
$this.data('namespacePath'),
$this.data('projectPath'),
$dropdown.find('.dropdown-new-label'),
$dropdownToggle.data('namespacePath'),
$dropdownToggle.data('projectPath'),
);
$this.glDropdown({
$dropdownToggle.glDropdown({
data(term, callback) {
axios.get($this.attr('data-list-labels-path')).then(({ data }) => {
callback(data);
});
axios
.get($dropdownToggle.attr('data-list-labels-path'))
.then(({ data }) => callback(data))
.catch(() => {
$dropdownToggle.data('bs.dropdown').hide();
flash(__('Error fetching labels.'));
});
},
renderRow(label) {
const active = boardsStore.findListByLabelId(label.id);
......
......@@ -11,11 +11,6 @@ import boardsStore from '../stores/boards_store';
class ListIssue {
constructor(obj, defaultAvatar) {
this.id = obj.id;
this.iid = obj.iid;
this.title = obj.title;
this.confidential = obj.confidential;
this.dueDate = obj.due_date;
this.subscribed = obj.subscribed;
this.labels = [];
this.assignees = [];
......@@ -25,6 +20,16 @@ class ListIssue {
subscriptions: true,
};
this.isLoading = {};
this.refreshData(obj, defaultAvatar);
}
refreshData(obj, defaultAvatar) {
this.id = obj.id;
this.iid = obj.iid;
this.title = obj.title;
this.confidential = obj.confidential;
this.dueDate = obj.due_date;
this.sidebarInfoEndpoint = obj.issue_sidebar_endpoint;
this.referencePath = obj.reference_path;
this.path = obj.real_path;
......@@ -42,11 +47,13 @@ class ListIssue {
this.milestone_id = obj.milestone.id;
}
obj.labels.forEach(label => {
this.labels.push(new ListLabel(label));
});
if (obj.labels) {
this.labels = obj.labels.map(label => new ListLabel(label));
}
this.assignees = obj.assignees.map(a => new ListAssignee(a, defaultAvatar));
if (obj.assignees) {
this.assignees = obj.assignees.map(a => new ListAssignee(a, defaultAvatar));
}
}
addLabel(label) {
......
/* eslint-disable no-underscore-dangle, class-methods-use-this, consistent-return, no-shadow, no-param-reassign */
/* eslint-disable no-underscore-dangle, class-methods-use-this, consistent-return, no-shadow */
import { __ } from '~/locale';
import ListLabel from './label';
......@@ -45,7 +45,7 @@ class List {
const typeInfo = this.getTypeInfo(this.type);
this.preset = Boolean(typeInfo.isPreset);
this.isExpandable = Boolean(typeInfo.isExpandable);
this.isExpanded = true;
this.isExpanded = !obj.collapsed;
this.page = 1;
this.loading = true;
this.loadingMore = false;
......@@ -113,7 +113,8 @@ class List {
}
update() {
gl.boardService.updateList(this.id, this.position).catch(() => {
const collapsed = !this.isExpanded;
return gl.boardService.updateList(this.id, this.position, collapsed).catch(() => {
// TODO: handle request error
});