diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/static_site_editor/components/static_site_editor.vue | 6 | ||||
-rw-r--r-- | app/controllers/projects/alert_management_controller.rb | 11 | ||||
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 3 | ||||
-rw-r--r-- | app/graphql/resolvers/issues_resolver.rb | 16 | ||||
-rw-r--r-- | app/graphql/types/issuable_sort_enum.rb | 3 | ||||
-rw-r--r-- | app/models/commit_status.rb | 8 | ||||
-rw-r--r-- | app/presenters/commit_status_presenter.rb | 8 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_project.html.haml | 12 | ||||
-rw-r--r-- | app/views/notify/issues_csv_email.html.haml | 9 | ||||
-rw-r--r-- | app/views/notify/issues_csv_email.text.erb | 4 | ||||
-rw-r--r-- | app/views/projects/issues/export_csv/_modal.html.haml | 1 | ||||
-rw-r--r-- | app/views/shared/members/_badge.html.haml | 4 | ||||
-rw-r--r-- | app/views/shared/members/_blocked_badge.html.haml | 3 | ||||
-rw-r--r-- | app/views/shared/members/_its_you_badge.html.haml | 3 | ||||
-rw-r--r-- | app/views/shared/members/_member.html.haml | 25 | ||||
-rw-r--r-- | app/views/shared/members/_two_factor_auth_badge.html.haml | 3 |
16 files changed, 76 insertions, 43 deletions
diff --git a/app/assets/javascripts/static_site_editor/components/static_site_editor.vue b/app/assets/javascripts/static_site_editor/components/static_site_editor.vue index 82917319fc3..d45c3d08ef4 100644 --- a/app/assets/javascripts/static_site_editor/components/static_site_editor.vue +++ b/app/assets/javascripts/static_site_editor/components/static_site_editor.vue @@ -5,7 +5,7 @@ import { GlSkeletonLoader } from '@gitlab/ui'; import EditArea from './edit_area.vue'; import EditHeader from './edit_header.vue'; import SavedChangesMessage from './saved_changes_message.vue'; -import Toolbar from './publish_toolbar.vue'; +import PublishToolbar from './publish_toolbar.vue'; import InvalidContentMessage from './invalid_content_message.vue'; import SubmitChangesError from './submit_changes_error.vue'; @@ -16,7 +16,7 @@ export default { InvalidContentMessage, GlSkeletonLoader, SavedChangesMessage, - Toolbar, + PublishToolbar, SubmitChangesError, }, computed: { @@ -80,7 +80,7 @@ export default { :value="content" @input="setContent" /> - <toolbar + <publish-toolbar :return-url="returnUrl" :saveable="contentChanged" :saving-changes="isSavingChanges" diff --git a/app/controllers/projects/alert_management_controller.rb b/app/controllers/projects/alert_management_controller.rb index 46db87dba94..5480e19072d 100644 --- a/app/controllers/projects/alert_management_controller.rb +++ b/app/controllers/projects/alert_management_controller.rb @@ -1,9 +1,14 @@ # frozen_string_literal: true class Projects::AlertManagementController < Projects::ApplicationController + before_action :ensure_feature_enabled + def index - respond_to do |format| - format.html - end + end + + private + + def ensure_feature_enabled + render_404 unless Feature.enabled?(:alert_management_minimal, project) end end diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 3aae8990f07..3d53ad1a29f 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -193,7 +193,8 @@ class Projects::IssuesController < Projects::ApplicationController ExportCsvWorker.perform_async(current_user.id, project.id, finder_options.to_h) # rubocop:disable CodeReuse/Worker index_path = project_issues_path(project) - redirect_to(index_path, notice: "Your CSV export has started. It will be emailed to #{current_user.notification_email} when complete.") + message = _('Your CSV export has started. It will be emailed to %{email} when complete.') % { email: current_user.notification_email } + redirect_to(index_path, notice: message) end def import_csv diff --git a/app/graphql/resolvers/issues_resolver.rb b/app/graphql/resolvers/issues_resolver.rb index 04da54a6bb6..4d33a874a81 100644 --- a/app/graphql/resolvers/issues_resolver.rb +++ b/app/graphql/resolvers/issues_resolver.rb @@ -52,6 +52,8 @@ module Resolvers type Types::IssueType, null: true + NON_STABLE_CURSOR_SORTS = %i[priority_asc priority_desc].freeze + def resolve(**args) # The project could have been loaded in batch by `BatchLoader`. # At this point we need the `id` of the project to query for issues, so @@ -70,7 +72,15 @@ module Resolvers args[:iids] ||= [args[:iid]].compact args[:attempt_project_search_optimizations] = args[:search].present? - IssuesFinder.new(context[:current_user], args).execute + issues = IssuesFinder.new(context[:current_user], args).execute + + if non_stable_cursor_sort?(args[:sort]) + # Certain complex sorts are not supported by the stable cursor pagination yet. + # In these cases, we use offset pagination, so we return the correct connection. + Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection.new(issues) + else + issues + end end def self.resolver_complexity(args, child_complexity:) @@ -79,5 +89,9 @@ module Resolvers complexity end + + def non_stable_cursor_sort?(sort) + NON_STABLE_CURSOR_SORTS.include?(sort) + end end end diff --git a/app/graphql/types/issuable_sort_enum.rb b/app/graphql/types/issuable_sort_enum.rb index 9fb1249d582..bade05b2744 100644 --- a/app/graphql/types/issuable_sort_enum.rb +++ b/app/graphql/types/issuable_sort_enum.rb @@ -4,5 +4,8 @@ module Types class IssuableSortEnum < SortEnum graphql_name 'IssuableSort' description 'Values for sorting issuables' + + value 'PRIORITY_ASC', 'Priority by ascending order', value: :priority_asc + value 'PRIORITY_DESC', 'Priority by descending order', value: :priority_desc end end diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 046f131b041..a2a30c61bfb 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -267,8 +267,16 @@ class CommitStatus < ApplicationRecord end end + def recoverable? + failed? && !unrecoverable_failure? + end + private + def unrecoverable_failure? + script_failure? || missing_dependency_failure? || archived_failure? || scheduler_failure? || data_integrity_failure? + end + def schedule_stage_and_pipeline_update if Feature.enabled?(:ci_atomic_processing, project) # Atomic Processing requires only single Worker diff --git a/app/presenters/commit_status_presenter.rb b/app/presenters/commit_status_presenter.rb index 23e688e562e..52811e152a6 100644 --- a/app/presenters/commit_status_presenter.rb +++ b/app/presenters/commit_status_presenter.rb @@ -33,14 +33,6 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated def callout_failure_message self.class.callout_failure_messages.fetch(failure_reason.to_sym) end - - def recoverable? - failed? && !unrecoverable? - end - - def unrecoverable? - script_failure? || missing_dependency_failure? || archived_failure? || scheduler_failure? || data_integrity_failure? - end end CommitStatusPresenter.prepend_if_ee('::EE::CommitStatusPresenter') diff --git a/app/views/layouts/nav/sidebar/_project.html.haml b/app/views/layouts/nav/sidebar/_project.html.haml index 3aa056fad7b..9df6a7dfc07 100644 --- a/app/views/layouts/nav/sidebar/_project.html.haml +++ b/app/views/layouts/nav/sidebar/_project.html.haml @@ -222,12 +222,14 @@ %span = _('Metrics') - - if project_nav_tab?(:alert_management) - = nav_link(controller: :alert_management) do - = link_to project_alert_management_index_path(@project), title: _('Alerts'), class: 'shortcuts-tracking qa-operations-tracking-link' do - %span - = _('Alerts') + - if Feature.enabled?(:alert_management_minimal, @project) + - if project_nav_tab?(:alert_management) + = nav_link(controller: :alert_management) do + = link_to project_alert_management_index_path(@project), title: _('Alerts'), class: 'shortcuts-tracking qa-operations-tracking-link' do + %span + = _('Alerts') + - if project_nav_tab? :environments = render_if_exists "layouts/nav/sidebar/tracing_link" = nav_link(controller: :environments, action: [:index, :folder, :show, :new, :edit, :create, :update, :stop, :terminal]) do diff --git a/app/views/notify/issues_csv_email.html.haml b/app/views/notify/issues_csv_email.html.haml index b777ca1e57d..77502a45f02 100644 --- a/app/views/notify/issues_csv_email.html.haml +++ b/app/views/notify/issues_csv_email.html.haml @@ -1,9 +1,6 @@ --# haml-lint:disable NoPlainNodes %p{ style: 'font-size:18px; text-align:center; line-height:30px;' } - Your CSV export of #{ pluralize(@written_count, 'issue') } from project - %a{ href: project_url(@project), style: "color:#3777b0; text-decoration:none; display:block;" } - = @project.full_name - has been added to this email as an attachment. + - project_link = link_to(@project.full_name, project_url(@project), style: "color:#3777b0; text-decoration:none; display:block;") + = _('Your CSV export of %{issues_count} from project %{project_link} has been added to this email as an attachment.').html_safe % { issues_count: pluralize(@written_count, 'issue'), project_link: project_link } - if @truncated %p - This attachment has been truncated to avoid exceeding a maximum allowed attachment size of 15MB. #{ @written_count } of #{ @issues_count } issues have been included. Consider re-exporting with a narrower selection of issues. + = _('This attachment has been truncated to avoid exceeding the maximum allowed attachment size of 15MB. %{written_count} of %{issues_count} issues have been included. Consider re-exporting with a narrower selection of issues.') % { written_count: @written_count, issues_count: @issues_count } diff --git a/app/views/notify/issues_csv_email.text.erb b/app/views/notify/issues_csv_email.text.erb index 5d4128e3ae9..a1d2a4691bc 100644 --- a/app/views/notify/issues_csv_email.text.erb +++ b/app/views/notify/issues_csv_email.text.erb @@ -1,5 +1,5 @@ -Your CSV export of <%= pluralize(@written_count, 'issue') %> from project <%= @project.full_name %> (<%= project_url(@project) %>) has been added to this email as an attachment. +<%= _('Your CSV export of %{written_count} from project %{project_name} (%{project_url}) has been added to this email as an attachment.') % { written_count: pluralize(@written_count, 'issue'), project_name: @project.full_name, project_url: project_url(@project) } %> <% if @truncated %> -This attachment has been truncated to avoid exceeding a maximum allowed attachment size of 15MB. <%= @written_count %> of <%= @issues_count %> issues have been included. Consider re-exporting with a narrower selection of issues. + <%= _('This attachment has been truncated to avoid exceeding the maximum allowed attachment size of 15MB. %{written_count} of %{issues_count} issues have been included. Consider re-exporting with a narrower selection of issues.') % { written_count: @written_count, issues_count: @issues_count} %> <% end %> diff --git a/app/views/projects/issues/export_csv/_modal.html.haml b/app/views/projects/issues/export_csv/_modal.html.haml index af3a087ca59..9fdeb901b56 100644 --- a/app/views/projects/issues/export_csv/_modal.html.haml +++ b/app/views/projects/issues/export_csv/_modal.html.haml @@ -1,4 +1,3 @@ --# haml-lint:disable NoPlainNodes - if current_user .issues-export-modal.modal .modal-dialog diff --git a/app/views/shared/members/_badge.html.haml b/app/views/shared/members/_badge.html.haml new file mode 100644 index 00000000000..e304207f3e9 --- /dev/null +++ b/app/views/shared/members/_badge.html.haml @@ -0,0 +1,4 @@ +- type ||= 'info' + +%span.px-1.py-1 + %span{ class: "badge badge-#{type}" }= yield diff --git a/app/views/shared/members/_blocked_badge.html.haml b/app/views/shared/members/_blocked_badge.html.haml new file mode 100644 index 00000000000..95335ebe74d --- /dev/null +++ b/app/views/shared/members/_blocked_badge.html.haml @@ -0,0 +1,3 @@ +- if user.blocked? + = render 'shared/members/badge', type: 'danger' do + = _("Blocked") diff --git a/app/views/shared/members/_its_you_badge.html.haml b/app/views/shared/members/_its_you_badge.html.haml new file mode 100644 index 00000000000..b53ffd8032d --- /dev/null +++ b/app/views/shared/members/_its_you_badge.html.haml @@ -0,0 +1,3 @@ +- if user == current_user + = render 'shared/members/badge', type: 'success' do + = _("It's you") diff --git a/app/views/shared/members/_member.html.haml b/app/views/shared/members/_member.html.haml index d74030c566f..31eba9d71ee 100644 --- a/app/views/shared/members/_member.html.haml +++ b/app/views/shared/members/_member.html.haml @@ -13,24 +13,23 @@ - if user = image_tag avatar_icon_for_user(user, 40), class: "avatar s40 flex-shrink-0 flex-grow-0", alt: '' .user-info - = link_to user.name, user_path(user), class: 'member js-user-link', data: { user_id: user.id } - = user_status(user) - %span.cgray= user.to_reference + %span.mr-1 + = link_to user.name, user_path(user), class: 'member js-user-link', data: { user_id: user.id } + = user_status(user) + %span.cgray= user.to_reference - = render_if_exists 'shared/members/ee/sso_badge', member: member + .mx-n1.d-inline-flex.flex-wrap + = render_if_exists 'shared/members/ee/sso_badge', member: member - - if user == current_user - %span.badge.badge-success.prepend-left-5= _("It's you") + = render_if_exists 'shared/members/ee/gma_badge', member: member - = render_if_exists 'shared/members/ee/license_badge', user: user, group: @group + = render 'shared/members/its_you_badge', user: user, current_user: current_user - - if user.blocked? - %label.badge.badge-danger - %strong= _("Blocked") + = render_if_exists 'shared/members/ee/license_badge', user: user, group: @group - - if user.two_factor_enabled? - %label.badge.badge-info - = _("2FA") + = render 'shared/members/blocked_badge', user: user + + = render 'shared/members/two_factor_auth_badge', user: user - if source.instance_of?(Group) && source != @group · diff --git a/app/views/shared/members/_two_factor_auth_badge.html.haml b/app/views/shared/members/_two_factor_auth_badge.html.haml new file mode 100644 index 00000000000..34850c135d6 --- /dev/null +++ b/app/views/shared/members/_two_factor_auth_badge.html.haml @@ -0,0 +1,3 @@ +- if user.two_factor_enabled? + = render 'shared/members/badge', type: 'info' do + = _("2FA") |