diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-13 18:10:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-13 18:10:16 +0300 |
commit | b0b94ea6e54f824d02840912f7086e9f47350571 (patch) | |
tree | cce02fc375060d27953087b4f1f05128b0d26ce6 /app | |
parent | 447ad69728c0cb35db1190694f29806cf7c59a88 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
24 files changed, 41 insertions, 14 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/index.js b/app/assets/javascripts/vue_merge_request_widget/index.js index e8b97098a2b..5e9b72e13cf 100644 --- a/app/assets/javascripts/vue_merge_request_widget/index.js +++ b/app/assets/javascripts/vue_merge_request_widget/index.js @@ -29,6 +29,8 @@ export default () => { gl.mrWidgetData.gitlabLogo = gon.gitlab_logo; gl.mrWidgetData.defaultAvatarUrl = gon.default_avatar_url; + const dismissalDescriptions = JSON.parse(gl.mrWidgetData.dismissal_descriptions || '{}'); + // This is a false violation of @gitlab/no-runtime-template-compiler, since it // creates a new Vue instance by spreading a _valid_ Vue component definition // into the Vue constructor. @@ -43,6 +45,8 @@ export default () => { canCreatePipelineInTargetProject: parseBoolean( gl.mrWidgetData.can_create_pipeline_in_target_project, ), + commitPathTemplate: gl.mrWidgetData.commit_path_template, + dismissalDescriptions, }, ...MrWidgetOptions, apolloProvider, diff --git a/app/assets/stylesheets/_page_specific_files.scss b/app/assets/stylesheets/_page_specific_files.scss index a6377480fa7..be9a06d7bb5 100644 --- a/app/assets/stylesheets/_page_specific_files.scss +++ b/app/assets/stylesheets/_page_specific_files.scss @@ -8,6 +8,5 @@ @import './pages/notes'; @import './pages/pipelines'; @import './pages/profile'; -@import './pages/projects'; @import './pages/registry'; @import './pages/settings'; diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/page_bundles/projects.scss index 9ce470dbcf2..68139c55f5a 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/page_bundles/projects.scss @@ -1,3 +1,5 @@ +@import 'mixins_and_variables_and_functions'; + .new_project, .edit-project, .import-project { @@ -6,7 +8,7 @@ } .project-path .form-control { - border-radius: $border-radius-base; + border-radius: $gl-border-radius-base; } .input-group { @@ -47,7 +49,7 @@ } + .btn-default { - border-radius: 0 $border-radius-base $border-radius-base 0; + border-radius: 0 $gl-border-radius-base $gl-border-radius-base 0; } } } diff --git a/app/models/integrations/base_chat_notification.rb b/app/models/integrations/base_chat_notification.rb index 2c929dc2cb3..e6936318f42 100644 --- a/app/models/integrations/base_chat_notification.rb +++ b/app/models/integrations/base_chat_notification.rb @@ -13,6 +13,8 @@ module Integrations tag_push pipeline wiki_page deployment incident ].freeze + GROUP_ONLY_SUPPORTED_EVENTS = %w[group_mention group_confidential_mention].freeze + SUPPORTED_EVENTS_FOR_LABEL_FILTER = %w[issue confidential_issue merge_request note confidential_note].freeze EVENT_CHANNEL = proc { |event| "#{event}_channel" } @@ -30,6 +32,7 @@ module Integrations # Custom serialized properties initialization prop_accessor(*SUPPORTED_EVENTS.map { |event| EVENT_CHANNEL[event] }) + prop_accessor(*GROUP_ONLY_SUPPORTED_EVENTS.map { |event| EVENT_CHANNEL[event] }) boolean_accessor :notify_only_default_branch @@ -251,6 +254,8 @@ module Integrations Integrations::ChatMessage::DeploymentMessage.new(data) if notify_for_ref?(data) when "incident" Integrations::ChatMessage::IssueMessage.new(data) unless update?(data) + when "group_mention" + Integrations::ChatMessage::GroupMentionMessage.new(data) end end # rubocop:enable Metrics/CyclomaticComplexity diff --git a/app/models/integrations/base_slack_notification.rb b/app/models/integrations/base_slack_notification.rb index 65aec8b278f..09a0c9ba361 100644 --- a/app/models/integrations/base_slack_notification.rb +++ b/app/models/integrations/base_slack_notification.rb @@ -7,8 +7,6 @@ module Integrations ].freeze prop_accessor EVENT_CHANNEL['alert'] - prop_accessor EVENT_CHANNEL['group_mention'] - prop_accessor EVENT_CHANNEL['group_confidential_mention'] override :default_channel_placeholder def default_channel_placeholder @@ -18,7 +16,6 @@ module Integrations override :get_message def get_message(object_kind, data) return Integrations::ChatMessage::AlertMessage.new(data) if object_kind == 'alert' - return Integrations::ChatMessage::GroupMentionMessage.new(data) if object_kind == 'group_mention' super end diff --git a/app/models/integrations/discord.rb b/app/models/integrations/discord.rb index 7917d17eb62..33b2b52fa62 100644 --- a/app/models/integrations/discord.rb +++ b/app/models/integrations/discord.rb @@ -42,6 +42,13 @@ module Integrations s_('DiscordService|Override the default webhook (e.g. https://discord.com/api/webhooks/…)') end + override :supported_events + def supported_events + additional = group_level? ? %w[group_mention group_confidential_mention] : [] + + (self.class.supported_events + additional).freeze + end + def self.supported_events %w[push issue confidential_issue merge_request note confidential_note tag_push pipeline wiki_page deployment] end diff --git a/app/models/users/callout.rb b/app/models/users/callout.rb index 0136cc6bb2d..60dd89c3ee7 100644 --- a/app/models/users/callout.rb +++ b/app/models/users/callout.rb @@ -75,7 +75,8 @@ module Users namespace_over_storage_users_combined_alert: 73, # EE-only # 74 removed in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132751 vsd_feedback_banner: 75, # EE-only - security_policy_protected_branch_modification: 76 # EE-only + security_policy_protected_branch_modification: 76, # EE-only + vulnerability_report_grouping: 77 # EE-only } validates :feature_name, diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index 31ec4935f64..412d8e64e89 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -1,5 +1,6 @@ - page_title _('Projects') - add_page_specific_style 'page_bundles/search' +- add_page_specific_style 'page_bundles/projects' - params[:visibility_level] ||= [] .top-area.gl-flex-direction-column-reverse diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index 85dce00752b..6be5aa003fc 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -1,4 +1,5 @@ - add_page_specific_style 'page_bundles/members' +- add_page_specific_style 'page_bundles/projects' - add_to_breadcrumbs _("Projects"), admin_projects_path - breadcrumb_title @project.full_name - page_title @project.full_name, _("Projects") diff --git a/app/views/dashboard/projects/index.html.haml b/app/views/dashboard/projects/index.html.haml index 140bc6e06c3..c74a9f4cbe6 100644 --- a/app/views/dashboard/projects/index.html.haml +++ b/app/views/dashboard/projects/index.html.haml @@ -5,6 +5,7 @@ - page_title _("Projects") - add_page_specific_style 'page_bundles/dashboard_projects' +- add_page_specific_style 'page_bundles/projects' = render "projects/last_push" - if show_projects?(@projects, params) diff --git a/app/views/groups/projects.html.haml b/app/views/groups/projects.html.haml index 22e9f9f5071..76758769d01 100644 --- a/app/views/groups/projects.html.haml +++ b/app/views/groups/projects.html.haml @@ -1,5 +1,6 @@ - breadcrumb_title _("Projects") - page_title _("Projects") +- add_page_specific_style 'page_bundles/projects' - @force_desktop_expanded_sidebar = true = render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card js-search-settings-section' }, header_options: { class: 'gl-new-card-header gl-display-flex' }, body_options: { class: 'gl-new-card-body' }) do |c| diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index bb492913346..37d03bde72e 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -4,7 +4,7 @@ -# This is a temporary place for the page specific style migrations to be included on all pages like page_specific_files - if Feature.disabled?(:page_specific_styles, current_user) - - add_page_specific_style('page_bundles/labels') + - add_page_specific_style('page_bundles/projects') %head{ omit_og ? { } : { prefix: "og: http://ogp.me/ns#" } } %meta{ charset: "utf-8" } diff --git a/app/views/layouts/project_settings.html.haml b/app/views/layouts/project_settings.html.haml index 29e30c4434f..7e5dd0d37c9 100644 --- a/app/views/layouts/project_settings.html.haml +++ b/app/views/layouts/project_settings.html.haml @@ -1,6 +1,7 @@ - page_title _("Settings") - nav "project" - add_page_specific_style 'page_bundles/settings' +- add_page_specific_style 'page_bundles/projects' - enable_search_settings locals: { container_class: 'gl-my-5' } diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml index 1307c388041..94671b69b5e 100644 --- a/app/views/profiles/keys/_key_details.html.haml +++ b/app/views/profiles/keys/_key_details.html.haml @@ -46,7 +46,7 @@ .gl-display-flex %pre.well-pre.gl-pl-5.gl-mb-0.gl-border-0 = @key.key - = deprecated_clipboard_button(title: s_('Profiles|Copy SSH key'), text: @key.key, class: 'gl-bg-gray-10 gl-px-3! gl-border-none! gl-rounded-top-left-none! gl-rounded-bottom-left-none!') + = clipboard_button(title: s_('Profiles|Copy SSH key'), text: @key.key, category: :tertiary, size: :medium) = render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card' }, header_options: { class: 'gl-new-card-header' }, body_options: { class: 'gl-new-card-body gl-px-0'}) do |c| - c.with_header do diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index e2cad2fb3d7..bd0f4577a32 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -1,5 +1,6 @@ - page_title _("Blame"), @blob.path, @ref - add_page_specific_style 'page_bundles/tree' +- add_page_specific_style 'page_bundles/projects' - blame_streaming_url = blame_pages_streaming_url(@id, @project) - if @blame_mode.streaming? && @blame_pagination.total_extra_pages > 0 diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index 543bdaf46df..2d9b7ada015 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -2,6 +2,7 @@ - project = @project.present(current_user: current_user) - ref = local_assigns[:ref] || @ref - expanded = params[:expanded].present? +- add_page_specific_style 'page_bundles/projects' -# If the blob has a RichViewer we preload the content except for GeoJSON since it is handled by Vue - if blob.rich_viewer && blob.extension != 'geojson' - add_page_startup_api_call local_assigns.fetch(:viewer_url) { url_for(safe_params.merge(viewer: blob.rich_viewer.type, format: :json)) } diff --git a/app/views/projects/buttons/_clone.html.haml b/app/views/projects/buttons/_clone.html.haml index b5679bc512c..0e645eda678 100644 --- a/app/views/projects/buttons/_clone.html.haml +++ b/app/views/projects/buttons/_clone.html.haml @@ -15,7 +15,7 @@ .input-group.btn-group = text_field_tag :ssh_project_clone, ssh_clone_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: _('Repository clone URL') }, data: { qa_selector: 'ssh_clone_url_content' } .input-group-append - = deprecated_clipboard_button(target: '#ssh_project_clone', title: _("Copy URL"), class: "input-group-text gl-button btn btn-icon btn-default") + = clipboard_button(target: '#ssh_project_clone', title: _("Copy URL"), category: :primary, size: :medium) = render_if_exists 'projects/buttons/geo' - if http_enabled? %li.pt-2{ class: 'gl-px-4!' } @@ -24,7 +24,7 @@ .input-group.btn-group = text_field_tag :http_project_clone, http_clone_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: _('Repository clone URL') }, data: { qa_selector: 'http_clone_url_content' } .input-group-append - = deprecated_clipboard_button(target: '#http_project_clone', title: _("Copy URL"), class: "input-group-text gl-button btn btn-icon btn-default") + = clipboard_button(target: '#http_project_clone', title: _("Copy URL"), category: :primary, size: :medium) = render_if_exists 'projects/buttons/geo' = render_if_exists 'projects/buttons/kerberos_clone_field' %li.divider.mt-2 diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml index 1034f06f722..be2bf43cbb9 100644 --- a/app/views/projects/commits/show.html.haml +++ b/app/views/projects/commits/show.html.haml @@ -1,6 +1,7 @@ - breadcrumb_title _("Commits") - add_page_specific_style 'page_bundles/tree' - add_page_specific_style 'page_bundles/merge_request' +- add_page_specific_style 'page_bundles/projects' - page_title _("Commits"), @ref = content_for :meta_tags do diff --git a/app/views/projects/find_file/show.html.haml b/app/views/projects/find_file/show.html.haml index 021c40214fc..0c760ab82c9 100644 --- a/app/views/projects/find_file/show.html.haml +++ b/app/views/projects/find_file/show.html.haml @@ -1,5 +1,6 @@ - page_title _("Find File"), @ref - add_page_specific_style 'page_bundles/tree' +- add_page_specific_style 'page_bundles/projects' - tree_path = project_tree_path(@project, @ref) - blob_path = project_blob_path(@project, @ref) diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index bf288d3601b..40acd123aaa 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -3,6 +3,7 @@ - page_title _('New Project') - header_title _("Projects"), dashboard_projects_path - add_page_specific_style 'page_bundles/new_namespace' +- add_page_specific_style 'page_bundles/projects' .project-edit-container .project-edit-errors diff --git a/app/views/projects/tree/_tree_header.html.haml b/app/views/projects/tree/_tree_header.html.haml index 44b16ba2d89..37f27aa7caf 100644 --- a/app/views/projects/tree/_tree_header.html.haml +++ b/app/views/projects/tree/_tree_header.html.haml @@ -1,3 +1,5 @@ +- add_page_specific_style 'page_bundles/projects' + .tree-ref-container.gl-display-flex.gl-flex-wrap.gl-gap-2.mb-2.mb-md-0 .tree-ref-holder.gl-max-w-26{ data: { testid: 'ref-dropdown-container' } } #js-tree-ref-switcher{ data: { project_id: @project.id, ref_type: @ref_type.to_s, project_root_path: project_path(@project) } } diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml index 17bf2e822cf..14785870dc0 100644 --- a/app/views/shared/projects/_list.html.haml +++ b/app/views/shared/projects/_list.html.haml @@ -1,3 +1,4 @@ +- add_page_specific_style 'page_bundles/projects' - projects_limit = 20 unless local_assigns[:projects_limit] - avatar = true unless local_assigns[:avatar] == false - use_creator_avatar = false unless local_assigns[:use_creator_avatar] == true diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index ac7c40095a7..0881c5bba54 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -5,6 +5,7 @@ - page_description @user.bio unless @user.blocked? || !@user.confirmed? - page_itemtype 'http://schema.org/Person' - add_page_specific_style 'page_bundles/profile' +- add_page_specific_style 'page_bundles/projects' - if show_super_sidebar? - @left_sidebar = true - @force_desktop_expanded_sidebar = true diff --git a/app/workers/gitlab/import/advance_stage.rb b/app/workers/gitlab/import/advance_stage.rb index 18f8ab46dde..180c08905ff 100644 --- a/app/workers/gitlab/import/advance_stage.rb +++ b/app/workers/gitlab/import/advance_stage.rb @@ -30,7 +30,6 @@ module Gitlab return end - project = Project.find_by_id(project_id) new_waiters = wait_for_jobs(waiters) new_job_count = new_waiters.values.sum @@ -42,8 +41,7 @@ module Gitlab if new_waiters.empty? proceed_to_next_stage(import_state_jid, next_stage, project_id) - elsif Feature.enabled?(:advance_stage_timeout, project) && timeout_reached?(timeout_timer) && - new_job_count == previous_job_count + elsif timeout_reached?(timeout_timer) && new_job_count == previous_job_count handle_timeout(import_state_jid, next_stage, project_id, new_waiters, new_job_count) else |