diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /app/views/layouts | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_head.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/_loading_hints.html.haml | 6 | ||||
-rw-r--r-- | app/views/layouts/_published_experiments.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/_snowplow.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/application.html.haml | 1 | ||||
-rw-r--r-- | app/views/layouts/header/_default.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/header/_help_dropdown.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/header/_logo_with_title.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/nav/_breadcrumbs.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/nav/_top_nav_responsive.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/nav/breadcrumbs/_collapsed_dropdown.html.haml | 11 | ||||
-rw-r--r-- | app/views/layouts/nav/breadcrumbs/_collapsed_inline_list.html.haml | 11 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_admin.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/terms.html.haml | 9 |
14 files changed, 38 insertions, 28 deletions
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index a89c621a55c..5ca4a2f9888 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -92,3 +92,5 @@ = render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id') = render 'layouts/matomo' if extra_config.has_key?('matomo_url') && extra_config.has_key?('matomo_site_id') = render 'layouts/snowplow' + -# This is needed by [GitLab JH](https://gitlab.com/gitlab-jh/gitlab/-/issues/184) + = render_if_exists "layouts/frontend_monitor" diff --git a/app/views/layouts/_loading_hints.html.haml b/app/views/layouts/_loading_hints.html.haml index e2189009045..9b2815ea9bc 100644 --- a/app/views/layouts/_loading_hints.html.haml +++ b/app/views/layouts/_loading_hints.html.haml @@ -1,4 +1,4 @@ -= cache_if(Feature.enabled?(:cached_loading_hints, current_user), [ActionController::Base.asset_host, user_application_theme, user_color_scheme], expires_in: 1.minute) do += cache([ActionController::Base.asset_host, user_application_theme, user_color_scheme], expires_in: 1.minute) do - css_crossorigin = ActionController::Base.asset_host ? 'anonymous' : nil - if ActionController::Base.asset_host @@ -11,5 +11,5 @@ = preload_link_tag(path_to_stylesheet('application_utilities'), crossorigin: css_crossorigin) = preload_link_tag(path_to_stylesheet('application'), crossorigin: css_crossorigin) = preload_link_tag(path_to_stylesheet("highlight/themes/#{user_color_scheme}"), crossorigin: css_crossorigin) - - if Gitlab::Tracking.enabled? && Gitlab::CurrentSettings.snowplow_collector_hostname - %link{ rel: 'preconnect', href: Gitlab::CurrentSettings.snowplow_collector_hostname, crossorigin: '' } + - if Gitlab::Tracking.enabled? && Gitlab::Tracking.collector_hostname + %link{ rel: 'preconnect', href: Gitlab::Tracking.collector_hostname, crossorigin: '' } diff --git a/app/views/layouts/_published_experiments.html.haml b/app/views/layouts/_published_experiments.html.haml new file mode 100644 index 00000000000..717e1e633d2 --- /dev/null +++ b/app/views/layouts/_published_experiments.html.haml @@ -0,0 +1,4 @@ += javascript_tag(nonce: content_security_policy_nonce) do + :plain + gl = window.gl || {}; + gl.experiments = #{raw ApplicationExperiment.published_experiments.reject { |name, data| data[:excluded] }.to_json}; diff --git a/app/views/layouts/_snowplow.html.haml b/app/views/layouts/_snowplow.html.haml index fc3b12acc46..7e242fb4a8e 100644 --- a/app/views/layouts/_snowplow.html.haml +++ b/app/views/layouts/_snowplow.html.haml @@ -10,5 +10,6 @@ window.snowplowOptions = #{Gitlab::Tracking.options(@group).to_json} gl = window.gl || {}; - gl.snowplowStandardContext = #{Gitlab::Tracking::StandardContext.new.to_context.to_json.to_json} + gl.snowplowStandardContext = #{Gitlab::Tracking::StandardContext.new(namespace: @group || @project&.namespace, + project: @project, user: current_user).to_context.to_json.to_json} gl.snowplowPseudonymizedPageUrl = #{masked_page_url.to_json}; diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 899bf65de48..26e3d9b3b92 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -16,4 +16,5 @@ = render 'layouts/img_loader' + = render 'layouts/published_experiments' = yield :scripts_body diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 8d28823bfa4..83e8ff79aec 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -120,7 +120,7 @@ - sign_in_text = allow_signup? ? _('Sign in / Register') : _('Sign in') = link_to sign_in_text, new_session_path(:user, redirect_to_referer: 'yes'), class: 'gl-button btn btn-default btn-sign-in' - %button.navbar-toggler.d-block.d-sm-none{ type: 'button', class: 'gl-border-none!', data: { testid: 'top-nav-responsive-toggle' } } + %button.navbar-toggler.d-block.d-sm-none{ type: 'button', class: 'gl-border-none!', data: { testid: 'top-nav-responsive-toggle', qa_selector: 'mobile_navbar_button' } } %span.sr-only= _('Toggle navigation') %span.more-icon.gl-px-3.gl-font-sm.gl-font-weight-bold %span.gl-pr-2= _('Menu') diff --git a/app/views/layouts/header/_help_dropdown.html.haml b/app/views/layouts/header/_help_dropdown.html.haml index 01e59b8e2ef..a03cd4cd68f 100644 --- a/app/views/layouts/header/_help_dropdown.html.haml +++ b/app/views/layouts/header/_help_dropdown.html.haml @@ -10,7 +10,7 @@ %li %button.js-shortcuts-modal-trigger{ type: "button" } = _("Keyboard shortcuts") - %span.text-secondary.float-right{ "aria-hidden": "true" }= '?'.html_safe + %kbd.flat.float-right{ "aria-hidden": "true" }= '?'.html_safe %li.divider %li = link_to _("Submit feedback"), "https://about.gitlab.com/submit-feedback" diff --git a/app/views/layouts/header/_logo_with_title.html.haml b/app/views/layouts/header/_logo_with_title.html.haml index 9b5a47306d2..0b9d4e2eea4 100644 --- a/app/views/layouts/header/_logo_with_title.html.haml +++ b/app/views/layouts/header/_logo_with_title.html.haml @@ -1,4 +1,4 @@ %header.navbar.fixed-top.navbar-gitlab.justify-content-center - = render 'shared/logo.svg' + = render partial: 'shared/logo', formats: :svg %span.logo-text.d-none.d-lg-block.gl-ml-3.pt-1 - = render 'shared/logo_type.svg' + = render partial: 'shared/logo_type', formats: :svg diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml index 02a37dac158..3c52c430868 100644 --- a/app/views/layouts/nav/_breadcrumbs.html.haml +++ b/app/views/layouts/nav/_breadcrumbs.html.haml @@ -6,7 +6,7 @@ %nav.breadcrumbs{ class: [container, @content_class], 'aria-label': _('Breadcrumbs') } .breadcrumbs-container{ class: ("border-bottom-0" if @no_breadcrumb_border) } - if defined?(@left_sidebar) - = button_tag class: 'toggle-mobile-nav', type: 'button' do + = button_tag class: 'toggle-mobile-nav', data: { qa_selector: 'toggle_mobile_nav_button' }, type: 'button' do %span.sr-only= _("Open sidebar") = sprite_icon('hamburger', size: 18) .breadcrumbs-links{ data: { testid: 'breadcrumb-links', qa_selector: 'breadcrumb_links_content' } } @@ -16,7 +16,7 @@ - if @breadcrumbs_extra_links - @breadcrumbs_extra_links.each do |extra| = breadcrumb_list_item link_to(extra[:text], extra[:link]) - = render "layouts/nav/breadcrumbs/collapsed_dropdown", location: :after + = render "layouts/nav/breadcrumbs/collapsed_inline_list", location: :after - unless @skip_current_level_breadcrumb %li %h2.breadcrumbs-sub-title{ data: { qa_selector: 'breadcrumb_sub_title_content' } } diff --git a/app/views/layouts/nav/_top_nav_responsive.html.haml b/app/views/layouts/nav/_top_nav_responsive.html.haml index 86fd8b6d80c..22a260b5c0c 100644 --- a/app/views/layouts/nav/_top_nav_responsive.html.haml +++ b/app/views/layouts/nav/_top_nav_responsive.html.haml @@ -2,4 +2,5 @@ - view_model = top_nav_responsive_view_model(project: @project, group: @group) .top-nav-responsive{ class: top_class } - #js-top-nav-responsive{ data: { view_model: view_model.to_json } } + .cloak-startup + #js-top-nav-responsive{ data: { view_model: view_model.to_json } } diff --git a/app/views/layouts/nav/breadcrumbs/_collapsed_dropdown.html.haml b/app/views/layouts/nav/breadcrumbs/_collapsed_dropdown.html.haml deleted file mode 100644 index 8ea75087fed..00000000000 --- a/app/views/layouts/nav/breadcrumbs/_collapsed_dropdown.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -- dropdown_location = local_assigns.fetch(:location, nil) -- button_tooltip = local_assigns.fetch(:title, _("Show parent pages")) -- if defined?(@breadcrumb_dropdown_links) && @breadcrumb_dropdown_links.key?(dropdown_location) - %li.dropdown - %button.text-expander.has-tooltip.js-breadcrumbs-collapsed-expander{ type: "button", data: { toggle: "dropdown", container: "body" }, "aria-label": button_tooltip, title: button_tooltip } - = sprite_icon("ellipsis_h", size: 12) - = sprite_icon("angle-right", size: 8, css_class: "breadcrumbs-list-angle") - .dropdown-menu - %ul - - @breadcrumb_dropdown_links[dropdown_location].each_with_index do |link, index| - %li{ style: "text-indent: #{[index * 16, 60].min}px;" }= link diff --git a/app/views/layouts/nav/breadcrumbs/_collapsed_inline_list.html.haml b/app/views/layouts/nav/breadcrumbs/_collapsed_inline_list.html.haml new file mode 100644 index 00000000000..ccb660c050e --- /dev/null +++ b/app/views/layouts/nav/breadcrumbs/_collapsed_inline_list.html.haml @@ -0,0 +1,11 @@ +- dropdown_location = local_assigns.fetch(:location, nil) +- button_tooltip = local_assigns.fetch(:title, _("Show all breadcrumbs")) +- if defined?(@breadcrumb_collapsed_links) && @breadcrumb_collapsed_links.key?(dropdown_location) + %li.expander + %button.text-expander.has-tooltip.js-breadcrumbs-collapsed-expander{ type: "button", data: { container: "body" }, "aria-label": button_tooltip, title: button_tooltip } + = sprite_icon("ellipsis_h", size: 12) + = sprite_icon("angle-right", size: 8, css_class: "breadcrumbs-list-angle") + - @breadcrumb_collapsed_links[dropdown_location].each_with_index do |link, index| + %li{ :class => "gl-display-none! breadcrumbs-detail-item" } + = link + = sprite_icon("angle-right", size: 8, css_class: "breadcrumbs-list-angle") diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index 842fb23d24a..f820f911d61 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -66,9 +66,9 @@ = _('Analytics') %li.divider.fly-out-top-item = nav_link(controller: :dev_ops_report) do - = link_to admin_dev_ops_report_path, title: _('DevOps Report') do + = link_to admin_dev_ops_report_path, title: _('DevOps Reports') do %span - = _('DevOps Report') + = _('DevOps Reports') = nav_link(controller: :usage_trends) do = link_to admin_usage_trends_path, title: _('Usage Trends') do %span diff --git a/app/views/layouts/terms.html.haml b/app/views/layouts/terms.html.haml index 4d5c354388f..caa46b7bc56 100644 --- a/app/views/layouts/terms.html.haml +++ b/app/views/layouts/terms.html.haml @@ -1,21 +1,22 @@ !!! 5 +- add_page_specific_style 'page_bundles/terms' - @hide_breadcrumbs = true %html{ lang: I18n.locale, class: page_class } = render "layouts/head" %body{ data: { page: body_data_page } } .layout-page.terms{ class: page_class } - .content-wrapper + .content-wrapper.gl-pb-5 .mobile-overlay .alert-wrapper = render "layouts/broadcast" = render 'layouts/header/read_only_banner' - = render "layouts/flash", extra_flash_class: 'limit-container-width' + = render "layouts/flash" %div{ class: "#{container_class} limit-container-width" } .content{ id: "content-body" } - .card - .card-header + .gl-card + .gl-card-header = brand_header_logo - logo_text = brand_header_logo_type - if logo_text.present? |