From 278227274aff9c7aabe68d83137c25676c19ad53 Mon Sep 17 00:00:00 2001 From: Behrokh Satarnejad Date: Wed, 7 Feb 2024 15:58:17 +0100 Subject: [PATCH 1/2] change icons and remove tooltip got opening gantt --- .../index_page_header_component.html.erb | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/app/components/projects/index_page_header_component.html.erb b/app/components/projects/index_page_header_component.html.erb index d0a68460ecbc..5f5a89f0da1e 100644 --- a/app/components/projects/index_page_header_component.html.erb +++ b/app/components/projects/index_page_header_component.html.erb @@ -6,6 +6,26 @@ <%= render(Primer::Alpha::ActionMenu.new) do |menu| menu.with_show_button(icon: 'op-kebab-vertical', 'aria-label': t(:label_more), data: { 'test-selector': 'project-more-dropdown-menu' }) + if gantt_portfolio_project_ids.any? + menu.with_item( + tag: :a, + label: t('projects.index.open_as_gantt'), + href: gantt_portfolio_query_link, + id: 'projects-index-open-as-gantt', + content_arguments: { target: '_blank' } + ) do |item| + item.with_leading_visual_icon(icon: 'op-view-timeline') + end + end + + menu.with_item( + tag: :a, + label: t(:label_overall_activity), + href: activities_path + )do |item| + item.with_leading_visual_icon(icon: 'tasklist') + end + if current_user.logged? && query_saveable? menu.with_item( label: t('button_save'), @@ -26,27 +46,7 @@ label: t('js.label_export'), content_arguments: { 'data-show-dialog-id': EXPORT_MODAL_ID } ) do |item| - item.with_leading_visual_icon(icon: 'op-file-download') - end - - menu.with_item( - tag: :a, - label: t(:label_overall_activity), - href: activities_path - ) - - if gantt_portfolio_project_ids.any? - menu.with_item( - tag: :a, - label: t('projects.index.open_as_gantt'), - href: gantt_portfolio_query_link, - id: 'projects-index-open-as-gantt', - content_arguments: { target: '_blank' } - ) do |item| - item.with_leading_visual_icon(icon: 'op-view-timeline') - item.with_trailing_visual_icon(icon: 'link-external') - item.with_tooltip(text: gantt_portfolio_title) - end + item.with_leading_visual_icon(icon: 'sign-out') end if query.persisted? From e692d80cae01670a1e90e7a26a1447df3aaf91a0 Mon Sep 17 00:00:00 2001 From: Behrokh Satarnejad Date: Wed, 7 Feb 2024 16:12:50 +0100 Subject: [PATCH 2/2] remove unused method and its related trasnlation string keys --- .../projects/index_page_header_component.rb | 11 ----------- config/locales/en.yml | 2 -- 2 files changed, 13 deletions(-) diff --git a/app/components/projects/index_page_header_component.rb b/app/components/projects/index_page_header_component.rb index 126b80b2e403..e6c1c4bcbeb9 100644 --- a/app/components/projects/index_page_header_component.rb +++ b/app/components/projects/index_page_header_component.rb @@ -75,17 +75,6 @@ def query_saveable? query.name.blank? end - def gantt_portfolio_title - title = t('projects.index.open_as_gantt_title') - - if current_user.admin? - title << ' ' - title << t('projects.index.open_as_gantt_title_admin') - end - - title - end - def show_state? state == :show end diff --git a/config/locales/en.yml b/config/locales/en.yml index 8e8f58bbc011..99795caa584f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -282,8 +282,6 @@ en: completed_text_children: "Additionally, the following subprojects have been deleted:" index: open_as_gantt: "Open as Gantt view" - open_as_gantt_title: "Use this button to generate a Gantt view that filters work packages for the projects visible on this page." - open_as_gantt_title_admin: "You can modify the view settings (such as selected work package types) in the administration under project settings." no_results_title_text: There are currently no projects no_results_content_text: Create a new project lists: