From 51bc2d8e703f667483505f0e3d074f442e1f48e6 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 5 Oct 2022 18:08:18 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../queries/epic_participants.query.graphql | 2 -- app/assets/stylesheets/startup/startup-dark.scss | 22 ++++++++++++++++++++++ .../stylesheets/startup/startup-general.scss | 17 +++++++++++++++++ .../concerns/authenticates_with_two_factor.rb | 2 -- app/controllers/projects/application_controller.rb | 4 ++-- app/models/ci/build.rb | 5 +++-- app/models/ci/build_metadata.rb | 2 +- app/models/ci/pipeline.rb | 4 ++-- app/models/project_ci_cd_setting.rb | 4 ---- .../resource_access_tokens/create_service.rb | 4 ++-- app/views/admin/users/show.html.haml | 2 +- app/views/layouts/header/_default.html.haml | 2 +- app/views/layouts/terms.html.haml | 2 +- app/views/projects/settings/ci_cd/_badge.html.haml | 18 +++++++++--------- app/views/search/results/_snippet_title.html.haml | 2 +- app/views/shared/blob/_markdown_buttons.html.haml | 6 ++---- app/views/shared/members/_member.html.haml | 2 +- 17 files changed, 65 insertions(+), 35 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/sidebar/queries/epic_participants.query.graphql b/app/assets/javascripts/sidebar/queries/epic_participants.query.graphql index d665ca1e084..71ce58fb9cc 100644 --- a/app/assets/javascripts/sidebar/queries/epic_participants.query.graphql +++ b/app/assets/javascripts/sidebar/queries/epic_participants.query.graphql @@ -1,5 +1,4 @@ #import "~/graphql_shared/fragments/user.fragment.graphql" -#import "~/graphql_shared/fragments/user_availability.fragment.graphql" query epicParticipants($fullPath: ID!, $iid: ID) { workspace: group(fullPath: $fullPath) { @@ -9,7 +8,6 @@ query epicParticipants($fullPath: ID!, $iid: ID) { participants { nodes { ...User - ...UserAvailability } } } diff --git a/app/assets/stylesheets/startup/startup-dark.scss b/app/assets/stylesheets/startup/startup-dark.scss index 0450b3d9a44..ac3f2d342f4 100644 --- a/app/assets/stylesheets/startup/startup-dark.scss +++ b/app/assets/stylesheets/startup/startup-dark.scss @@ -368,6 +368,23 @@ kbd kbd { white-space: nowrap; border: 0; } +.gl-avatar { + border-width: 1px; + border-style: solid; + border-color: rgba(0, 0, 0, 0.08); + overflow: hidden; + flex-shrink: 0; +} +.gl-avatar-s24 { + width: 1.5rem; + height: 1.5rem; + font-size: 0.75rem; + line-height: 1rem; + border-radius: 0.25rem; +} +.gl-avatar-circle { + border-radius: 50%; +} .gl-badge { display: inline-flex; align-items: center; @@ -1783,10 +1800,15 @@ body.gl-dark { background-color: #262626; border-right: 1px solid #303030; } +.gl-avatar:not(.gl-avatar-identicon), .avatar-container, .avatar { background: rgba(255, 255, 255, 0.04); } +.gl-avatar { + border-style: none; + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); +} body.gl-dark { --gl-theme-accent: #868686; } diff --git a/app/assets/stylesheets/startup/startup-general.scss b/app/assets/stylesheets/startup/startup-general.scss index 356fb58b4c8..24c6449168a 100644 --- a/app/assets/stylesheets/startup/startup-general.scss +++ b/app/assets/stylesheets/startup/startup-general.scss @@ -349,6 +349,23 @@ kbd kbd { white-space: nowrap; border: 0; } +.gl-avatar { + border-width: 1px; + border-style: solid; + border-color: rgba(0, 0, 0, 0.08); + overflow: hidden; + flex-shrink: 0; +} +.gl-avatar-s24 { + width: 1.5rem; + height: 1.5rem; + font-size: 0.75rem; + line-height: 1rem; + border-radius: 0.25rem; +} +.gl-avatar-circle { + border-radius: 50%; +} .gl-badge { display: inline-flex; align-items: center; diff --git a/app/controllers/concerns/authenticates_with_two_factor.rb b/app/controllers/concerns/authenticates_with_two_factor.rb index 84f64ba10b9..fbaa754124c 100644 --- a/app/controllers/concerns/authenticates_with_two_factor.rb +++ b/app/controllers/concerns/authenticates_with_two_factor.rb @@ -160,8 +160,6 @@ module AuthenticatesWithTwoFactor end def send_two_factor_otp_attempt_failed_email(user) - return if Feature.disabled?(:email_for_two_factor_otp_failure) - user.notification_service.two_factor_otp_attempt_failed(user, request.remote_ip) end diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb index 028b7af02c9..2256471047d 100644 --- a/app/controllers/projects/application_controller.rb +++ b/app/controllers/projects/application_controller.rb @@ -39,8 +39,8 @@ class Projects::ApplicationController < ApplicationController access_denied!( _('You must have developer or higher permissions in the associated project to view job logs when debug trace ' \ "is enabled. To disable debug trace, set the 'CI_DEBUG_TRACE' variable to 'false' in your pipeline " \ - 'configuration or CI/CD settings. If you need to view this job log, a project maintainer must add you to ' \ - 'the project with developer permissions or higher.') + 'configuration or CI/CD settings. If you need to view this job log, a project maintainer or owner must add ' \ + 'you to the project with developer permissions or higher.') ) else access_denied!(_('The current user is not authorized to access the job log.')) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index f67d1983356..282622c792e 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -108,7 +108,8 @@ module Ci validates :ref, presence: true scope :not_interruptible, -> do - joins(:metadata).where.not('ci_builds_metadata.id' => Ci::BuildMetadata.scoped_build.with_interruptible.select(:id)) + joins(:metadata) + .where.not(Ci::BuildMetadata.table_name => { id: Ci::BuildMetadata.scoped_build.with_interruptible.select(:id) }) end scope :unstarted, -> { where(runner_id: nil) } @@ -187,7 +188,7 @@ module Ci scope :license_management_jobs, -> { where(name: %i(license_management license_scanning)) } # handle license rename https://gitlab.com/gitlab-org/gitlab/issues/8911 scope :with_secure_reports_from_config_options, -> (job_types) do - joins(:metadata).where("ci_builds_metadata.config_options -> 'artifacts' -> 'reports' ?| array[:job_types]", job_types: job_types) + joins(:metadata).where("#{Ci::BuildMetadata.quoted_table_name}.config_options -> 'artifacts' -> 'reports' ?| array[:job_types]", job_types: job_types) end scope :with_coverage, -> { where.not(coverage: nil) } diff --git a/app/models/ci/build_metadata.rb b/app/models/ci/build_metadata.rb index 6d412d49083..33092e881f0 100644 --- a/app/models/ci/build_metadata.rb +++ b/app/models/ci/build_metadata.rb @@ -30,7 +30,7 @@ module Ci chronic_duration_attr_reader :timeout_human_readable, :timeout - scope :scoped_build, -> { where('ci_builds_metadata.build_id = ci_builds.id') } + scope :scoped_build, -> { where("#{quoted_table_name}.build_id = #{Ci::Build.quoted_table_name}.id") } scope :with_interruptible, -> { where(interruptible: true) } scope :with_exposed_artifacts, -> { where(has_exposed_artifacts: true) } diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 2631ed3f672..853437b2d27 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -995,8 +995,8 @@ module Ci # See: https://gitlab.com/gitlab-org/gitlab/-/issues/340781#note_699114700 expanded_environment_names = builds_in_self_and_project_descendants.joins(:metadata) - .where.not('ci_builds_metadata.expanded_environment_name' => nil) - .distinct('ci_builds_metadata.expanded_environment_name') + .where.not(Ci::BuildMetadata.table_name => { expanded_environment_name: nil }) + .distinct("#{Ci::BuildMetadata.quoted_table_name}.expanded_environment_name") .limit(100) .pluck(:expanded_environment_name) diff --git a/app/models/project_ci_cd_setting.rb b/app/models/project_ci_cd_setting.rb index 38740aa20dd..d7a5d0d9d84 100644 --- a/app/models/project_ci_cd_setting.rb +++ b/app/models/project_ci_cd_setting.rb @@ -22,10 +22,6 @@ class ProjectCiCdSetting < ApplicationRecord chronic_duration_attr :runner_token_expiration_interval_human_readable, :runner_token_expiration_interval - def forward_deployment_enabled? - super && ::Feature.enabled?(:forward_deployment_enabled, project) - end - def keep_latest_artifacts_available? # The project level feature can only be enabled when the feature is enabled instance wide Gitlab::CurrentSettings.current_application_settings.keep_latest_artifact? && keep_latest_artifact? diff --git a/app/services/resource_access_tokens/create_service.rb b/app/services/resource_access_tokens/create_service.rb index 3a155a816b0..b8a210c0a95 100644 --- a/app/services/resource_access_tokens/create_service.rb +++ b/app/services/resource_access_tokens/create_service.rb @@ -47,9 +47,9 @@ module ResourceAccessTokens end def create_user - # Even project maintainers can create project access tokens, which in turn + # Even project maintainers/owners can create project access tokens, which in turn # creates a bot user, and so it becomes necessary to have `skip_authorization: true` - # since someone like a project maintainer does not inherently have the ability + # since someone like a project maintainer/owner does not inherently have the ability # to create a new user in the system. ::Users::AuthorizedCreateService.new(current_user, default_user_params).execute diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 4b3ea0af100..7edea81a123 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -11,7 +11,7 @@ - c.body do %ul.content-list %li - = image_tag avatar_icon_for_user(@user, 60, current_user: current_user), class: "avatar s60" + = render Pajamas::AvatarComponent.new(@user, size: 64, class: 'gl-mr-3') %li %span.light= _('Profile page:') %strong diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index a00c5c186cc..800dcef5b72 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -132,7 +132,7 @@ - if header_link?(:user_dropdown) %li.nav-item.header-user.js-nav-user-dropdown.dropdown{ data: { track_label: "profile_dropdown", track_action: "click_dropdown", track_value: "", qa_selector: 'user_menu', testid: 'user-menu' }, class: ('mr-0' if has_impersonation_link) } = link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do - = image_tag avatar_icon_for_user(current_user, 23), width: 23, height: 23, class: "header-user-avatar qa-user-avatar", alt: current_user.name + = render Pajamas::AvatarComponent.new(current_user, size: 24, class: 'header-user-avatar qa-user-avatar') = render_if_exists 'layouts/header/user_notification_dot', project: project, namespace: group = sprite_icon('chevron-down', css_class: 'caret-down') .dropdown-menu.dropdown-menu-right diff --git a/app/views/layouts/terms.html.haml b/app/views/layouts/terms.html.haml index c9baf0cd2b8..91848b4f54b 100644 --- a/app/views/layouts/terms.html.haml +++ b/app/views/layouts/terms.html.haml @@ -25,7 +25,7 @@ %ul.nav.navbar-nav %li.header-user.dropdown = link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do - = image_tag avatar_icon_for_user(current_user, 23), width: 23, height: 23, class: "header-user-avatar", data: { qa_selector: 'user_avatar' } + = render Pajamas::AvatarComponent.new(current_user, size: 24, class: 'gl-mr-3', avatar_options: { data: { qa_selector: 'user_avatar' } }) = sprite_icon('chevron-down') .dropdown-menu.dropdown-menu-right = render 'layouts/header/current_user_dropdown' diff --git a/app/views/projects/settings/ci_cd/_badge.html.haml b/app/views/projects/settings/ci_cd/_badge.html.haml index 38d8c8d26e1..99eef38827b 100644 --- a/app/views/projects/settings/ci_cd/_badge.html.haml +++ b/app/views/projects/settings/ci_cd/_badge.html.haml @@ -2,15 +2,15 @@ .col-lg-12 %h4 = badge.title.capitalize - .card - .card-header - %b - = badge.title.capitalize - · - = badge.to_html - .float-right - = render 'shared/ref_switcher', destination: 'badges', align_right: true - .card-body + = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-5' }, header_options: { class: 'gl-display-flex gl-align-items-center' }) do |c| + - c.header do + .gl-flex-grow-1 + %b + = badge.title.capitalize + · + = badge.to_html + = render 'shared/ref_switcher', destination: 'badges', align_right: true + - c.body do .row .col-md-2.gl-text-center Markdown diff --git a/app/views/search/results/_snippet_title.html.haml b/app/views/search/results/_snippet_title.html.haml index a28d9effbdd..a811dabf399 100644 --- a/app/views/search/results/_snippet_title.html.haml +++ b/app/views/search/results/_snippet_title.html.haml @@ -15,6 +15,6 @@ %span by = link_to user_snippets_path(snippet_title.author) do - = image_tag avatar_icon_for_user(snippet_title.author), class: "avatar avatar-inline s16", alt: '' + = render Pajamas::AvatarComponent.new(snippet_title.author, size: 16, class: 'gl-mt-n1') = snippet_title.author_name %span.light= time_ago_with_tooltip(snippet_title.created_at) diff --git a/app/views/shared/blob/_markdown_buttons.html.haml b/app/views/shared/blob/_markdown_buttons.html.haml index 63ba8a2e0f9..6eae3123ba0 100644 --- a/app/views/shared/blob/_markdown_buttons.html.haml +++ b/app/views/shared/blob/_markdown_buttons.html.haml @@ -37,8 +37,6 @@ title: _("Add a collapsible section") }) = markdown_toolbar_button({ icon: "table", data: { "md-tag" => "| header | header |\n| ------ | ------ |\n| cell | cell |\n| cell | cell |", "md-prepend" => true }, title: _("Add a table") }) - if supports_file_upload - = render Pajamas::ButtonComponent.new(icon: 'paperclip', category: :tertiary, button_options: { 'aria-label': _("Attach a file or image"), class: 'has-tooltip js-attach-file-button', data: { testid: 'button-attach-file', container: 'body' } }) do - = _("Attach a file or image") + = render Pajamas::ButtonComponent.new(icon: 'paperclip', category: :tertiary, button_options: { 'aria-label': _("Attach a file or image"), class: 'has-tooltip js-attach-file-button', data: { testid: 'button-attach-file', container: 'body' } }) - if show_fullscreen_button - = render Pajamas::ButtonComponent.new(icon: 'maximize', category: :tertiary, button_options: { 'tabindex': -1, 'aria-label': _("Go full screen"), class: 'has-tooltip js-zen-enter', data: { container: 'body' } }) do - = _("Go full screen") + = render Pajamas::ButtonComponent.new(icon: 'maximize', category: :tertiary, button_options: { 'tabindex': -1, 'aria-label': _("Go full screen"), class: 'has-tooltip js-zen-enter', data: { container: 'body' } }) diff --git a/app/views/shared/members/_member.html.haml b/app/views/shared/members/_member.html.haml index 23f78f4be45..376e51a6b15 100644 --- a/app/views/shared/members/_member.html.haml +++ b/app/views/shared/members/_member.html.haml @@ -12,7 +12,7 @@ %li.member.js-member.py-2.px-3.d-flex.flex-column{ class: [dom_class(member), ("flex-md-row" unless force_mobile_view)], id: dom_id(member), data: { qa_selector: 'member_row' } } %span.list-item-name.mb-2.m-md-0 - if user - = image_tag avatar_icon_for_user(user, 40), class: "avatar s40 flex-shrink-0 flex-grow-0", alt: '' + = render Pajamas::AvatarComponent.new(user, size: 32, class: 'gl-mr-3 flex-shrink-0 flex-grow-0') .user-info %span.mr-1 = link_to user.name, user_path(user), class: 'member js-user-link', data: { user_id: user.id } -- cgit v1.2.1