From e8d2c2579383897a1dd7f9debd359abe8ae8373d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 20 Jul 2021 09:55:51 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-1-stable-ee --- app/views/shared/nav/_scope_menu.html.haml | 12 ++++++------ app/views/shared/nav/_scope_menu_body.html.haml | 8 -------- app/views/shared/nav/_sidebar.html.haml | 13 ++++++------- app/views/shared/nav/_sidebar_menu.html.haml | 12 ++++++------ app/views/shared/nav/_sidebar_menu_collapsed.html.haml | 5 ----- 5 files changed, 18 insertions(+), 32 deletions(-) delete mode 100644 app/views/shared/nav/_scope_menu_body.html.haml delete mode 100644 app/views/shared/nav/_sidebar_menu_collapsed.html.haml (limited to 'app/views/shared/nav') diff --git a/app/views/shared/nav/_scope_menu.html.haml b/app/views/shared/nav/_scope_menu.html.haml index cbee0e0429c..1a7089fb570 100644 --- a/app/views/shared/nav/_scope_menu.html.haml +++ b/app/views/shared/nav/_scope_menu.html.haml @@ -1,6 +1,6 @@ -- if sidebar_refactor_enabled? - = nav_link(**scope_menu.active_routes, html_options: scope_menu.nav_link_html_options) do - = render 'shared/nav/scope_menu_body', scope_menu: scope_menu -- else - .context-header - = render 'shared/nav/scope_menu_body', scope_menu: scope_menu += nav_link(**scope_menu.active_routes, html_options: scope_menu.nav_link_html_options) do + = link_to scope_menu.link, **scope_menu.container_html_options, data: { qa_selector: 'sidebar_menu_link', qa_menu_item: scope_qa_menu_item(scope_menu.container) } do + %span{ class: scope_avatar_classes(scope_menu.container) } + = source_icon(scope_menu.container, alt: scope_menu.title, class: ['avatar', 'avatar-tile', 's32'], width: 32, height: 32) + %span.sidebar-context-title + = scope_menu.title diff --git a/app/views/shared/nav/_scope_menu_body.html.haml b/app/views/shared/nav/_scope_menu_body.html.haml deleted file mode 100644 index a94c681e2d3..00000000000 --- a/app/views/shared/nav/_scope_menu_body.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -- avatar_size = sidebar_refactor_disabled? ? 40 : 32 -- avatar_size_class = sidebar_refactor_disabled? ? 's40' : 's32' - -= link_to scope_menu.link, **scope_menu.container_html_options, data: { qa_selector: 'project_scope_link' } do - %span{ class: ['avatar-container', 'rect-avatar', 'project-avatar', avatar_size_class] } - = source_icon(scope_menu.container, alt: scope_menu.title, class: ['avatar', 'avatar-tile', avatar_size_class], width: avatar_size, height: avatar_size) - %span.sidebar-context-title - = scope_menu.title diff --git a/app/views/shared/nav/_sidebar.html.haml b/app/views/shared/nav/_sidebar.html.haml index 54c3b8a281d..915352996d9 100644 --- a/app/views/shared/nav/_sidebar.html.haml +++ b/app/views/shared/nav/_sidebar.html.haml @@ -1,15 +1,14 @@ %aside.nav-sidebar{ class: ('sidebar-collapsed-desktop' if collapsed_sidebar?), **sidebar_tracking_attributes_by_object(sidebar.container), 'aria-label': sidebar.aria_label } .nav-sidebar-inner-scroll - - if sidebar.scope_menu && sidebar_refactor_disabled? - = render partial: 'shared/nav/scope_menu', object: sidebar.scope_menu - - elsif sidebar.render_raw_scope_menu_partial - = render sidebar.render_raw_scope_menu_partial - - %ul.sidebar-top-level-items.qa-project-sidebar - - if sidebar.scope_menu && sidebar_refactor_enabled? + %ul.sidebar-top-level-items{ data: { qa_selector: sidebar_qa_selector(sidebar.container) } } + - if sidebar.render_raw_scope_menu_partial + = render sidebar.render_raw_scope_menu_partial + - elsif sidebar.scope_menu = render partial: 'shared/nav/scope_menu', object: sidebar.scope_menu + - if sidebar.renderable_menus.any? = render partial: 'shared/nav/sidebar_menu', collection: sidebar.renderable_menus + - if sidebar.render_raw_menus_partial = render sidebar.render_raw_menus_partial diff --git a/app/views/shared/nav/_sidebar_menu.html.haml b/app/views/shared/nav/_sidebar_menu.html.haml index b80bd515a32..9a04139d2f2 100644 --- a/app/views/shared/nav/_sidebar_menu.html.haml +++ b/app/views/shared/nav/_sidebar_menu.html.haml @@ -15,12 +15,12 @@ %ul.sidebar-sub-level-items{ class: ('is-fly-out-only' unless sidebar_menu.has_renderable_items?) } = nav_link(**sidebar_menu.all_active_routes, html_options: { class: 'fly-out-top-item' } ) do - - if sidebar_refactor_disabled? - = link_to sidebar_menu.link, class: "'has-sub-items' if sidebar_menu.has_renderable_items?", **sidebar_menu.collapsed_container_html_options do - = render 'shared/nav/sidebar_menu_collapsed', sidebar_menu: sidebar_menu - - else - %span.fly-out-top-item-container - = render 'shared/nav/sidebar_menu_collapsed', sidebar_menu: sidebar_menu + %span.fly-out-top-item-container + %strong.fly-out-top-item-name + = sidebar_menu.title + - if sidebar_menu.has_pill? + %span.badge.badge-pill.count.fly-out-badge{ **sidebar_menu.pill_html_options } + = number_with_delimiter(sidebar_menu.pill_count) - if sidebar_menu.has_renderable_items? %li.divider.fly-out-top-item diff --git a/app/views/shared/nav/_sidebar_menu_collapsed.html.haml b/app/views/shared/nav/_sidebar_menu_collapsed.html.haml deleted file mode 100644 index 78567a991df..00000000000 --- a/app/views/shared/nav/_sidebar_menu_collapsed.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%strong.fly-out-top-item-name - = sidebar_menu.title -- if sidebar_menu.has_pill? - %span.badge.badge-pill.count.fly-out-badge{ **sidebar_menu.pill_html_options } - = number_with_delimiter(sidebar_menu.pill_count) -- cgit v1.2.3