diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /app/views/layouts | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_one_trust.html.haml | 16 | ||||
-rw-r--r-- | app/views/layouts/_page.html.haml | 1 | ||||
-rw-r--r-- | app/views/layouts/_startup_js.html.haml | 22 | ||||
-rw-r--r-- | app/views/layouts/header/_default.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/nav/_breadcrumbs.html.haml | 3 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_admin.html.haml | 13 | ||||
-rw-r--r-- | app/views/layouts/nav/sidebar/_profile.html.haml | 2 |
7 files changed, 44 insertions, 16 deletions
diff --git a/app/views/layouts/_one_trust.html.haml b/app/views/layouts/_one_trust.html.haml new file mode 100644 index 00000000000..4fab017d273 --- /dev/null +++ b/app/views/layouts/_one_trust.html.haml @@ -0,0 +1,16 @@ +- if one_trust_enabled? + - one_trust_id = sanitize(extra_config.one_trust_id, scrubber: Rails::Html::TextOnlyScrubber.new) + + <!-- OneTrust --> + = javascript_include_tag "https://cdn.cookielaw.org/consent/#{one_trust_id}/OtAutoBlock.js" + = javascript_tag nonce: content_security_policy_nonce do + :plain + const oneTrustScript = document.createElement('script'); + oneTrustScript.src = 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js'; + oneTrustScript.dataset.domainScript = '#{one_trust_id}'; + oneTrustScript.nonce = '#{content_security_policy_nonce}' + oneTrustScript.charset = 'UTF-8'; + oneTrustScript.defer = true; + document.head.appendChild(oneTrustScript); + + function OptanonWrapper() { } diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index ec2904245d3..dff1b5e3d04 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -17,6 +17,7 @@ = render_two_factor_auth_recovery_settings_check = render_if_exists "layouts/header/ee_subscribable_banner" = render_if_exists "shared/namespace_storage_limit_alert" + = render_if_exists "shared/namespace_user_cap_reached_alert" = render_if_exists "shared/new_user_signups_cap_reached_alert" = yield :page_level_alert = yield :customize_homepage_banner diff --git a/app/views/layouts/_startup_js.html.haml b/app/views/layouts/_startup_js.html.haml index 35cd191c600..0bf9c16b0d2 100644 --- a/app/views/layouts/_startup_js.html.haml +++ b/app/views/layouts/_startup_js.html.haml @@ -8,20 +8,30 @@ if (gl.startup_calls && window.fetch) { Object.keys(gl.startup_calls).forEach(apiCall => { - // fetch won’t send cookies in older browsers, unless you set the credentials init option. - // We set to `same-origin` which is default value in modern browsers. - // See https://github.com/whatwg/fetch/pull/585 for more information. - gl.startup_calls[apiCall] = { - fetchCall: fetch(apiCall, { credentials: 'same-origin' }) + gl.startup_calls[apiCall] = { + fetchCall: fetch(apiCall, { + // Emulate XHR for Rails AJAX request checks + headers: { + 'X-Requested-With': 'XMLHttpRequest' + }, + // fetch won’t send cookies in older browsers, unless you set the credentials init option. + // We set to `same-origin` which is default value in modern browsers. + // See https://github.com/whatwg/fetch/pull/585 for more information. + credentials: 'same-origin' + }) }; }); } if (gl.startup_graphql_calls && window.fetch) { + const headers = #{page_startup_graphql_headers.to_json}; const url = `#{api_graphql_url}` const opts = { method: "POST", - headers: { "Content-Type": "application/json", 'X-CSRF-Token': "#{form_authenticity_token}" }, + headers: { + "Content-Type": "application/json", + ...headers, + } }; gl.startup_graphql_calls = gl.startup_graphql_calls.map(call => ({ diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 3e7155b2c0e..8d28823bfa4 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -34,7 +34,8 @@ #js-header-search.header-search{ data: { 'search-context' => search_context.to_json, 'search-path' => search_path, 'issues-path' => issues_dashboard_path, - 'mr-path' => merge_requests_dashboard_path } } + 'mr-path' => merge_requests_dashboard_path, + 'autocomplete-path' => search_autocomplete_path } } %input{ type: "text", placeholder: _('Search or jump to...'), class: 'form-control gl-form-input' } - else = render 'layouts/search' diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml index c111714f552..02a37dac158 100644 --- a/app/views/layouts/nav/_breadcrumbs.html.haml +++ b/app/views/layouts/nav/_breadcrumbs.html.haml @@ -19,8 +19,9 @@ = render "layouts/nav/breadcrumbs/collapsed_dropdown", location: :after - unless @skip_current_level_breadcrumb %li - %h2.breadcrumbs-sub-title + %h2.breadcrumbs-sub-title{ data: { qa_selector: 'breadcrumb_sub_title_content' } } = link_to @breadcrumb_title, breadcrumb_title_link + -# haml-lint:disable InlineJavaScript %script{ type: 'application/ld+json' } :plain #{schema_breadcrumb_json} diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index d0b73a3364a..842fb23d24a 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -1,13 +1,13 @@ %aside.nav-sidebar.qa-admin-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), 'aria-label': _('Admin navigation') } .nav-sidebar-inner-scroll .context-header - = link_to admin_root_path, title: _('Admin Overview') do + = link_to admin_root_path, title: _('Admin Overview'), class: 'has-tooltip', data: { container: 'body', placement: 'right' } do %span{ class: ['avatar-container', 'settings-avatar', 'rect-avatar', 's32'] } = sprite_icon('admin', size: 18) %span.sidebar-context-title = _('Admin Area') %ul.sidebar-top-level-items{ data: { qa_selector: 'admin_sidebar_overview_submenu_content' } } - = nav_link(controller: %w(dashboard admin admin/projects users groups jobs runners gitaly_servers cohorts), html_options: {class: 'home'}) do + = nav_link(controller: %w(dashboard admin admin/projects users groups admin/topics jobs runners gitaly_servers cohorts), html_options: {class: 'home'}) do = link_to admin_root_path, class: 'has-sub-items' do .nav-icon-container = sprite_icon('overview') @@ -35,6 +35,10 @@ = link_to admin_groups_path, title: _('Groups'), data: { qa_selector: 'groups_overview_link' } do %span = _('Groups') + = nav_link(controller: [:admin, 'admin/topics']) do + = link_to admin_topics_path, title: _('Topics'), data: { qa_selector: 'topics_overview_link' } do + %span + = _('Topics') = nav_link path: 'jobs#index' do = link_to admin_jobs_path, title: _('Jobs') do %span @@ -257,11 +261,6 @@ = link_to ci_cd_admin_application_settings_path, title: _('CI/CD') do %span = _('CI/CD') - - if Feature.enabled?(:serverless_domain) - = nav_link(path: 'application_settings#operations') do - = link_to admin_serverless_domains_path, title: _('Operations') do - %span - = _('Operations') = nav_link(path: 'application_settings#reporting') do = link_to reporting_admin_application_settings_path, title: _('Reporting') do %span diff --git a/app/views/layouts/nav/sidebar/_profile.html.haml b/app/views/layouts/nav/sidebar/_profile.html.haml index 4db1e532ba5..16c0c00ad3f 100644 --- a/app/views/layouts/nav/sidebar/_profile.html.haml +++ b/app/views/layouts/nav/sidebar/_profile.html.haml @@ -1,7 +1,7 @@ %aside.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?), **sidebar_tracking_attributes_by_object(current_user), 'aria-label': _('User settings') } .nav-sidebar-inner-scroll .context-header - = link_to profile_path, title: _('Profile Settings') do + = link_to profile_path, title: _('Profile Settings'), class: 'has-tooltip', data: { container: 'body', placement: 'right' } do %span{ class: ['avatar-container', 'settings-avatar', 's32'] } = image_tag avatar_icon_for_user(current_user, 32), class: ['avatar', 'avatar-tile', 'js-sidebar-user-avatar', 's32'], alt: current_user.name, data: { testid: 'sidebar-user-avatar' } %span.sidebar-context-title= _('User Settings') |