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 110 additions and 71 deletions
Loading
Loading
@@ -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:
Loading
Loading
Loading
Loading
@@ -4,6 +4,7 @@ pages:
- .default-retry
- .default-cache
- .default-only
- .only-code-qa-changes
only:
refs:
- master
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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"]
Loading
Loading
.tests-metadata-state:
extends: .default-only
extends:
- .default-only
variables:
TESTS_METADATA_S3_BUCKET: "gitlab-ce-cache"
before_script:
Loading
Loading
@@ -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
Loading
Loading
1.62.0
1.64.0
Loading
Loading
@@ -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;
Loading
Loading
/* 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';
Loading
Loading
@@ -82,7 +82,7 @@ MarkdownPreview.prototype.fetchMarkdownPreview = function(text, url, success) {
})
.then(({ data }) => {
this.ajaxCache = {
text: text,
text,
response: data,
};
success(data);
Loading
Loading
/* eslint-disable func-names, object-shorthand, prefer-arrow-callback */
/* eslint-disable func-names, prefer-arrow-callback */
 
import $ from 'jquery';
import Dropzone from 'dropzone';
Loading
Loading
@@ -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',
Loading
Loading
@@ -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);
Loading
Loading
@@ -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();
Loading
Loading
Loading
Loading
@@ -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)}`;
Loading
Loading
@@ -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;
Loading
Loading
@@ -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');
Loading
Loading
/* 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';
 
Loading
Loading
@@ -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);
Loading
Loading
Loading
Loading
@@ -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 = [];
Loading
Loading
@@ -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;
Loading
Loading
@@ -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) {
Loading
Loading
/* 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';
Loading
Loading
@@ -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;
Loading
Loading
@@ -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
});
}
Loading
Loading
@@ -259,12 +260,7 @@ class List {
}
 
onNewIssueResponse(issue, data) {
issue.id = data.id;
issue.iid = data.iid;
issue.project = data.project;
issue.path = data.real_path;
issue.referencePath = data.reference_path;
issue.assignableLabelsEndpoint = data.assignable_labels_endpoint;
issue.refreshData(data);
 
if (this.issuesSize > 1) {
const moveBeforeId = this.issues[1].id;
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
/**
* This file is intended to be deleted.
* The existing functions will removed one by one in favor of using the board store directly.
* see https://gitlab.com/gitlab-org/gitlab-ce/issues/61621
* see https://gitlab.com/gitlab-org/gitlab-foss/issues/61621
*/
 
import boardsStore from '~/boards/stores/boards_store';
Loading
Loading
@@ -32,8 +32,8 @@ export default class BoardService {
return boardsStore.createList(entityId, entityType);
}
 
updateList(id, position) {
return boardsStore.updateList(id, position);
updateList(id, position, collapsed) {
return boardsStore.updateList(id, position, collapsed);
}
 
destroyList(id) {
Loading
Loading
Loading
Loading
@@ -82,7 +82,7 @@ const boardsStore = {
this.state.lists = _.sortBy(this.state.lists, 'position');
})
.catch(() => {
// https://gitlab.com/gitlab-org/gitlab-ce/issues/30821
// https://gitlab.com/gitlab-org/gitlab-foss/issues/30821
});
this.removeBlankState();
},
Loading
Loading
@@ -278,10 +278,11 @@ const boardsStore = {
});
},
 
updateList(id, position) {
updateList(id, position, collapsed) {
return axios.put(`${this.state.endpoints.listsEndpoint}/${id}`, {
list: {
position,
collapsed,
},
});
},
Loading
Loading
// this is just to make ee_else_ce happy and will be cleaned up in https://gitlab.com/gitlab-org/gitlab-ce/issues/59807
// this is just to make ee_else_ce happy and will be cleaned up in https://gitlab.com/gitlab-org/gitlab-foss/issues/59807
 
export default {
initEESpecific() {},
Loading
Loading
Loading
Loading
@@ -54,7 +54,7 @@ export default class VariableList {
environment_scope: {
// We can't use a `.js-` class here because
// gl_dropdown replaces the <input> and doesn't copy over the class
// See https://gitlab.com/gitlab-org/gitlab-ce/issues/42458
// See https://gitlab.com/gitlab-org/gitlab-foss/issues/42458
selector: `input[name="${this.formField}[variables_attributes][][environment_scope]"]`,
default: '*',
},
Loading
Loading
Loading
Loading
@@ -111,15 +111,25 @@ export default class Clusters {
this.initApplications(clusterType);
this.initEnvironments();
 
if (clusterEnvironmentsPath) {
this.fetchEnvironments();
if (clusterEnvironmentsPath && this.environments) {
this.store.toggleFetchEnvironments(true);
this.initPolling(
'fetchClusterEnvironments',
data => this.handleClusterEnvironmentsSuccess(data),
() => this.handleEnvironmentsPollError(),
);
}
 
this.updateContainer(null, this.store.state.status, this.store.state.statusReason);
 
this.addListeners();
if (statusPath && !this.environments) {
this.initPolling();
this.initPolling(
'fetchClusterStatus',
data => this.handleClusterStatusSuccess(data),
() => this.handlePollError(),
);
}
}
 
Loading
Loading
@@ -179,16 +189,9 @@ export default class Clusters {
});
}
 
fetchEnvironments() {
this.store.toggleFetchEnvironments(true);
this.service
.fetchClusterEnvironments()
.then(data => {
this.store.toggleFetchEnvironments(false);
this.store.updateEnvironments(data.data);
})
.catch(() => Clusters.handleError());
handleClusterEnvironmentsSuccess(data) {
this.store.toggleFetchEnvironments(false);
this.store.updateEnvironments(data.data);
}
 
static initDismissableCallout() {
Loading
Loading
@@ -224,21 +227,16 @@ export default class Clusters {
eventHub.$off('uninstallApplication');
}
 
initPolling() {
initPolling(method, successCallback, errorCallback) {
this.poll = new Poll({
resource: this.service,
method: 'fetchData',
successCallback: data => this.handleSuccess(data),
errorCallback: () => Clusters.handleError(),
method,
successCallback,
errorCallback,
});
 
if (!Visibility.hidden()) {
this.poll.makeRequest();
} else {
this.service
.fetchData()
.then(data => this.handleSuccess(data))
.catch(() => Clusters.handleError());
}
 
Visibility.change(() => {
Loading
Loading
@@ -250,11 +248,21 @@ export default class Clusters {
});
}
 
handlePollError() {
this.constructor.handleError();
}
handleEnvironmentsPollError() {
this.store.toggleFetchEnvironments(false);
this.handlePollError();
}
static handleError() {
Flash(s__('ClusterIntegration|Something went wrong on our end.'));
}
 
handleSuccess(data) {
handleClusterStatusSuccess(data) {
const prevStatus = this.store.state.status;
const prevApplicationMap = Object.assign({}, this.store.state.applications);
 
Loading
Loading
Loading
Loading
@@ -17,7 +17,7 @@ export default class ClusterService {
};
}
 
fetchData() {
fetchClusterStatus() {
return axios.get(this.options.endpoint);
}
 
Loading
Loading
Loading
Loading
@@ -218,6 +218,7 @@ export default class ClusterStore {
environmentPath: environment.environment_path,
lastDeployment: environment.last_deployment,
rolloutStatus: {
status: environment.rollout_status ? environment.rollout_status.status : null,
instances: environment.rollout_status ? environment.rollout_status.instances : [],
},
updatedAt: environment.updated_at,
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