Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-19 18:09:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-19 18:09:40 +0300
commit4a721269429a178957e8ce7c6d0a75d3307c9830 (patch)
tree5bce5c3909c59b3b453378dccf7fb383ea621c1b /app
parent1072f96e340ddad78e5dad6dfedc7c6e85fc53ea (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/pipelines/components/graph/graph_component.vue6
-rw-r--r--app/graphql/mutations/security/ci_configuration/base_security_analyzer.rb44
-rw-r--r--app/graphql/mutations/security/ci_configuration/configure_sast.rb33
-rw-r--r--app/graphql/mutations/security/ci_configuration/configure_secret_detection.rb33
-rw-r--r--app/graphql/types/base_field.rb10
-rw-r--r--app/views/groups/settings/_pages_settings.html.haml2
-rw-r--r--app/views/layouts/nav/sidebar/_group_scope_menu.html.haml6
-rw-r--r--app/views/projects/_new_project_fields.html.haml2
-rw-r--r--app/views/projects/default_branch/_show.html.haml4
-rw-r--r--app/views/projects/pages/_pages_settings.html.haml7
10 files changed, 72 insertions, 75 deletions
diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component.vue b/app/assets/javascripts/pipelines/components/graph/graph_component.vue
index ff081552ef2..ea45b5e3ec7 100644
--- a/app/assets/javascripts/pipelines/components/graph/graph_component.vue
+++ b/app/assets/javascripts/pipelines/components/graph/graph_component.vue
@@ -162,8 +162,10 @@ export default {
<div class="js-pipeline-graph">
<div
ref="mainPipelineContainer"
- class="gl-display-flex gl-position-relative gl-bg-gray-10 gl-white-space-nowrap gl-border-t-solid gl-border-t-1 gl-border-gray-100"
- :class="{ 'gl-pipeline-min-h gl-py-5 gl-overflow-auto': !isLinkedPipeline }"
+ class="gl-display-flex gl-position-relative gl-bg-gray-10 gl-white-space-nowrap"
+ :class="{
+ 'gl-pipeline-min-h gl-py-5 gl-overflow-auto gl-border-t-solid gl-border-t-1 gl-border-gray-100': !isLinkedPipeline,
+ }"
>
<linked-graph-wrapper>
<template #upstream>
diff --git a/app/graphql/mutations/security/ci_configuration/base_security_analyzer.rb b/app/graphql/mutations/security/ci_configuration/base_security_analyzer.rb
new file mode 100644
index 00000000000..090a9a4e0ef
--- /dev/null
+++ b/app/graphql/mutations/security/ci_configuration/base_security_analyzer.rb
@@ -0,0 +1,44 @@
+# frozen_string_literal: true
+
+module Mutations
+ module Security
+ module CiConfiguration
+ class BaseSecurityAnalyzer < BaseMutation
+ include FindsProject
+
+ argument :project_path, GraphQL::ID_TYPE,
+ required: true,
+ description: 'Full path of the project.'
+
+ field :success_path, GraphQL::STRING_TYPE, null: true,
+ description: 'Redirect path to use when the response is successful.'
+
+ field :branch, GraphQL::STRING_TYPE, null: true,
+ description: 'Branch that has the new/modified `.gitlab-ci.yml` file.'
+
+ authorize :push_code
+
+ def resolve(project_path:, **args)
+ project = authorized_find!(project_path)
+
+ result = configure_analyzer(project, **args)
+ prepare_response(result)
+ end
+
+ private
+
+ def configure_analyzer(project, **args)
+ raise NotImplementedError
+ end
+
+ def prepare_response(result)
+ {
+ branch: result.payload[:branch],
+ success_path: result.payload[:success_path],
+ errors: result.errors
+ }
+ end
+ end
+ end
+ end
+end
diff --git a/app/graphql/mutations/security/ci_configuration/configure_sast.rb b/app/graphql/mutations/security/ci_configuration/configure_sast.rb
index 237aff1f052..7ce0bf83a4b 100644
--- a/app/graphql/mutations/security/ci_configuration/configure_sast.rb
+++ b/app/graphql/mutations/security/ci_configuration/configure_sast.rb
@@ -3,9 +3,7 @@
module Mutations
module Security
module CiConfiguration
- class ConfigureSast < BaseMutation
- include FindsProject
-
+ class ConfigureSast < BaseSecurityAnalyzer
graphql_name 'ConfigureSast'
description <<~DESC
Configure SAST for a project by enabling SAST in a new or modified
@@ -13,37 +11,12 @@ module Mutations
create a Merge Request are a part of the response.
DESC
- argument :project_path, GraphQL::ID_TYPE,
- required: true,
- description: 'Full path of the project.'
-
argument :configuration, ::Types::CiConfiguration::Sast::InputType,
required: true,
description: 'SAST CI configuration for the project.'
- field :success_path, GraphQL::STRING_TYPE, null: true,
- description: 'Redirect path to use when the response is successful.'
-
- field :branch, GraphQL::STRING_TYPE, null: true,
- description: 'Branch that has the new/modified `.gitlab-ci.yml` file.'
-
- authorize :push_code
-
- def resolve(project_path:, configuration:)
- project = authorized_find!(project_path)
-
- result = ::Security::CiConfiguration::SastCreateService.new(project, current_user, configuration).execute
- prepare_response(result)
- end
-
- private
-
- def prepare_response(result)
- {
- branch: result.payload[:branch],
- success_path: result.payload[:success_path],
- errors: result.errors
- }
+ def configure_analyzer(project, **args)
+ ::Security::CiConfiguration::SastCreateService.new(project, current_user, args[:configuration]).execute
end
end
end
diff --git a/app/graphql/mutations/security/ci_configuration/configure_secret_detection.rb b/app/graphql/mutations/security/ci_configuration/configure_secret_detection.rb
index 32ad670edaa..54322babb26 100644
--- a/app/graphql/mutations/security/ci_configuration/configure_secret_detection.rb
+++ b/app/graphql/mutations/security/ci_configuration/configure_secret_detection.rb
@@ -3,9 +3,7 @@
module Mutations
module Security
module CiConfiguration
- class ConfigureSecretDetection < BaseMutation
- include FindsProject
-
+ class ConfigureSecretDetection < BaseSecurityAnalyzer
graphql_name 'ConfigureSecretDetection'
description <<~DESC
Configure Secret Detection for a project by enabling Secret Detection
@@ -14,33 +12,8 @@ module Mutations
response.
DESC
- argument :project_path, GraphQL::ID_TYPE,
- required: true,
- description: 'Full path of the project.'
-
- field :success_path, GraphQL::STRING_TYPE, null: true,
- description: 'Redirect path to use when the response is successful.'
-
- field :branch, GraphQL::STRING_TYPE, null: true,
- description: 'Branch that has the new/modified `.gitlab-ci.yml` file.'
-
- authorize :push_code
-
- def resolve(project_path:)
- project = authorized_find!(project_path)
-
- result = ::Security::CiConfiguration::SecretDetectionCreateService.new(project, current_user).execute
- prepare_response(result)
- end
-
- private
-
- def prepare_response(result)
- {
- branch: result.payload[:branch],
- success_path: result.payload[:success_path],
- errors: result.errors
- }
+ def configure_analyzer(project, **_args)
+ ::Security::CiConfiguration::SecretDetectionCreateService.new(project, current_user).execute
end
end
end
diff --git a/app/graphql/types/base_field.rb b/app/graphql/types/base_field.rb
index ce2f184bcb4..75fdb41ceb6 100644
--- a/app/graphql/types/base_field.rb
+++ b/app/graphql/types/base_field.rb
@@ -95,7 +95,15 @@ module Types
end
def feature_documentation_message(key, description)
- "#{description} Available only when feature flag `#{key}` is enabled."
+ message_parts = ["#{description} Available only when feature flag `#{key}` is enabled."]
+
+ message_parts << if Feature::Definition.has_definition?(key) && Feature::Definition.default_enabled?(key)
+ "This flag is enabled by default."
+ else
+ "This flag is disabled by default, because the feature is experimental and is subject to change without notice."
+ end
+
+ message_parts.join(' ')
end
def check_feature_flag(args)
diff --git a/app/views/groups/settings/_pages_settings.html.haml b/app/views/groups/settings/_pages_settings.html.haml
index a7b1813e4f1..456e0b0f1d0 100644
--- a/app/views/groups/settings/_pages_settings.html.haml
+++ b/app/views/groups/settings/_pages_settings.html.haml
@@ -2,4 +2,4 @@
= render_if_exists 'shared/pages/max_pages_size_input', form: f
.gl-mt-3
- = f.submit s_('GitLabPages|Save'), class: 'btn gl-button btn-confirm'
+ = f.submit s_('GitLabPages|Save changes'), class: 'btn gl-button btn-confirm'
diff --git a/app/views/layouts/nav/sidebar/_group_scope_menu.html.haml b/app/views/layouts/nav/sidebar/_group_scope_menu.html.haml
deleted file mode 100644
index 57c0663f3ae..00000000000
--- a/app/views/layouts/nav/sidebar/_group_scope_menu.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-= nav_link(path: ['groups#show', 'groups#details'], html_options: { class: 'context-header' }) do
- = link_to group_path(@group), title: @group.name, data: { qa_selector: 'group_scope_link' } do
- %span{ class: ['avatar-container', 'rect-avatar', 'group-avatar' , 's32'] }
- = group_icon(@group, class: ['avatar', 'avatar-tile', 's32'])
- %span.sidebar-context-title
- = @group.name
diff --git a/app/views/projects/_new_project_fields.html.haml b/app/views/projects/_new_project_fields.html.haml
index 66fc313213a..55696337bc1 100644
--- a/app/views/projects/_new_project_fields.html.haml
+++ b/app/views/projects/_new_project_fields.html.haml
@@ -23,7 +23,7 @@
display_path: true,
extra_group: namespace_id),
{},
- { class: 'select2 js-select-namespace qa-project-namespace-select block-truncated', data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_path", track_value: "" }})
+ { class: 'select2 js-select-namespace qa-project-namespace-select block-truncated', data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_path", track_value: "", qa_selector: "select_namespace_dropdown" }})
- else
.input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' }
diff --git a/app/views/projects/default_branch/_show.html.haml b/app/views/projects/default_branch/_show.html.haml
index 9e9fc08dac0..68ca318e88c 100644
--- a/app/views/projects/default_branch/_show.html.haml
+++ b/app/views/projects/default_branch/_show.html.haml
@@ -17,7 +17,7 @@
- else
.form-group
= f.label :default_branch, "Default branch", class: 'label-bold'
- = f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'})
+ = f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide', data: { qa_selector: 'default_branch_dropdown' }})
.form-group
.form-check
@@ -28,4 +28,4 @@
= _("When merge requests and commits in the default branch close, any issues they reference also close.")
= link_to sprite_icon('question-o'), help_page_path('user/project/issues/managing_issues.md', anchor: 'disabling-automatic-issue-closing'), target: '_blank'
- = f.submit _('Save changes'), class: "gl-button btn btn-confirm"
+ = f.submit _('Save changes'), class: "gl-button btn btn-confirm", data: { qa_selector: 'save_changes_button' }
diff --git a/app/views/projects/pages/_pages_settings.html.haml b/app/views/projects/pages/_pages_settings.html.haml
index 483f192109b..2db44528d51 100644
--- a/app/views/projects/pages/_pages_settings.html.haml
+++ b/app/views/projects/pages/_pages_settings.html.haml
@@ -1,5 +1,8 @@
= form_for @project, url: project_pages_path(@project), html: { class: 'inline', title: pages_https_only_title } do |f|
- = render_if_exists 'shared/pages/max_pages_size_input', form: f
+ - if can?(current_user, :update_max_pages_size)
+ = render_if_exists 'shared/pages/max_pages_size_input', form: f
+ .gl-mt-3
+ = f.submit s_('GitLabPages|Save changes'), class: 'btn btn-confirm gl-button'
- if Gitlab.config.pages.external_http || Gitlab.config.pages.external_https
@@ -15,4 +18,4 @@
= s_("GitLabPages|When enabled, all attempts to visit your website through HTTP are automatically redirected to HTTPS using a response with status code 301. Requires a valid certificate for all domains. %{docs_link_start}Learn more.%{link_end}").html_safe % { docs_link_start: docs_link_start, link_end: link_end }
.gl-mt-3
- = f.submit s_('GitLabPages|Save'), class: 'btn btn-confirm gl-button'
+ = f.submit s_('GitLabPages|Save changes'), class: 'btn btn-confirm gl-button'