Skip to content
Snippets Groups Projects
Unverified Commit 621b731d authored by John T Skarbek's avatar John T Skarbek
Browse files

Merge commit '6d000c9f' into 11-10-stable

parents b6ff7958 6d000c9f
No related branches found
No related tags found
No related merge requests found
Showing
with 111 additions and 60 deletions
8.7.1 9.0.0
8.4.0 8.5.0
Loading
@@ -24,7 +24,13 @@ export default {
Loading
@@ -24,7 +24,13 @@ export default {
...mapState(['pipelinesEmptyStateSvgPath', 'links']), ...mapState(['pipelinesEmptyStateSvgPath', 'links']),
...mapGetters(['currentProject']), ...mapGetters(['currentProject']),
...mapGetters('pipelines', ['jobsCount', 'failedJobsCount', 'failedStages', 'pipelineFailed']), ...mapGetters('pipelines', ['jobsCount', 'failedJobsCount', 'failedStages', 'pipelineFailed']),
...mapState('pipelines', ['isLoadingPipeline', 'latestPipeline', 'stages', 'isLoadingJobs']), ...mapState('pipelines', [
'isLoadingPipeline',
'hasLoadedPipeline',
'latestPipeline',
'stages',
'isLoadingJobs',
]),
ciLintText() { ciLintText() {
return sprintf( return sprintf(
__('You can test your .gitlab-ci.yml in %{linkStart}CI Lint%{linkEnd}.'), __('You can test your .gitlab-ci.yml in %{linkStart}CI Lint%{linkEnd}.'),
Loading
@@ -36,7 +42,7 @@ export default {
Loading
@@ -36,7 +42,7 @@ export default {
); );
}, },
showLoadingIcon() { showLoadingIcon() {
return this.isLoadingPipeline && this.latestPipeline === null; return this.isLoadingPipeline && !this.hasLoadedPipeline;
}, },
}, },
created() { created() {
Loading
@@ -51,7 +57,7 @@ export default {
Loading
@@ -51,7 +57,7 @@ export default {
<template> <template>
<div class="ide-pipeline"> <div class="ide-pipeline">
<gl-loading-icon v-if="showLoadingIcon" :size="2" class="prepend-top-default" /> <gl-loading-icon v-if="showLoadingIcon" :size="2" class="prepend-top-default" />
<template v-else-if="latestPipeline !== null"> <template v-else-if="hasLoadedPipeline">
<header v-if="latestPipeline" class="ide-tree-header ide-pipeline-header"> <header v-if="latestPipeline" class="ide-tree-header ide-pipeline-header">
<ci-icon :status="latestPipeline.details.status" :size="24" /> <ci-icon :status="latestPipeline.details.status" :size="24" />
<span class="prepend-left-8"> <span class="prepend-left-8">
Loading
@@ -62,7 +68,7 @@ export default {
Loading
@@ -62,7 +68,7 @@ export default {
</span> </span>
</header> </header>
<empty-state <empty-state
v-if="latestPipeline === false" v-if="!latestPipeline"
:help-page-path="links.ciHelpPagePath" :help-page-path="links.ciHelpPagePath"
:empty-state-svg-path="pipelinesEmptyStateSvgPath" :empty-state-svg-path="pipelinesEmptyStateSvgPath"
:can-set-ci="true" :can-set-ci="true"
Loading
Loading
Loading
@@ -10,6 +10,7 @@ export default {
Loading
@@ -10,6 +10,7 @@ export default {
}, },
[types.RECEIVE_LASTEST_PIPELINE_SUCCESS](state, pipeline) { [types.RECEIVE_LASTEST_PIPELINE_SUCCESS](state, pipeline) {
state.isLoadingPipeline = false; state.isLoadingPipeline = false;
state.hasLoadedPipeline = true;
   
if (pipeline) { if (pipeline) {
state.latestPipeline = { state.latestPipeline = {
Loading
@@ -34,7 +35,7 @@ export default {
Loading
@@ -34,7 +35,7 @@ export default {
}; };
}); });
} else { } else {
state.latestPipeline = false; state.latestPipeline = null;
} }
}, },
[types.REQUEST_JOBS](state, id) { [types.REQUEST_JOBS](state, id) {
Loading
Loading
export default () => ({ export default () => ({
isLoadingPipeline: true, isLoadingPipeline: true,
hasLoadedPipeline: false,
isLoadingJobs: false, isLoadingJobs: false,
latestPipeline: null, latestPipeline: null,
stages: [], stages: [],
Loading
Loading
Loading
@@ -46,7 +46,10 @@ class DashboardController < Dashboard::ApplicationController
Loading
@@ -46,7 +46,10 @@ class DashboardController < Dashboard::ApplicationController
end end
   
def check_filters_presence! def check_filters_presence!
@no_filters_set = finder_type.scalar_params.none? { |k| params.key?(k) } no_scalar_filters_set = finder_type.scalar_params.none? { |k| params.key?(k) }
no_array_filters_set = finder_type.array_params.none? { |k, _| params.key?(k) }
@no_filters_set = no_scalar_filters_set && no_array_filters_set
   
return unless @no_filters_set return unless @no_filters_set
   
Loading
Loading
Loading
@@ -124,8 +124,8 @@ class GroupsController < Groups::ApplicationController
Loading
@@ -124,8 +124,8 @@ class GroupsController < Groups::ApplicationController
flash[:notice] = "Group '#{@group.name}' was successfully transferred." flash[:notice] = "Group '#{@group.name}' was successfully transferred."
redirect_to group_path(@group) redirect_to group_path(@group)
else else
flash.now[:alert] = service.error flash[:alert] = service.error
render :edit redirect_to edit_group_path(@group)
end end
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
Loading
Loading
Loading
@@ -117,7 +117,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
Loading
@@ -117,7 +117,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
terminal = environment.terminals.try(:first) terminal = environment.terminals.try(:first)
if terminal if terminal
set_workhorse_internal_api_content_type set_workhorse_internal_api_content_type
render json: Gitlab::Workhorse.terminal_websocket(terminal) render json: Gitlab::Workhorse.channel_websocket(terminal)
else else
render html: 'Not found', status: :not_found render html: 'Not found', status: :not_found
end end
Loading
Loading
Loading
@@ -157,7 +157,7 @@ class Projects::JobsController < Projects::ApplicationController
Loading
@@ -157,7 +157,7 @@ class Projects::JobsController < Projects::ApplicationController
# GET .../terminal.ws : implemented in gitlab-workhorse # GET .../terminal.ws : implemented in gitlab-workhorse
def terminal_websocket_authorize def terminal_websocket_authorize
set_workhorse_internal_api_content_type set_workhorse_internal_api_content_type
render json: Gitlab::Workhorse.terminal_websocket(@build.terminal_specification) render json: Gitlab::Workhorse.channel_websocket(@build.terminal_specification)
end end
   
private private
Loading
Loading
Loading
@@ -16,7 +16,10 @@ class Projects::WikisController < Projects::ApplicationController
Loading
@@ -16,7 +16,10 @@ class Projects::WikisController < Projects::ApplicationController
end end
   
def pages def pages
@wiki_pages = Kaminari.paginate_array(@project_wiki.pages).page(params[:page]) @wiki_pages = Kaminari.paginate_array(
@project_wiki.pages(sort: params[:sort], direction: params[:direction])
).page(params[:page])
@wiki_entries = WikiPage.group_by_directory(@wiki_pages) @wiki_entries = WikiPage.group_by_directory(@wiki_pages)
end end
   
Loading
Loading
Loading
@@ -53,7 +53,6 @@ class IssuableFinder
Loading
@@ -53,7 +53,6 @@ class IssuableFinder
assignee_username assignee_username
author_id author_id
author_username author_username
label_name
milestone_title milestone_title
my_reaction_emoji my_reaction_emoji
search search
Loading
Loading
# frozen_string_literal: true # frozen_string_literal: true
   
class GitlabSchema < GraphQL::Schema class GitlabSchema < GraphQL::Schema
# Took our current most complicated query in use, issues.graphql,
# with a complexity of 19, and added a 20 point buffer to it.
# These values will evolve over time.
DEFAULT_MAX_COMPLEXITY = 40
AUTHENTICATED_COMPLEXITY = 50
ADMIN_COMPLEXITY = 60
use BatchLoader::GraphQL use BatchLoader::GraphQL
use Gitlab::Graphql::Authorize use Gitlab::Graphql::Authorize
use Gitlab::Graphql::Present use Gitlab::Graphql::Present
use Gitlab::Graphql::Connections use Gitlab::Graphql::Connections
use Gitlab::Graphql::Tracing use Gitlab::Graphql::Tracing
   
query_analyzer Gitlab::Graphql::QueryAnalyzers::LogQueryComplexity.analyzer
query(Types::QueryType) query(Types::QueryType)
   
default_max_page_size 100 default_max_page_size 100
max_complexity DEFAULT_MAX_COMPLEXITY
mutation(Types::MutationType) mutation(Types::MutationType)
def self.execute(query_str = nil, **kwargs)
kwargs[:max_complexity] ||= max_query_complexity(kwargs[:context])
super(query_str, **kwargs)
end
def self.max_query_complexity(ctx)
current_user = ctx&.fetch(:current_user, nil)
if current_user&.admin
ADMIN_COMPLEXITY
elsif current_user
AUTHENTICATED_COMPLEXITY
else
DEFAULT_MAX_COMPLEXITY
end
end
end end
Loading
@@ -3,5 +3,14 @@
Loading
@@ -3,5 +3,14 @@
module Types module Types
class BaseField < GraphQL::Schema::Field class BaseField < GraphQL::Schema::Field
prepend Gitlab::Graphql::Authorize prepend Gitlab::Graphql::Authorize
DEFAULT_COMPLEXITY = 1
def initialize(*args, **kwargs, &block)
# complexity is already defaulted to 1, but let's make it explicit
kwargs[:complexity] ||= DEFAULT_COMPLEXITY
super(*args, **kwargs, &block)
end
end end
end end
Loading
@@ -77,7 +77,7 @@ module BlobHelper
Loading
@@ -77,7 +77,7 @@ module BlobHelper
project, project,
ref, ref,
path, path,
label: "Replace", label: _("Replace"),
action: "replace", action: "replace",
btn_class: "default", btn_class: "default",
modal_type: "upload" modal_type: "upload"
Loading
@@ -89,7 +89,7 @@ module BlobHelper
Loading
@@ -89,7 +89,7 @@ module BlobHelper
project, project,
ref, ref,
path, path,
label: "Delete", label: _("Delete"),
action: "delete", action: "delete",
btn_class: "remove", btn_class: "remove",
modal_type: "remove" modal_type: "remove"
Loading
@@ -101,14 +101,14 @@ module BlobHelper
Loading
@@ -101,14 +101,14 @@ module BlobHelper
end end
   
def leave_edit_message def leave_edit_message
"Leave edit mode?\nAll unsaved changes will be lost." _("Leave edit mode? All unsaved changes will be lost.")
end end
   
def editing_preview_title(filename) def editing_preview_title(filename)
if Gitlab::MarkupHelper.previewable?(filename) if Gitlab::MarkupHelper.previewable?(filename)
'Preview' _('Preview')
else else
'Preview changes' _('Preview changes')
end end
end end
   
Loading
@@ -201,14 +201,14 @@ module BlobHelper
Loading
@@ -201,14 +201,14 @@ module BlobHelper
return if blob.empty? return if blob.empty?
return if blob.binary? || blob.stored_externally? return if blob.binary? || blob.stored_externally?
   
title = 'Open raw' title = _('Open raw')
link_to icon('file-code-o'), blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } link_to icon('file-code-o'), blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' }
end end
   
def download_blob_button(blob) def download_blob_button(blob)
return if blob.empty? return if blob.empty?
   
title = 'Download' title = _('Download')
link_to sprite_icon('download'), blob_raw_path(inline: false), download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } link_to sprite_icon('download'), blob_raw_path(inline: false), download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' }
end end
   
Loading
Loading
Loading
@@ -4,12 +4,12 @@ module BuildsHelper
Loading
@@ -4,12 +4,12 @@ module BuildsHelper
def build_summary(build, skip: false) def build_summary(build, skip: false)
if build.has_trace? if build.has_trace?
if skip if skip
link_to "View job trace", pipeline_job_url(build.pipeline, build) link_to _("View job trace"), pipeline_job_url(build.pipeline, build)
else else
build.trace.html(last_lines: 10).html_safe build.trace.html(last_lines: 10).html_safe
end end
else else
"No job trace" _("No job trace")
end end
end end
   
Loading
@@ -31,7 +31,7 @@ module BuildsHelper
Loading
@@ -31,7 +31,7 @@ module BuildsHelper
   
def build_failed_issue_options def build_failed_issue_options
{ {
title: "Job Failed ##{@build.id}", title: _("Job Failed #%{build_id}") % { build_id: @build.id },
description: project_job_url(@project, @build) description: project_job_url(@project, @build)
} }
end end
Loading
Loading
Loading
@@ -21,7 +21,7 @@ module ButtonHelper
Loading
@@ -21,7 +21,7 @@ module ButtonHelper
# See http://clipboardjs.com/#usage # See http://clipboardjs.com/#usage
def clipboard_button(data = {}) def clipboard_button(data = {})
css_class = data[:class] || 'btn-clipboard btn-transparent' css_class = data[:class] || 'btn-clipboard btn-transparent'
title = data[:title] || 'Copy to clipboard' title = data[:title] || _('Copy to clipboard')
button_text = data[:button_text] || '' button_text = data[:button_text] || ''
hide_tooltip = data[:hide_tooltip] || false hide_tooltip = data[:hide_tooltip] || false
hide_button_icon = data[:hide_button_icon] || false hide_button_icon = data[:hide_button_icon] || false
Loading
Loading
Loading
@@ -4,8 +4,7 @@ module FormHelper
Loading
@@ -4,8 +4,7 @@ module FormHelper
def form_errors(model, type: 'form') def form_errors(model, type: 'form')
return unless model.errors.any? return unless model.errors.any?
   
pluralized = 'error'.pluralize(model.errors.count) headline = n_('The %{type} contains the following error:', 'The %{type} contains the following errors:', model.errors.count) % { type: type }
headline = "The #{type} contains the following #{pluralized}:"
   
content_tag(:div, class: 'alert alert-danger', id: 'error_explanation') do content_tag(:div, class: 'alert alert-danger', id: 'error_explanation') do
content_tag(:h4, headline) << content_tag(:h4, headline) <<
Loading
@@ -24,7 +23,7 @@ module FormHelper
Loading
@@ -24,7 +23,7 @@ module FormHelper
title: 'Select assignee', title: 'Select assignee',
filter: true, filter: true,
dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-assignee', dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-assignee',
placeholder: 'Search users', placeholder: _('Search users'),
data: { data: {
first_user: current_user&.username, first_user: current_user&.username,
null_user: true, null_user: true,
Loading
Loading
Loading
@@ -181,8 +181,8 @@ module LabelsHelper
Loading
@@ -181,8 +181,8 @@ module LabelsHelper
   
def label_deletion_confirm_text(label) def label_deletion_confirm_text(label)
case label case label
when GroupLabel then 'Remove this label? This will affect all projects within the group. Are you sure?' when GroupLabel then _('Remove this label? This will affect all projects within the group. Are you sure?')
when ProjectLabel then 'Remove this label? Are you sure?' when ProjectLabel then _('Remove this label? Are you sure?')
end end
end end
   
Loading
Loading
Loading
@@ -30,7 +30,7 @@ module SearchHelper
Loading
@@ -30,7 +30,7 @@ module SearchHelper
to = collection.offset_value + collection.to_a.size to = collection.offset_value + collection.to_a.size
count = collection.total_count count = collection.total_count
   
"Showing #{from} - #{to} of #{count} #{scope.humanize(capitalize: false)} for \"#{term}\"" s_("SearchResults|Showing %{from} - %{to} of %{count} %{scope} for \"%{term}\"") % { from: from, to: to, count: count, scope: scope.humanize(capitalize: false), term: term }
end end
   
def find_project_for_result_blob(projects, result) def find_project_for_result_blob(projects, result)
Loading
@@ -59,31 +59,31 @@ module SearchHelper
Loading
@@ -59,31 +59,31 @@ module SearchHelper
# Autocomplete results for various settings pages # Autocomplete results for various settings pages
def default_autocomplete def default_autocomplete
[ [
{ category: "Settings", label: "User settings", url: profile_path }, { category: "Settings", label: _("User settings"), url: profile_path },
{ category: "Settings", label: "SSH Keys", url: profile_keys_path }, { category: "Settings", label: _("SSH Keys"), url: profile_keys_path },
{ category: "Settings", label: "Dashboard", url: root_path } { category: "Settings", label: _("Dashboard"), url: root_path }
] ]
end end
   
# Autocomplete results for settings pages, for admins # Autocomplete results for settings pages, for admins
def default_autocomplete_admin def default_autocomplete_admin
[ [
{ category: "Settings", label: "Admin Section", url: admin_root_path } { category: "Settings", label: _("Admin Section"), url: admin_root_path }
] ]
end end
   
# Autocomplete results for internal help pages # Autocomplete results for internal help pages
def help_autocomplete def help_autocomplete
[ [
{ category: "Help", label: "API Help", url: help_page_path("api/README") }, { category: "Help", label: _("API Help"), url: help_page_path("api/README") },
{ category: "Help", label: "Markdown Help", url: help_page_path("user/markdown") }, { category: "Help", label: _("Markdown Help"), url: help_page_path("user/markdown") },
{ category: "Help", label: "Permissions Help", url: help_page_path("user/permissions") }, { category: "Help", label: _("Permissions Help"), url: help_page_path("user/permissions") },
{ category: "Help", label: "Public Access Help", url: help_page_path("public_access/public_access") }, { category: "Help", label: _("Public Access Help"), url: help_page_path("public_access/public_access") },
{ category: "Help", label: "Rake Tasks Help", url: help_page_path("raketasks/README") }, { category: "Help", label: _("Rake Tasks Help"), url: help_page_path("raketasks/README") },
{ category: "Help", label: "SSH Keys Help", url: help_page_path("ssh/README") }, { category: "Help", label: _("SSH Keys Help"), url: help_page_path("ssh/README") },
{ category: "Help", label: "System Hooks Help", url: help_page_path("system_hooks/system_hooks") }, { category: "Help", label: _("System Hooks Help"), url: help_page_path("system_hooks/system_hooks") },
{ category: "Help", label: "Webhooks Help", url: help_page_path("user/project/integrations/webhooks") }, { category: "Help", label: _("Webhooks Help"), url: help_page_path("user/project/integrations/webhooks") },
{ category: "Help", label: "Workflow Help", url: help_page_path("workflow/README") } { category: "Help", label: _("Workflow Help"), url: help_page_path("workflow/README") }
] ]
end end
   
Loading
@@ -93,16 +93,16 @@ module SearchHelper
Loading
@@ -93,16 +93,16 @@ module SearchHelper
ref = @ref || @project.repository.root_ref ref = @ref || @project.repository.root_ref
   
[ [
{ category: "In this project", label: "Files", url: project_tree_path(@project, ref) }, { category: "In this project", label: _("Files"), url: project_tree_path(@project, ref) },
{ category: "In this project", label: "Commits", url: project_commits_path(@project, ref) }, { category: "In this project", label: _("Commits"), url: project_commits_path(@project, ref) },
{ category: "In this project", label: "Network", url: project_network_path(@project, ref) }, { category: "In this project", label: _("Network"), url: project_network_path(@project, ref) },
{ category: "In this project", label: "Graph", url: project_graph_path(@project, ref) }, { category: "In this project", label: _("Graph"), url: project_graph_path(@project, ref) },
{ category: "In this project", label: "Issues", url: project_issues_path(@project) }, { category: "In this project", label: _("Issues"), url: project_issues_path(@project) },
{ category: "In this project", label: "Merge Requests", url: project_merge_requests_path(@project) }, { category: "In this project", label: _("Merge Requests"), url: project_merge_requests_path(@project) },
{ category: "In this project", label: "Milestones", url: project_milestones_path(@project) }, { category: "In this project", label: _("Milestones"), url: project_milestones_path(@project) },
{ category: "In this project", label: "Snippets", url: project_snippets_path(@project) }, { category: "In this project", label: _("Snippets"), url: project_snippets_path(@project) },
{ category: "In this project", label: "Members", url: project_project_members_path(@project) }, { category: "In this project", label: _("Members"), url: project_project_members_path(@project) },
{ category: "In this project", label: "Wiki", url: project_wikis_path(@project) } { category: "In this project", label: _("Wiki"), url: project_wikis_path(@project) }
] ]
else else
[] []
Loading
@@ -162,7 +162,7 @@ module SearchHelper
Loading
@@ -162,7 +162,7 @@ module SearchHelper
opts = opts =
{ {
id: "filtered-search-#{type}", id: "filtered-search-#{type}",
placeholder: 'Search or filter results...', placeholder: _('Search or filter results...'),
data: { data: {
'username-params' => UserSerializer.new.represent(@users) 'username-params' => UserSerializer.new.represent(@users)
}, },
Loading
Loading
Loading
@@ -86,17 +86,17 @@ module TreeHelper
Loading
@@ -86,17 +86,17 @@ module TreeHelper
end end
   
def edit_in_new_fork_notice_now def edit_in_new_fork_notice_now
"You're not allowed to make changes to this project directly." + _("You're not allowed to make changes to this project directly. "\
" A fork of this project is being created that you can make changes in, so you can submit a merge request." "A fork of this project is being created that you can make changes in, so you can submit a merge request.")
end end
   
def edit_in_new_fork_notice def edit_in_new_fork_notice
"You're not allowed to make changes to this project directly." + _("You're not allowed to make changes to this project directly. "\
" A fork of this project has been created that you can make changes in, so you can submit a merge request." "A fork of this project has been created that you can make changes in, so you can submit a merge request.")
end end
   
def edit_in_new_fork_notice_action(action) def edit_in_new_fork_notice_action(action)
edit_in_new_fork_notice + " Try to #{action} this file again." edit_in_new_fork_notice + _(" Try to %{action} this file again.") % { action: action }
end end
   
def commit_in_fork_help def commit_in_fork_help
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