diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-01 12:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-01 12:09:24 +0300 |
commit | 3b1df712c7a15c9b6abadd61e9c8894fdeb0442a (patch) | |
tree | 6b9ca4abcc0f2114b86f40a49c3715005d1791c1 /app | |
parent | 8f535d9082bb0f10f2ef6b9133dbc77691ace4db (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 15 | ||||
-rw-r--r-- | app/models/application_setting.rb | 37 | ||||
-rw-r--r-- | app/models/ci/pipeline.rb | 1 | ||||
-rw-r--r-- | app/models/plan_limits.rb | 4 | ||||
-rw-r--r-- | app/views/projects/_files.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/blob/_blob.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/commit/_signature_badge.html.haml | 2 |
7 files changed, 40 insertions, 25 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 71f8478544b..7f1c28de8a7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -191,16 +191,17 @@ module ApplicationHelper } end - def edited_time_ago_with_tooltip(object, placement: 'top', html_class: 'time_ago', exclude_author: false) - return unless object.edited? + def edited_time_ago_with_tooltip(editable_object, placement: 'top', html_class: 'time_ago', exclude_author: false) + return unless editable_object.edited? content_tag :small, class: 'edited-text' do - output = content_tag(:span, 'Edited ') - output << time_ago_with_tooltip(object.last_edited_at, placement: placement, html_class: html_class) + timeago = time_ago_with_tooltip(editable_object.last_edited_at, placement: placement, html_class: html_class) - if !exclude_author && object.last_edited_by - output << content_tag(:span, ' by ') - output << link_to_member(object.project, object.last_edited_by, avatar: false, extra_class: 'gl-hover-text-decoration-underline', author_class: nil) + if !exclude_author && editable_object.last_edited_by + author_link = link_to_member(editable_object.project, editable_object.last_edited_by, avatar: false, extra_class: 'gl-hover-text-decoration-underline', author_class: nil) + output = safe_format(_("Edited %{timeago} by %{author}"), timeago: timeago, author: author_link) + else + output = safe_format(_("Edited %{timeago}"), timeago: timeago) end output diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 907d578eb37..4232e654d13 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -14,6 +14,31 @@ class ApplicationSetting < MainClusterwide::ApplicationRecord ignore_column :send_user_confirmation_email, remove_with: '15.8', remove_after: '2022-12-18' ignore_column :web_ide_clientside_preview_enabled, remove_with: '15.11', remove_after: '2023-04-22' ignore_columns %i[instance_administration_project_id instance_administrators_group_id], remove_with: '16.2', remove_after: '2023-06-22' + ignore_columns %i[ + encrypted_tofa_access_token_expires_in + encrypted_tofa_access_token_expires_in_iv + encrypted_tofa_client_library_args + encrypted_tofa_client_library_args_iv + encrypted_tofa_client_library_class + encrypted_tofa_client_library_class_iv + encrypted_tofa_client_library_create_credentials_method + encrypted_tofa_client_library_create_credentials_method_iv + encrypted_tofa_client_library_fetch_access_token_method + encrypted_tofa_client_library_fetch_access_token_method_iv + encrypted_tofa_credentials + encrypted_tofa_credentials_iv + encrypted_tofa_host + encrypted_tofa_host_iv + encrypted_tofa_request_json_keys + encrypted_tofa_request_json_keys_iv + encrypted_tofa_request_payload + encrypted_tofa_request_payload_iv + encrypted_tofa_response_json_keys + encrypted_tofa_response_json_keys_iv + encrypted_tofa_url + encrypted_tofa_url_iv + vertex_project + ], remove_with: '16.2', remove_after: '2023-06-22' INSTANCE_REVIEW_MIN_USERS = 50 GRAFANA_URL_ERROR_MESSAGE = 'Please check your Grafana URL setting in ' \ @@ -722,18 +747,6 @@ class ApplicationSetting < MainClusterwide::ApplicationRecord attr_encrypted :product_analytics_configurator_connection_string, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) attr_encrypted :openai_api_key, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) attr_encrypted :anthropic_api_key, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - # TOFA API integration settngs - attr_encrypted :tofa_client_library_args, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_client_library_class, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_client_library_create_credentials_method, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_client_library_fetch_access_token_method, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_credentials, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_host, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_request_json_keys, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_request_payload, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_response_json_keys, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_url, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) - attr_encrypted :tofa_access_token_expires_in, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) attr_encrypted :ai_access_token, encryption_options_base_32_aes_256_gcm.merge(encode: false, encode_iv: false) validates :disable_feed_token, diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index babea831d85..05ca9dd6596 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -366,7 +366,6 @@ module Ci project = pipeline&.project next unless project - next unless Feature.enabled?(:pipeline_trigger_merge_status, project) pipeline.run_after_commit do next if pipeline.child? diff --git a/app/models/plan_limits.rb b/app/models/plan_limits.rb index 7544e0d1411..2e9a6552b5d 100644 --- a/app/models/plan_limits.rb +++ b/app/models/plan_limits.rb @@ -9,8 +9,8 @@ class PlanLimits < ApplicationRecord belongs_to :plan - validates :notification_limit, numericality: { only_integer: true } - validates :enforcement_limit, numericality: { only_integer: true } + validates :notification_limit, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :enforcement_limit, numericality: { only_integer: true, greater_than_or_equal_to: 0 } def exceeded?(limit_name, subject, alternate_limit: 0) limit = limit_for(limit_name, alternate_limit: alternate_limit) diff --git a/app/views/projects/_files.html.haml b/app/views/projects/_files.html.haml index 60535d704c4..b5bbb57d58f 100644 --- a/app/views/projects/_files.html.haml +++ b/app/views/projects/_files.html.haml @@ -11,7 +11,8 @@ .info-well.gl-display-none.gl-sm-display-flex.project-last-commit.gl-flex-direction-column.gl-mt-5 #js-last-commit.gl-m-auto = gl_loading_icon(size: 'md') - #js-code-owners{ data: { branch: @ref, can_view_branch_rules: can_view_branch_rules?, branch_rules_path: branch_rules_path } } + - if project.licensed_feature_available?(:code_owners) + #js-code-owners{ data: { branch: @ref, can_view_branch_rules: can_view_branch_rules?, branch_rules_path: branch_rules_path } } .nav-block.gl-display-flex.gl-xs-flex-direction-column.gl-align-items-stretch = render 'projects/tree/tree_header', tree: @tree, is_project_overview: is_project_overview diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index 453a60a62f4..2aed0a92407 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -10,7 +10,8 @@ %ul.blob-commit-info = render 'projects/commits/commit', commit: @last_commit, project: @project, ref: @ref - #js-code-owners{ data: { blob_path: blob.path, project_path: @project.full_path, branch: @ref, can_view_branch_rules: can_view_branch_rules?, branch_rules_path: branch_rules_path } } + - if project.licensed_feature_available?(:code_owners) + #js-code-owners{ data: { blob_path: blob.path, project_path: @project.full_path, branch: @ref, can_view_branch_rules: can_view_branch_rules?, branch_rules_path: branch_rules_path } } = render "projects/blob/auxiliary_viewer", blob: blob - if project.forked? diff --git a/app/views/projects/commit/_signature_badge.html.haml b/app/views/projects/commit/_signature_badge.html.haml index 9cca928e794..5b99a88f29e 100644 --- a/app/views/projects/commit/_signature_badge.html.haml +++ b/app/views/projects/commit/_signature_badge.html.haml @@ -29,5 +29,5 @@ = link_to(_('Learn about signing commits'), help_page_path('user/project/repository/gpg_signed_commits/index.md'), class: 'gl-link gl-display-block gl-mt-3') -%a.signature-badge.gl-display-inline-block{ role: 'button', tabindex: 0, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } } +%a.signature-badge.gl-display-inline-block.gl-ml-4{ role: 'button', tabindex: 0, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } } = gl_badge_tag label, variant: variant |