Skip to content

Commit

Permalink
Add latest changes from gitlab-org/gitlab@master
Browse files Browse the repository at this point in the history
  • Loading branch information
GitLab Bot committed Sep 14, 2020
1 parent a8caa9c commit 9689350
Show file tree
Hide file tree
Showing 53 changed files with 369 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export const ISSUABLE_TYPES = {
INCIDENT: 'incident',
};

export const SIDEBAR_ANIMATION_DURATION = 300;

export const I18N = {
UPDATE_SEVERITY_ERROR: s__('SeverityWidget|There was an error while updating severity.'),
TRY_AGAIN: __('Please try again'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
GlSprintf,
GlLink,
} from '@gitlab/ui';
import { INCIDENT_SEVERITY, ISSUABLE_TYPES, SIDEBAR_ANIMATION_DURATION, I18N } from './constants';
import { INCIDENT_SEVERITY, ISSUABLE_TYPES, I18N } from './constants';
import updateIssuableSeverity from './graphql/mutations/update_issuable_severity.mutation.graphql';
import SeverityToken from './severity.vue';
import createFlash from '~/flash';
Expand Down Expand Up @@ -91,15 +91,8 @@ export default {
const event = new Event('hidden.gl.dropdown');
this.$el.dispatchEvent(event);
},
toggleFormDropdown(collapsedSidebar) {
toggleFormDropdown() {
this.isDropdownShowing = !this.isDropdownShowing;
const timeout = collapsedSidebar ? SIDEBAR_ANIMATION_DURATION : 0;
setTimeout(() => {
const { dropdown } = this.$refs;
if (dropdown && this.isDropdownShowing) {
dropdown.show();
}
}, timeout);
},
updateSeverity(value) {
this.hideDropdown();
Expand Down Expand Up @@ -143,7 +136,7 @@ export default {

<template>
<div ref="sidebarSeverity" class="block">
<div ref="severity" class="sidebar-collapsed-icon" @click="toggleFormDropdown(true)">
<div ref="severity" class="sidebar-collapsed-icon" @click="toggleFormDropdown">
<severity-token :severity="selectedItem" :icon-size="14" :icon-only="true" />
<gl-tooltip :target="() => $refs.severity" boundary="viewport" placement="left">
<gl-sprintf :message="$options.i18n.SEVERITY_VALUE">
Expand All @@ -168,7 +161,6 @@ export default {
</p>

<gl-dropdown
ref="dropdown"
:class="dropdownClass"
block
:text="selectedItem.label"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
GlFilteredSearchToken,
GlAvatar,
GlFilteredSearchSuggestion,
GlDeprecatedDropdownDivider,
GlDropdownDivider,
GlLoadingIcon,
} from '@gitlab/ui';
import { debounce } from 'lodash';
Expand All @@ -18,7 +18,7 @@ export default {
GlFilteredSearchToken,
GlAvatar,
GlFilteredSearchSuggestion,
GlDeprecatedDropdownDivider,
GlDropdownDivider,
GlLoadingIcon,
},
props: {
Expand Down Expand Up @@ -106,7 +106,7 @@ export default {
>
{{ author.text }}
</gl-filtered-search-suggestion>
<gl-deprecated-dropdown-divider v-if="defaultAuthors.length" />
<gl-dropdown-divider v-if="defaultAuthors.length" />
<gl-loading-icon v-if="loading" />
<template v-else>
<gl-filtered-search-suggestion
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/projects/product_analytics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def graphs
.new(project, { graph: graph, timerange: @timerange })
.execute
end

@activity_graph = ProductAnalytics::BuildActivityGraphService
.new(project, { timerange: @timerange })
.execute
end

private
Expand Down
4 changes: 4 additions & 0 deletions app/graphql/mutations/boards/issues/issue_move_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def ready?(**args)
end

def resolve(board:, **args)
Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab/-/issues/247861')

raise_resource_not_available_error! unless board
authorize_board!(board)

Expand Down Expand Up @@ -89,3 +91,5 @@ def authorize_board!(board)
end
end
end

Mutations::Boards::Issues::IssueMoveList.prepend_if_ee('EE::Mutations::Boards::Issues::IssueMoveList')
9 changes: 8 additions & 1 deletion app/helpers/wiki_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ def wiki_page_errors(error)
end

def wiki_attachment_upload_url
expose_url(api_v4_projects_wikis_attachments_path(id: @wiki.container.id))
case @wiki.container
when Project
expose_url(api_v4_projects_wikis_attachments_path(id: @wiki.container.id))
else
raise TypeError, "Unsupported wiki container #{@wiki.container.class}"
end
end

def wiki_sort_controls(wiki, sort, direction)
Expand Down Expand Up @@ -147,3 +152,5 @@ def show_enable_confluence_integration?(container)
!container.has_confluence?
end
end

WikiHelper.prepend_if_ee('EE::WikiHelper')
2 changes: 1 addition & 1 deletion app/models/merge_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ def has_accessibility_reports?
end

def has_coverage_reports?
return false unless Feature.enabled?(:coverage_report_view, project)
return false unless Feature.enabled?(:coverage_report_view, project, default_enabled: true)

actual_head_pipeline&.has_coverage_reports?
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/packages/pypi/metadatum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Packages::Pypi::Metadatum < ApplicationRecord
belongs_to :package, -> { where(package_type: :pypi) }, inverse_of: :pypi_metadatum

validates :package, presence: true
validates :required_python, length: { maximum: 50 }, allow_blank: true
validates :required_python, length: { maximum: 255 }, allow_blank: true

validate :pypi_package_type

Expand Down
7 changes: 7 additions & 0 deletions app/models/product_analytics_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def self.count_by_graph(graph, days)
group(graph).timerange(days).count
end

def self.count_collector_tstamp_by_day(days)
group("DATE_TRUNC('day', collector_tstamp)")
.reorder('date_trunc_day_collector_tstamp')
.timerange(days)
.count
end

def as_json_wo_empty
as_json.compact
end
Expand Down
4 changes: 4 additions & 0 deletions app/services/boards/issues/move_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ def move_between_lists?

# rubocop: disable CodeReuse/ActiveRecord
def moving_from_list
return unless params[:from_list_id].present?

@moving_from_list ||= board.lists.find_by(id: params[:from_list_id])
end
# rubocop: enable CodeReuse/ActiveRecord

# rubocop: disable CodeReuse/ActiveRecord
def moving_to_list
return unless params[:to_list_id].present?

@moving_to_list ||= board.lists.find_by(id: params[:to_list_id])
end
# rubocop: enable CodeReuse/ActiveRecord
Expand Down
13 changes: 13 additions & 0 deletions app/services/product_analytics/build_activity_graph_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module ProductAnalytics
class BuildActivityGraphService < BuildGraphService
def execute
timerange = @params[:timerange].days

results = product_analytics_events.count_collector_tstamp_by_day(timerange)

format_results('collector_tstamp', results.transform_keys(&:to_date))
end
end
end
10 changes: 7 additions & 3 deletions app/services/product_analytics/build_graph_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ def execute

results = product_analytics_events.count_by_graph(graph, timerange)

format_results(graph, results)
end

private

def format_results(name, results)
{
id: graph,
id: name,
keys: results.keys,
values: results.values
}
end

private

def product_analytics_events
@project.product_analytics_events
end
Expand Down
6 changes: 3 additions & 3 deletions app/views/admin/users/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@

.form-actions
- if @user.new_record?
= f.submit 'Create user', class: "btn btn-success"
= f.submit 'Create user', class: "btn gl-button btn-success"
= link_to 'Cancel', admin_users_path, class: "btn btn-cancel"
- else
= f.submit 'Save changes', class: "btn btn-success"
= link_to 'Cancel', admin_user_path(@user), class: "btn btn-cancel"
= f.submit 'Save changes', class: "btn gl-button btn-success"
= link_to 'Cancel', admin_user_path(@user), class: "btn gl-button btn-cancel"
12 changes: 6 additions & 6 deletions app/views/admin/users/_user.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
- unless user.internal?
.table-section.section-20.table-button-footer
.table-action-buttons
= link_to _('Edit'), edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: 'btn btn-default'
= link_to _('Edit'), edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: 'btn gl-button btn-default'
- unless user == current_user
%button.dropdown-new.btn.btn-default{ type: 'button', data: { toggle: 'dropdown' } }
%button.dropdown-new.btn.gl-button.btn-default{ type: 'button', data: { toggle: 'dropdown' } }
= sprite_icon('settings')
= sprite_icon('chevron-down')
%ul.dropdown-menu.dropdown-menu-right
Expand All @@ -32,13 +32,13 @@
- elsif user.blocked?
= link_to _('Unblock'), unblock_admin_user_path(user), method: :put
- else
%button.btn{ data: { 'gl-modal-action': 'block',
%button.btn.gl-button.btn-default-tertiary{ data: { 'gl-modal-action': 'block',
url: block_admin_user_path(user),
username: sanitize_name(user.name) } }
= s_('AdminUsers|Block')
- if user.can_be_deactivated?
%li
%button.btn{ data: { 'gl-modal-action': 'deactivate',
%button.btn.gl-button.btn-default-tertiary{ data: { 'gl-modal-action': 'deactivate',
url: deactivate_admin_user_path(user),
username: sanitize_name(user.name) } }
= s_('AdminUsers|Deactivate')
Expand All @@ -52,13 +52,13 @@
%li.divider
- if user.can_be_removed?
%li
%button.delete-user-button.btn.text-danger{ data: { 'gl-modal-action': 'delete',
%button.delete-user-button.btn.gl-button.btn-default-tertiary.text-danger{ data: { 'gl-modal-action': 'delete',
delete_user_url: admin_user_path(user),
block_user_url: block_admin_user_path(user),
username: sanitize_name(user.name) } }
= s_('AdminUsers|Delete user')
%li
%button.delete-user-button.btn.text-danger{ data: { 'gl-modal-action': 'delete-with-contributions',
%button.delete-user-button.btn.gl-button.btn-default-tertiary.text-danger{ data: { 'gl-modal-action': 'delete-with-contributions',
delete_user_url: admin_user_path(user, hard_delete: true),
block_user_url: block_admin_user_path(user),
username: sanitize_name(user.name) } }
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/users/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
%small.badge.badge-pill= limited_counter_with_delimiter(User.without_projects)
.nav-controls
= render_if_exists 'admin/users/admin_email_users'
= link_to s_('AdminUsers|New user'), new_admin_user_path, class: 'btn btn-success btn-search float-right'
= link_to s_('AdminUsers|New user'), new_admin_user_path, class: 'btn gl-button btn-success btn-search float-right'

.filtered-search-block.row-content-block.border-top-0
= form_tag admin_users_path, method: :get do
Expand Down
18 changes: 9 additions & 9 deletions app/views/admin/users/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
%strong{ class: @user.two_factor_enabled? ? 'cgreen' : 'cred' }
- if @user.two_factor_enabled?
Enabled
= link_to 'Disable', disable_two_factor_admin_user_path(@user), data: {confirm: 'Are you sure?'}, method: :patch, class: 'btn btn-sm btn-remove float-right', title: 'Disable Two-factor Authentication'
= link_to 'Disable', disable_two_factor_admin_user_path(@user), data: {confirm: 'Are you sure?'}, method: :patch, class: 'btn gl-button btn-sm btn-remove float-right', title: 'Disable Two-factor Authentication'
- else
Disabled

Expand Down Expand Up @@ -146,7 +146,7 @@
- email = " (#{@user.unconfirmed_email})"
%p This user has an unconfirmed email address#{email}. You may force a confirmation.
%br
= link_to 'Confirm user', confirm_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?', qa_selector: 'confirm_user_button' }
= link_to 'Confirm user', confirm_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?', qa_selector: 'confirm_user_button' }

= render 'admin/users/user_detail_note'

Expand All @@ -157,15 +157,15 @@
.card-body
= render partial: 'admin/users/user_activation_effects'
%br
= link_to 'Activate user', activate_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' }
= link_to 'Activate user', activate_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?' }
- elsif @user.can_be_deactivated?
.card.border-warning
.card-header.bg-warning.text-white
Deactivate this user
.card-body
= render partial: 'admin/users/user_deactivation_effects'
%br
%button.btn.btn-warning{ data: { 'gl-modal-action': 'deactivate',
%button.btn.gl-button.btn-warning{ data: { 'gl-modal-action': 'deactivate',
content: 'You can always re-activate their account, their data will remain intact.',
url: deactivate_admin_user_path(@user),
username: sanitize_name(@user.name) } }
Expand All @@ -181,15 +181,15 @@
%li Log in
%li Access Git repositories
%br
= link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' }
= link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?' }
- else
.card.border-warning
.card-header.bg-warning.text-white
Block this user
.card-body
= render partial: 'admin/users/user_block_effects'
%br
%button.btn.btn-warning{ data: { 'gl-modal-action': 'block',
%button.btn.gl-button.btn-warning{ data: { 'gl-modal-action': 'block',
content: 'You can always unblock their account, their data will remain intact.',
url: block_admin_user_path(@user),
username: sanitize_name(@user.name) } }
Expand All @@ -201,7 +201,7 @@
.card-body
%p This user has been temporarily locked due to excessive number of failed logins. You may manually unlock the account.
%br
= link_to 'Unlock user', unlock_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' }
= link_to 'Unlock user', unlock_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?' }

.card.border-danger
.card-header.bg-danger.text-white
Expand All @@ -211,7 +211,7 @@
%p Deleting a user has the following effects:
= render 'users/deletion_guidance', user: @user
%br
%button.delete-user-button.btn.btn-danger{ data: { 'gl-modal-action': 'delete',
%button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete',
delete_user_url: admin_user_path(@user),
block_user_url: block_admin_user_path(@user),
username: sanitize_name(@user.name) } }
Expand Down Expand Up @@ -241,7 +241,7 @@
the user, and projects in them, will also be removed. Commits
to other projects are unaffected.
%br
%button.delete-user-button.btn.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions',
%button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions',
delete_user_url: admin_user_path(@user, hard_delete: true),
block_user_url: block_admin_user_path(@user),
username: @user.name } }
Expand Down
4 changes: 4 additions & 0 deletions app/views/projects/product_analytics/graphs.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
%p
= _('Showing graphs based on events of the last %{timerange} days.') % { timerange: @timerange }


.gl-mb-3
= render 'graph', graph: @activity_graph

- @graphs.each_slice(2) do |pair|
.row.append-bottom-10
- pair.each do |graph|
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Make Daemon Memory Killer be the default for Sidekiq
merge_request: 41847
author:
type: other
5 changes: 5 additions & 0 deletions changelogs/unreleased/241492-increase-pypi-version-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Increase Pypi required_version limit to 255
merge_request: 41018
author:
type: changed
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Replace GlDeprecatedDropdownDivider with GlDropdown in app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/author_token.vue
merge_request: 41432
author: nuwe1
type: other
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: 'MR API: Allow `allow_{collaboration,maintainer_to_push}` to be updated'
merge_request: 41088
author:
type: fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Enable coverage_report_view feature flag by default
merge_request: 42094
author: fh1ch
type: performance
Loading

0 comments on commit 9689350

Please sign in to comment.