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

Add latest changes from gitlab-org/gitlab@master

parent cd52759e
No related branches found
No related tags found
No related merge requests found
Showing
with 258 additions and 55 deletions
Loading
Loading
@@ -80,6 +80,9 @@
- "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
 
.frontend-dependency-patterns: &frontend-dependency-patterns
- "{package.json,yarn.lock}"
.qa-patterns: &qa-patterns
- ".dockerignore"
- "qa/**/*"
Loading
Loading
@@ -270,6 +273,9 @@
rules:
- <<: *if-master-refs
when: on_success
- <<: *if-merge-request
changes: *frontend-dependency-patterns
when: on_success
 
################
# Memory rules #
Loading
Loading
<script>
import { Sortable, MultiDrag } from 'sortablejs';
import { GlLoadingIcon } from '@gitlab/ui';
import _ from 'underscore';
import boardNewIssue from './board_new_issue.vue';
import boardCard from './board_card.vue';
import eventHub from '../eventhub';
Loading
Loading
@@ -266,11 +265,12 @@ export default {
* same list or the other list. Don't remove items if it's same list.
*/
const isSameList = toList && toList.id === this.list.id;
if (toList && !isSameList && boardsStore.shouldRemoveIssue(this.list, toList)) {
const issues = items.map(item => this.list.findIssue(Number(item.dataset.issueId)));
if (_.compact(issues).length && !boardsStore.issuesAreContiguous(this.list, issues)) {
if (
issues.filter(Boolean).length &&
!boardsStore.issuesAreContiguous(this.list, issues)
) {
const indexes = [];
const ids = this.list.issues.map(i => i.id);
issues.forEach(issue => {
Loading
Loading
<script>
import { throttle } from 'underscore';
import { throttle } from 'lodash';
import {
GlLoadingIcon,
GlSearchBoxByType,
Loading
Loading
<script>
import _ from 'underscore';
import { sortBy } from 'lodash';
import { mapState } from 'vuex';
import { GlLabel, GlTooltipDirective } from '@gitlab/ui';
import issueCardInner from 'ee_else_ce/boards/mixins/issue_card_inner';
Loading
Loading
@@ -100,10 +100,7 @@ export default {
return !groupId ? referencePath.split('#')[0] : null;
},
orderedLabels() {
return _.chain(this.issue.labels)
.filter(this.isNonListLabel)
.sortBy('title')
.value();
return sortBy(this.issue.labels.filter(this.isNonListLabel), 'title');
},
helpLink() {
return boardsStore.scopedLabels.helpLink;
Loading
Loading
<script>
import $ from 'jquery';
import _ from 'underscore';
import { escape } from 'lodash';
import { GlLoadingIcon } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import { __ } from '~/locale';
Loading
Loading
@@ -83,7 +83,7 @@ export default {
}" data-project-name="${project.name}" data-project-name-with-namespace="${
project.name_with_namespace
}">
${_.escape(project.name_with_namespace)}
${escape(project.name_with_namespace)}
</a>
</li>
`;
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@
/* global List */
 
import $ from 'jquery';
import _ from 'underscore';
import { sortBy } from 'lodash';
import Vue from 'vue';
import Cookies from 'js-cookie';
import BoardsStoreEE from 'ee_else_ce/boards/stores/boards_store_ee';
Loading
Loading
@@ -76,8 +76,7 @@ const boardsStore = {
},
addList(listObj) {
const list = new List(listObj);
this.state.lists = _.sortBy([...this.state.lists, list], 'position');
this.state.lists = sortBy([...this.state.lists, list], 'position');
return list;
},
new(listObj) {
Loading
Loading
@@ -90,7 +89,7 @@ const boardsStore = {
// Remove any new issues from the backlog
// as they will be visible in the new list
list.issues.forEach(backlogList.removeIssue.bind(backlogList));
this.state.lists = _.sortBy(this.state.lists, 'position');
this.state.lists = sortBy(this.state.lists, 'position');
})
.catch(() => {
// https://gitlab.com/gitlab-org/gitlab-foss/issues/30821
Loading
Loading
@@ -194,10 +193,9 @@ const boardsStore = {
 
moveMultipleIssuesToList({ listFrom, listTo, issues, newIndex }) {
const issueTo = issues.map(issue => listTo.findIssue(issue.id));
const issueLists = _.flatten(issues.map(issue => issue.getLists()));
const issueLists = issues.map(issue => issue.getLists()).flat();
const listLabels = issueLists.map(list => list.label);
const hasMoveableIssues = _.compact(issueTo).length > 0;
const hasMoveableIssues = issueTo.filter(Boolean).length > 0;
 
if (!hasMoveableIssues) {
// Check if target list assignee is already present in this issue
Loading
Loading
Loading
Loading
@@ -315,10 +315,13 @@ export default class Clusters {
 
this.checkForNewInstalls(prevApplicationMap, this.store.state.applications);
this.updateContainer(prevStatus, this.store.state.status, this.store.state.statusReason);
this.toggleIngressDomainHelpText(
prevApplicationMap[INGRESS],
this.store.state.applications[INGRESS],
);
if (this.ingressDomainHelpText) {
this.toggleIngressDomainHelpText(
prevApplicationMap[INGRESS],
this.store.state.applications[INGRESS],
);
}
}
 
showToken() {
Loading
Loading
Loading
Loading
@@ -263,7 +263,6 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity
 
<template>
<section id="cluster-applications">
<h4>{{ s__('ClusterIntegration|Applications') }}</h4>
<p class="append-bottom-0">
{{
s__(`ClusterIntegration|Choose which applications to install on your Kubernetes cluster.
Loading
Loading
const BOLD = 'bold';
const ITALIC = 'italic';
const BOLD_ITALIC = 'bold italic';
const UNDERLINE = 'underline';
export default {
base: 'vs',
inherit: true,
rules: [],
inherit: false,
rules: [
// Standard theme defaults and overrides based on VS theme
// https://github.com/Microsoft/vscode/blob/master/src/vs/editor/standalone/common/themes.ts
// License: MIT (https://github.com/microsoft/vscode/blob/master/LICENSE.txt)
{ token: '', foreground: '2e2e2e', background: 'ffffff' },
{ token: 'keyword.css', fontStyle: BOLD, foreground: '999999' },
{ token: 'keyword.less', fontStyle: BOLD, foreground: '999999' },
{ token: 'keyword.scss', fontStyle: BOLD, foreground: '999999' },
{ token: 'keyword.md', fontStyle: BOLD, foreground: '800080' },
{ token: 'variable', foreground: '008080' },
{ token: 'variable.md', foreground: 'dd1144' },
{ token: 'variable.predefined', foreground: '008080' },
{ token: 'number', foreground: '009999' },
{ token: 'number.hex', foreground: '3030c0' },
{ token: 'type.identifier.ts', foreground: '445588', fontStyle: BOLD },
{ token: 'type.identifier.swift', foreground: '445588', fontStyle: BOLD },
{ token: 'type.identifier.kt', foreground: '445588', fontStyle: BOLD },
{ token: 'type.identifier.perl', foreground: '2e2e2e', fontStyle: BOLD },
{ token: 'tag', foreground: '000080' },
{ token: 'tag.class', foreground: '445588', fontStyle: BOLD },
{ token: 'tag.css', foreground: '445588', fontStyle: BOLD },
{ token: 'tag.less', foreground: '445588', fontStyle: BOLD },
{ token: 'tag.scss', foreground: '445588', fontStyle: BOLD },
{ token: 'tag.id.jade', foreground: '445588' },
{ token: 'tag.class.jade', foreground: '445588' },
{ token: 'meta.scss', foreground: '800000' },
{ token: 'metatag', foreground: 'e00000' },
{ token: 'metatag.content.html', foreground: 'e00000' },
{ token: 'metatag.html', foreground: '808080' },
{ token: 'metatag.xml', foreground: '808080' },
{ token: 'metatag.php', fontStyle: BOLD },
{ token: 'key', foreground: '863b00' },
{ token: 'key.ini', foreground: '008080' },
{ token: 'string.key.json', foreground: '2e2e2e' },
{ token: 'string.value.json', foreground: 'dd1144' },
{ token: 'string.link.md', foreground: 'aa0000' },
{ token: 'attribute.name', foreground: '008080' },
{ token: 'attribute.name.css', foreground: '2e2e2e' },
{ token: 'attribute.name.json', foreground: '2e2e2e' },
{ token: 'attribute.name.scss', foreground: '2e2e2e' },
{ token: 'attribute.name.less', foreground: '2e2e2e' },
{ token: 'attribute.value', foreground: 'dd1144' },
{ token: 'attribute.value.css', foreground: '0086b3' },
{ token: 'attribute.value.hex', foreground: '0086b3' },
{ token: 'attribute.value.number', foreground: '009999' },
{ token: 'attribute.value.unit', foreground: '009999' },
{ token: 'attribute.value.xml', foreground: 'dd1144' },
{ token: 'attribute.value.html', foreground: 'dd1144' },
{ token: 'attribute.value.md', foreground: 'aa0000' },
{ token: 'string', foreground: 'dd1144' },
{ token: 'string.target', foreground: 'aa0000' },
{ token: 'string.sql', foreground: 'dd1144' },
{ token: 'keyword.flow', foreground: '2e2e2e', fontStyle: BOLD },
{ token: 'keyword.st', foreground: '445588', fontStyle: BOLD },
{ token: 'variable.st', foreground: '445588', fontStyle: BOLD },
{ token: 'type.st', foreground: '445588', fontStyle: BOLD },
{ token: 'operator.scss', foreground: '666666' },
{ token: 'operator.sql', foreground: '2e2e2e', fontStyle: BOLD },
{ token: 'operator.swift', foreground: '666666' },
{ token: 'predefined.sql', foreground: '2e2e2e', fontStyle: BOLD },
// GitHub theme based on https://github.com/brijeshb42/monaco-themes/blob/master/themes/GitHub.json
// Customized for Web IDE
// License: MIT (https://github.com/brijeshb42/monaco-themes/blob/master/LICENSE)
{ token: 'comment', foreground: '999988', fontStyle: ITALIC },
{ token: 'comment.block.preprocessor', foreground: '999999', fontStyle: BOLD },
{ token: 'comment.documentation', foreground: '999999', fontStyle: BOLD_ITALIC },
{ token: 'comment.block.documentation', foreground: '999999', fontStyle: BOLD_ITALIC },
{ token: 'invalid.illegal', foreground: 'aa0000', background: 'e3d2d2' },
{ token: 'keyword', fontStyle: BOLD, foreground: '2e2e2e' },
{ token: 'storage', fontStyle: BOLD },
{ token: 'keyword.operator', fontStyle: BOLD },
{ token: 'constant.language', fontStyle: BOLD },
{ token: 'support.constant', fontStyle: BOLD },
{ token: 'storage.type', foreground: '445588', fontStyle: BOLD },
{ token: 'support.type', foreground: '445588', fontStyle: BOLD },
{ token: 'entity.other.attribute-name', foreground: '008080' },
{ token: 'variable.other', foreground: '0086b3' },
{ token: 'variable.language', foreground: '999999' },
{ token: 'entity.name.type', foreground: '445588', fontStyle: BOLD },
{ token: 'entity.other.inherited-class', foreground: '445588', fontStyle: BOLD },
{ token: 'support.class', foreground: '445588', fontStyle: BOLD },
{ token: 'variable.other.constant', foreground: '008080' },
{ token: 'constant.character.entity', foreground: '800080' },
{ token: 'entity.name.exception', foreground: 'aa0000' },
{ token: 'entity.name.function', foreground: 'aa0000' },
{ token: 'support.function', foreground: 'aa0000' },
{ token: 'keyword.other.name-of-parameter', foreground: 'aa0000' },
{ token: 'entity.name.section', foreground: '666666' },
{ token: 'entity.name.tag', foreground: '000080' },
{ token: 'variable.parameter', foreground: '008080' },
{ token: 'support.variable', foreground: '008080' },
{ token: 'constant.numeric', foreground: '009999' },
{ token: 'constant.other', foreground: '009999' },
{ token: 'constant.character', foreground: 'dd1144' },
{ token: 'string.regexp', foreground: '009926' },
{ token: 'constant.other.symbol', foreground: '990073' },
{ token: 'punctuation', fontStyle: BOLD },
{ token: 'markup.deleted', foreground: '000000', background: 'ffdddd' },
{ token: 'markup.italic', fontStyle: ITALIC },
{ token: 'markup.error', foreground: 'aa0000' },
{ token: 'markup.heading.1', foreground: '999999' },
{ token: 'markup.inserted', foreground: '000000', background: 'ddffdd' },
{ token: 'markup.output', foreground: '808080' },
{ token: 'markup.raw', foreground: '808080' },
{ token: 'markup.prompt', foreground: '666666' },
{ token: 'markup.bold', fontStyle: BOLD },
{ token: 'markup.heading', foreground: '999999' },
{ token: 'markup.traceback', foreground: 'aa0000' },
{ token: 'markup.underline', fontStyle: UNDERLINE },
{ token: 'meta.diff.range', foreground: '999999', background: 'eaf2f5' },
{ token: 'meta.diff.index', foreground: '999999', background: 'eaf2f5' },
{ token: 'meta.separator', foreground: '999999', background: 'eaf2f5' },
{ token: 'meta.diff.header.from-file', foreground: '999999', background: 'ffdddd' },
{ token: 'meta.diff.header.to-file', foreground: '999999', background: 'ddffdd' },
{ token: 'meta.link', foreground: '4183c4' },
],
colors: {
'editorLineNumber.foreground': '#CCCCCC',
'diffEditor.insertedTextBackground': '#A0F5B420',
'diffEditor.removedTextBackground': '#f9d7dc20',
'editor.foreground': '#2e2e2e',
'editor.selectionBackground': '#aad6f8',
'editor.lineHighlightBackground': '#fffeeb',
'editorCursor.foreground': '#666666',
'editorWhitespace.foreground': '#bbbbbb',
'editorLineNumber.foreground': '#cccccc',
'diffEditor.insertedTextBackground': '#a0f5b420',
'diffEditor.removedTextBackground': '#f9d7dc20',
'editorIndentGuide.activeBackground': '#cccccc',
},
};
Loading
Loading
@@ -67,7 +67,7 @@ export default {
</template>
</expand-button>
<clipboard-button
:title="__('Copy commit SHA')"
:title="__('Copy evidence SHA')"
:text="sha"
css-class="btn-default btn-transparent btn-clipboard"
/>
Loading
Loading
Loading
Loading
@@ -93,7 +93,10 @@ export default {
<release-block-header :release="release" />
<div class="card-body">
<div v-if="shouldRenderMilestoneInfo">
<release-block-milestone-info :milestones="milestones" />
<release-block-milestone-info
:milestones="milestones"
:open-issues-path="release._links.issuesUrl"
/>
<hr class="mb-3 mt-0" />
</div>
 
Loading
Loading
Loading
Loading
@@ -34,7 +34,7 @@ export default {
 
<ul v-if="assets.links.length" class="pl-0 mb-0 prepend-top-8 list-unstyled js-assets-list">
<li v-for="link in assets.links" :key="link.name" class="append-bottom-8">
<gl-link v-gl-tooltip.bottom :title="__('Download asset')" :href="link.url">
<gl-link v-gl-tooltip.bottom :title="__('Download asset')" :href="link.directAssetUrl">
<icon name="package" class="align-middle append-right-4 align-text-bottom" />
{{ link.name }}
<span v-if="link.external">{{ __('(external source)') }}</span>
Loading
Loading
<script>
import { GlProgressBar, GlLink, GlBadge, GlButton, GlTooltipDirective } from '@gitlab/ui';
import {
GlProgressBar,
GlLink,
GlBadge,
GlButton,
GlTooltipDirective,
GlSprintf,
} from '@gitlab/ui';
import { __, n__, sprintf } from '~/locale';
import { MAX_MILESTONES_TO_DISPLAY } from '../constants';
/** Sums the values of an array. For use with Array.reduce. */
const sumReducer = (acc, curr) => acc + curr;
import { sum } from 'lodash';
 
export default {
name: 'ReleaseBlockMilestoneInfo',
Loading
Loading
@@ -13,6 +18,7 @@ export default {
GlLink,
GlBadge,
GlButton,
GlSprintf,
},
directives: {
GlTooltip: GlTooltipDirective,
Loading
Loading
@@ -22,6 +28,16 @@ export default {
type: Array,
required: true,
},
openIssuesPath: {
type: String,
required: false,
default: '',
},
closedIssuesPath: {
type: String,
required: false,
default: '',
},
},
data() {
return {
Loading
Loading
@@ -42,14 +58,14 @@ export default {
allIssueStats() {
return this.milestones.map(m => m.issueStats || {});
},
openIssuesCount() {
return this.allIssueStats.map(stats => stats.opened || 0).reduce(sumReducer);
totalIssuesCount() {
return sum(this.allIssueStats.map(stats => stats.total || 0));
},
closedIssuesCount() {
return this.allIssueStats.map(stats => stats.closed || 0).reduce(sumReducer);
return sum(this.allIssueStats.map(stats => stats.closed || 0));
},
totalIssuesCount() {
return this.openIssuesCount + this.closedIssuesCount;
openIssuesCount() {
return this.totalIssuesCount - this.closedIssuesCount;
},
milestoneLabelText() {
return n__('Milestone', 'Milestones', this.milestones.length);
Loading
Loading
@@ -130,7 +146,27 @@ export default {
{{ __('Issues') }}
<gl-badge pill variant="light" class="font-weight-bold">{{ totalIssuesCount }}</gl-badge>
</span>
{{ issueCountsText }}
<div class="d-flex">
<gl-link v-if="openIssuesPath" ref="openIssuesLink" :href="openIssuesPath">
<gl-sprintf :message="__('Open: %{openIssuesCount}')">
<template #openIssuesCount>{{ openIssuesCount }}</template>
</gl-sprintf>
</gl-link>
<span v-else ref="openIssuesText">
{{ sprintf(__('Open: %{openIssuesCount}'), { openIssuesCount }) }}
</span>
<span class="mx-1">&bull;</span>
<gl-link v-if="closedIssuesPath" ref="closedIssuesLink" :href="closedIssuesPath">
<gl-sprintf :message="__('Closed: %{closedIssuesCount}')">
<template #closedIssuesCount>{{ closedIssuesCount }}</template>
</gl-sprintf>
</gl-link>
<span v-else ref="closedIssuesText">
{{ sprintf(__('Closed: %{closedIssuesCount}'), { closedIssuesCount }) }}
</span>
</div>
</div>
</div>
</template>
Loading
Loading
@@ -307,7 +307,7 @@ class ApplicationController < ActionController::Base
if current_user && current_user.requires_ldap_check?
return unless current_user.try_obtain_ldap_lease
 
unless Gitlab::Auth::LDAP::Access.allowed?(current_user)
unless Gitlab::Auth::Ldap::Access.allowed?(current_user)
sign_out current_user
flash[:alert] = _("Access denied for your LDAP account.")
redirect_to new_user_session_path
Loading
Loading
Loading
Loading
@@ -30,9 +30,9 @@ module SnippetsActions
end
 
def check_repository_error
repository_error = snippet.errors.delete(:repository)
repository_errors = Array(snippet.errors.delete(:repository))
 
flash.now[:alert] = repository_error if repository_error
recaptcha_check_with_fallback(repository_error.nil?) { render :edit }
flash.now[:alert] = repository_errors.first if repository_errors.present?
recaptcha_check_with_fallback(repository_errors.empty?) { render :edit }
end
end
Loading
Loading
@@ -4,9 +4,9 @@ class Ldap::OmniauthCallbacksController < OmniauthCallbacksController
extend ::Gitlab::Utils::Override
 
def self.define_providers!
return unless Gitlab::Auth::LDAP::Config.sign_in_enabled?
return unless Gitlab::Auth::Ldap::Config.sign_in_enabled?
 
Gitlab::Auth::LDAP::Config.available_servers.each do |server|
Gitlab::Auth::Ldap::Config.available_servers.each do |server|
alias_method server['provider_name'], :ldap
end
end
Loading
Loading
@@ -14,9 +14,9 @@ class Ldap::OmniauthCallbacksController < OmniauthCallbacksController
# We only find ourselves here
# if the authentication to LDAP was successful.
def ldap
return unless Gitlab::Auth::LDAP::Config.sign_in_enabled?
return unless Gitlab::Auth::Ldap::Config.sign_in_enabled?
 
sign_in_user_flow(Gitlab::Auth::LDAP::User)
sign_in_user_flow(Gitlab::Auth::Ldap::User)
end
 
define_providers!
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ class Projects::ReleasesController < Projects::ApplicationController
before_action :release, only: %i[edit show update downloads]
before_action :authorize_read_release!
before_action do
push_frontend_feature_flag(:release_issue_summary, project)
push_frontend_feature_flag(:release_issue_summary, project, default_enabled: true)
push_frontend_feature_flag(:release_evidence_collection, project, default_enabled: true)
push_frontend_feature_flag(:release_show_page, project, default_enabled: true)
end
Loading
Loading
Loading
Loading
@@ -273,8 +273,8 @@ class SessionsController < Devise::SessionsController
 
def ldap_servers
@ldap_servers ||= begin
if Gitlab::Auth::LDAP::Config.sign_in_enabled?
Gitlab::Auth::LDAP::Config.available_servers
if Gitlab::Auth::Ldap::Config.sign_in_enabled?
Gitlab::Auth::Ldap::Config.available_servers
else
[]
end
Loading
Loading
Loading
Loading
@@ -5,11 +5,11 @@ module AuthHelper
LDAP_PROVIDER = /\Aldap/.freeze
 
def ldap_enabled?
Gitlab::Auth::LDAP::Config.enabled?
Gitlab::Auth::Ldap::Config.enabled?
end
 
def ldap_sign_in_enabled?
Gitlab::Auth::LDAP::Config.sign_in_enabled?
Gitlab::Auth::Ldap::Config.sign_in_enabled?
end
 
def omniauth_enabled?
Loading
Loading
Loading
Loading
@@ -26,11 +26,38 @@ module ClustersHelper
end
end
 
def render_cluster_info_tab_content(tab, expanded)
case tab
when 'environments'
render_if_exists 'clusters/clusters/environments'
when 'health'
render_if_exists 'clusters/clusters/health'
when 'apps'
render 'applications'
when 'settings'
render 'advanced_settings_container'
else
render('details', expanded: expanded)
end
end
def has_rbac_enabled?(cluster)
return cluster.platform_kubernetes_rbac? if cluster.platform_kubernetes
 
cluster.provider.has_rbac_enabled?
end
def project_cluster?(cluster)
cluster.cluster_type.in?('project_type')
end
def cluster_created?(cluster)
!cluster.status_name.in?(%i/scheduled creating/)
end
def can_admin_cluster?(user, cluster)
can?(user, :admin_cluster, cluster)
end
end
 
ClustersHelper.prepend_if_ee('EE::ClustersHelper')
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