Skip to content

Commit

Permalink
Merge pull request #14736 from opf/52149-icon-and-order-change-in-mor…
Browse files Browse the repository at this point in the history
…e-menu-entries

[52149] Clean menu structure on project lists page (change order of entries, use correct icons)
  • Loading branch information
ulferts authored Feb 7, 2024
2 parents f9bc98f + e692d80 commit 8bac8e4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 34 deletions.
42 changes: 21 additions & 21 deletions app/components/projects/index_page_header_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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?
Expand Down
11 changes: 0 additions & 11 deletions app/components/projects/index_page_header_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8bac8e4

Please sign in to comment.