diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-11 21:14:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-11 21:14:04 +0300 |
commit | 11c2b8eff6ca5360fb0f732b23b764d2a0b81be5 (patch) | |
tree | 7f92622462127ff24023283133f81d9c4b2f6842 /app | |
parent | e40f19ef830c5863089bc6a7a73e6695efa60a13 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
13 files changed, 65 insertions, 63 deletions
diff --git a/app/assets/javascripts/lib/apollo/suppress_network_errors_during_navigation_link.js b/app/assets/javascripts/lib/apollo/suppress_network_errors_during_navigation_link.js index ad92bd4de42..9b7901685b6 100644 --- a/app/assets/javascripts/lib/apollo/suppress_network_errors_during_navigation_link.js +++ b/app/assets/javascripts/lib/apollo/suppress_network_errors_during_navigation_link.js @@ -9,10 +9,6 @@ import { isNavigatingAway } from '~/lib/utils/is_navigating_away'; * @returns {ApolloLink|null} */ export const getSuppressNetworkErrorsDuringNavigationLink = () => { - if (!gon.features?.suppressApolloErrorsDuringNavigation) { - return null; - } - return onError(({ networkError }) => { if (networkError && isNavigatingAway()) { // Return an observable that will never notify any subscribers with any diff --git a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue index 69fb5878f5c..0995947f3e7 100644 --- a/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue +++ b/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_section_link.vue @@ -40,6 +40,7 @@ export default { data-track-action="click_link" :data-track-label="$options.i18n.ACTION_LABELS[action].title" data-track-property="Growth::Conversion::Experiment::LearnGitLab" + data-track-experiment="change_continuous_onboarding_link_urls" > {{ $options.i18n.ACTION_LABELS[action].title }} </gl-link> diff --git a/app/assets/stylesheets/pages/deploy_keys.scss b/app/assets/stylesheets/pages/deploy_keys.scss index 2fafe052106..997e42a8fd5 100644 --- a/app/assets/stylesheets/pages/deploy_keys.scss +++ b/app/assets/stylesheets/pages/deploy_keys.scss @@ -1,12 +1,3 @@ -.deploy-keys-list { - width: 100%; - overflow: auto; - - table { - border: 1px solid $table-border-color; - } -} - .deploy-keys-title { padding-bottom: 2px; line-height: 2; diff --git a/app/experiments/change_continuous_onboarding_link_urls_experiment.rb b/app/experiments/change_continuous_onboarding_link_urls_experiment.rb new file mode 100644 index 00000000000..680cb8eadd8 --- /dev/null +++ b/app/experiments/change_continuous_onboarding_link_urls_experiment.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class ChangeContinuousOnboardingLinkUrlsExperiment < ApplicationExperiment # rubocop:disable Gitlab/NamespacedClass + attr_writer :namespace + + def track(action, **event_args) + super(action, **event_args.merge(namespace: @namespace)) + end +end diff --git a/app/helpers/learn_gitlab_helper.rb b/app/helpers/learn_gitlab_helper.rb index 4f69d1bba0e..a7c77bcad67 100644 --- a/app/helpers/learn_gitlab_helper.rb +++ b/app/helpers/learn_gitlab_helper.rb @@ -13,6 +13,7 @@ module LearnGitlabHelper urls_to_use = nil experiment(:change_continuous_onboarding_link_urls) do |e| + e.namespace = project.namespace e.use { urls_to_use = action_urls } e.try { urls_to_use = new_action_urls(project) } end diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index c2d1447bf8b..d81db357162 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -47,6 +47,9 @@ class ProjectPolicy < BasePolicy desc "Project is archived" condition(:archived, scope: :subject, score: 0) { project.archived? } + desc "Project is in the process of being deleted" + condition(:pending_delete) { project.pending_delete? } + condition(:default_issues_tracker, scope: :subject) { project.default_issues_tracker? } desc "Container registry is disabled" @@ -457,7 +460,13 @@ class ProjectPolicy < BasePolicy prevent(*readonly_abilities) readonly_features.each do |feature| - prevent(*create_update_admin_destroy(feature)) + prevent(*create_update_admin(feature)) + end + end + + rule { archived & ~pending_delete }.policy do + readonly_features.each do |feature| + prevent(:"destroy_#{feature}") end end diff --git a/app/views/admin/deploy_keys/index.html.haml b/app/views/admin/deploy_keys/index.html.haml index 1cbb5296f8d..ba4abdc02e4 100644 --- a/app/views/admin/deploy_keys/index.html.haml +++ b/app/views/admin/deploy_keys/index.html.haml @@ -7,31 +7,38 @@ %h3.page-title.deploy-keys-title = _('Public deploy keys (%{deploy_keys_count})') % { deploy_keys_count: @deploy_keys.load.size } = link_to _('New deploy key'), new_admin_deploy_key_path, class: 'float-right btn gl-button btn-confirm btn-md gl-button' - .table-holder.deploy-keys-list - %table.table - %thead + %table.table.b-table.gl-table.b-table-stacked-lg{ data: { testid: 'deploy-keys-list' } } + %thead + %tr + %th= _('Title') + %th= _('Fingerprint') + %th= _('Projects with write access') + %th= _('Created') + %th.gl-lg-w-1px.gl-white-space-nowrap + %span.gl-sr-only + = _('Actions') + %tbody + - @deploy_keys.each do |deploy_key| %tr - %th.col-sm-2= _('Title') - %th.col-sm-4= _('Fingerprint') - %th.col-sm-2= _('Projects with write access') - %th.col-sm-2= _('Added at') - %th.col-sm-2 - %tbody - - @deploy_keys.each do |deploy_key| - %tr - %td - %strong= deploy_key.title - %td - %code.key-fingerprint= deploy_key.fingerprint - %td + %td{ data: { label: _('Title') } } + %div + = deploy_key.title + %td{ data: { label: _('Fingerprint') } } + %div + %code= deploy_key.fingerprint + %td{ data: { label: _('Projects with write access') } } + %div - deploy_key.projects_with_write_access.each do |project| - = link_to project.full_name, admin_project_path(project), class: 'label deploy-project-label' - %td - %span.cgray - = _('added %{created_at_timeago}').html_safe % { created_at_timeago: time_ago_with_tooltip(deploy_key.created_at) } - %td - .float-right - = link_to _('Edit'), edit_admin_deploy_key_path(deploy_key), class: 'btn gl-button btn-sm' - = link_to _('Remove'), admin_deploy_key_path(deploy_key), data: { confirm: _('Are you sure?') }, method: :delete, class: 'gl-button btn btn-sm btn-danger delete-key' + = link_to project.full_name, admin_project_path(project), class: 'gl-display-block' + %td{ data: { label: _('Created') } } + %div + = time_ago_with_tooltip(deploy_key.created_at) + %td.gl-lg-w-1px.gl-white-space-nowrap{ data: { label: _('Actions') } } + %div + = link_to edit_admin_deploy_key_path(deploy_key), class: 'btn btn-default btn-md gl-button btn-icon gl-mr-3', aria: { label: _('Edit deploy key') } do + = sprite_icon('pencil', css_class: 'gl-button-icon') + = link_to admin_deploy_key_path(deploy_key), data: { confirm: _('Are you sure?') }, method: :delete, class: 'btn btn-danger btn-md gl-button btn-icon', aria: { label: _('Remove deploy key') } do + = sprite_icon('remove', css_class: 'gl-button-icon') + - else = render 'shared/empty_states/deploy_keys' diff --git a/app/views/explore/groups/_nav.html.haml b/app/views/explore/groups/_nav.html.haml index c337149a2f3..3c9c4e9f76b 100644 --- a/app/views/explore/groups/_nav.html.haml +++ b/app/views/explore/groups/_nav.html.haml @@ -1,8 +1,6 @@ .top-area - %ul.nav-links.nav.nav-tabs - = nav_link(page: explore_groups_path) do - = link_to explore_groups_path do - = _("Explore Groups") + = gl_tabs_nav({ class: 'gl-display-flex gl-flex-grow-1 gl-border-none'}) do + = gl_tab_link_to _("Explore Groups"), explore_groups_path .nav-controls = render 'shared/groups/search_form' = render 'shared/groups/dropdown' diff --git a/app/views/explore/projects/_nav.html.haml b/app/views/explore/projects/_nav.html.haml index 65b7d055843..9d7a6f1ccfb 100644 --- a/app/views/explore/projects/_nav.html.haml +++ b/app/views/explore/projects/_nav.html.haml @@ -1,14 +1,8 @@ .top-area - %ul.nav-links.nav.nav-tabs - = nav_link(page: [explore_projects_path, explore_root_path]) do - = link_to explore_projects_path do - = _('All') - = nav_link(page: starred_explore_projects_path) do - = link_to starred_explore_projects_path do - = _('Most stars') - = nav_link(page: trending_explore_projects_path) do - = link_to trending_explore_projects_path do - = _('Trending') + = gl_tabs_nav({ class: 'gl-display-flex gl-flex-grow-1 gl-border-none'}) do + = gl_tab_link_to _('All'), explore_projects_path, { item_active: current_page?(explore_projects_path) || current_page?(explore_root_path) } + = gl_tab_link_to _('Most stars'), starred_explore_projects_path + = gl_tab_link_to _('Trending'), trending_explore_projects_path .nav-controls - unless current_user diff --git a/app/views/projects/blob/edit.html.haml b/app/views/projects/blob/edit.html.haml index ecbef9a11a7..8378ce2c7e5 100644 --- a/app/views/projects/blob/edit.html.haml +++ b/app/views/projects/blob/edit.html.haml @@ -16,14 +16,10 @@ %h3.page-title.blob-edit-page-title Edit file .file-editor - %ul.nav-links.no-bottom.js-edit-mode.nav.nav-tabs - %li.active - = link_to '#editor' do - Write + = gl_tabs_nav({ class: 'js-edit-mode nav-links gl-border-0'}) do + = gl_tab_link_to _('Write'), '#editor', { tab_class: 'active' } - %li - = link_to '#preview', 'data-preview-url' => project_preview_blob_path(@project, @id) do - = editing_preview_title(@blob.name) + = gl_tab_link_to editing_preview_title(@blob.name), '#preview', { data: { 'preview-url': project_preview_blob_path(@project, @id) } } = form_tag(project_update_blob_path(@project, @id), method: :put, class: 'js-quick-submit js-requires-input js-edit-blob-form', data: blob_editor_paths(@project)) do = render 'projects/blob/editor', ref: @ref, path: @path, blob_data: @blob.data diff --git a/app/views/projects/merge_requests/_widget.html.haml b/app/views/projects/merge_requests/_widget.html.haml index 459742c3b81..0c8af873095 100644 --- a/app/views/projects/merge_requests/_widget.html.haml +++ b/app/views/projects/merge_requests/_widget.html.haml @@ -14,8 +14,8 @@ window.gl.mrWidgetData.pipeline_must_succeed_docs_path = '#{help_page_path('user/project/merge_requests/merge_when_pipeline_succeeds.md', anchor: 'only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds')}'; window.gl.mrWidgetData.security_approvals_help_page_path = '#{help_page_path('user/application_security/index.md', anchor: 'security-approvals-in-merge-requests')}'; window.gl.mrWidgetData.license_compliance_docs_path = '#{help_page_path('user/compliance/license_compliance/index.md', anchor: 'policies')}'; - window.gl.mrWidgetData.eligible_approvers_docs_path = '#{help_page_path('user/project/merge_requests/merge_request_approvals', anchor: 'eligible-approvers')}'; - window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/merge_request_approvals")}'; + window.gl.mrWidgetData.eligible_approvers_docs_path = '#{help_page_path('user/project/merge_requests/approvals/rules.md', anchor: 'eligible-approvers')}'; + window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/approvals/index.md")}'; window.gl.mrWidgetData.pipelines_empty_svg_path = '#{image_path('illustrations/pipelines_empty.svg')}'; window.gl.mrWidgetData.codequality_help_path = '#{help_page_path("user/project/merge_requests/code_quality", anchor: "code-quality-reports")}'; window.gl.mrWidgetData.false_positive_doc_url = '#{help_page_path('user/application_security/vulnerabilities/index')}'; diff --git a/app/views/search/_category.html.haml b/app/views/search/_category.html.haml index ca6f2369bd8..54aa9aad8a5 100644 --- a/app/views/search/_category.html.haml +++ b/app/views/search/_category.html.haml @@ -5,7 +5,7 @@ .scrolling-tabs-container.inner-page-scroll-tabs.is-smaller .fade-left= sprite_icon('chevron-lg-left', size: 12) .fade-right= sprite_icon('chevron-lg-right', size: 12) - %ul.nav-links.search-filter.scrolling-tabs.nav.nav-tabs + = gl_tabs_nav({ class: 'search-filter scrolling-tabs nav-links'}) do - if @project - if project_search_tabs?(:blobs) = search_filter_link 'blobs', _("Code"), data: { qa_selector: 'code_tab' } diff --git a/app/views/shared/_md_preview.html.haml b/app/views/shared/_md_preview.html.haml index 0976defea1b..a49a0667d84 100644 --- a/app/views/shared/_md_preview.html.haml +++ b/app/views/shared/_md_preview.html.haml @@ -9,7 +9,7 @@ .md-area.position-relative .md-header - %ul.nav.nav-tabs.nav-links.clearfix + = gl_tabs_nav({ class: 'clearfix nav-links'}) do %li.md-header-tab.active %button.js-md-write-button = _("Write") |