Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Merge remote-tracking branch 'origin/dev' into feature/56583-redesign-the-top-bar-app-header-using-primer

Henriette Dargee97c6a94b54c
diff --cc config/initializers/menus.rb
index 89b8c5b1de4,87eba4c6de0..6378b81e18e
--- a/config/initializers/menus.rb
+++ b/config/initializers/menus.rb
@@@ -67,10 -67,27 +67,26 @@@ Redmine::MenuManager.map :top_menu do |
menu.push :help,
OpenProject::Static::Links.help_link,
last: true,
- caption: "",
+ caption: I18n.t("label_help"),
icon: "question",
html: { accesskey: OpenProject::AccessKeys.key_for(:help),
- title: I18n.t("label_help"),
target: "_blank" }
+
+ menu.push :home,
+ { controller: "/homescreen", action: "index" },
+ context: :my,
+ icon: "home",
+ first: true
+
+ menu.push :my_page,
+ { controller: "/my/page", action: "show" },
+ context: :my,
+ after: :home,
+ icon: "person",
+ caption: I18n.t("my_page.label"),
+ if: ->(*) do
+ User.current.logged?
+ end
end
Redmine::MenuManager.map :quick_add_menu do |menu|
diff --cc frontend/src/global_styles/common/header/app-menu.sass
index 7a8207d0841,738a0d15048..6456bdae40f
--- a/frontend/src/global_styles/common/header/app-menu.sass
+++ b/frontend/src/global_styles/common/header/app-menu.sass
@@@ -1,10 -1,92 +1,13 @@@
.op-app-menu
- list-style: none
display: flex
margin: 0
- height: 100%
- min-width: 0px
&--item
- display: flex
- position: relative
- height: 100%
- min-width: 0px
-
- &--items
- margin-left: 0
-
- &--item-dropdown-indicator
- display: inline-flex
- justify-content: center
- align-items: center
-
- &--item-title
- min-width: 0
- white-space: nowrap
-
- &--item-action
- background: transparent
- border-right: 1px solid transparent
- border-left: 1px solid transparent
- border-top: 0
- border-bottom: var(--header-border-bottom-width) solid transparent
- border-radius: 0
- display: flex
- justify-content: center
- align-items: center
- height: var(--header-height)
- zoom: 1
color: var(--header-item-font-color)
- font-size: var(--header-item-font-size)
- text-decoration: none
- min-width: 0px
- padding: 0 var(--main-menu-x-spacing)
-
- @media screen and (max-width: $breakpoint-sm)
- padding: 0 8px
+ display: flex
- .op-app-menu--item_dropdown-open &,
&:hover
text-decoration: none
- background: var(--header-item-bg-hover-color)
- color: var(--header-item-font-hover-color)
- border-bottom: var(--header-border-bottom-width) solid var(--header-border-bottom-color) !important
- border-left-color: var(--main-menu-hover-border-color)
- border-right-color: var(--main-menu-hover-border-color)
-
- &:focus
- color: var(--header-item-font-hover-color)
-
- &--dropdown
- position: absolute
- top: 100%
- left: auto
- right: 0
- border-radius: 0
- box-shadow: var(--shadow-floating-small)
- overflow: visible
- padding: 3px 0
- margin: 0
-
- min-width: 270px
- padding: 6px 0
- border-top: 0
- background-color: var(--body-background)
- max-height: calc(100vh - var(--header-height))
- overflow-y: auto
- overflow-x: hidden
- scrollbar-color: transparent transparent
- scrollbar-width: thin
+
- &_open
- display: flex
-
- @at-root .op-app-menu_drop-left &
- left: 0
- right: auto
-
- @media screen and (max-width: $breakpoint-sm)
- position: fixed
- top: var(--header-height)
- left: 0
- right: 0
- width: 100vw
++ &--items
++ margin-left: 0
diff --cc lib/redmine/menu_manager/top_menu_helper.rb
index e414a72a490,74792857e74..1898aa8670a
--- a/lib/redmine/menu_manager/top_menu_helper.rb
+++ b/lib/redmine/menu_manager/top_menu_helper.rb
@@@ -108,20 -152,52 +113,26 @@@ module Redmine::MenuManager::TopMenuHel
end
end
- def render_user_drop_down(items)
- avatar = avatar(User.current, class: "op-top-menu-user-avatar", hover_card: { active: false })
- render_menu_dropdown_with_items(
- label: avatar.presence || "",
- label_options: {
- title: User.current.name,
- class: "op-top-menu-user",
- icon: (avatar.present? ? "overridden-by-avatar" : "icon-user")
- },
- items:,
- options: { drop_down_id: "user-menu", menu_item_class: "last-child" }
- )
- end
-
- def render_login_partial
- partial =
- if OpenProject::Configuration.disable_password_login?
- "account/omniauth_login"
- else
- "account/login"
- end
-
- render partial:
- end
-
def render_module_top_menu_node(item_groups = module_top_menu_item_groups)
unless item_groups.empty?
- render Primer::Alpha::ActionMenu.new(classes: "op-app-menu--item",
- menu_id: "op-app-header--modules-menu",
- anchor_align: :end) do |menu|
- menu.with_show_button(icon: "op-grid-menu",
- scheme: :invisible,
- classes: "op-app-header--primer-button",
- title: I18n.t("label_modules"),
- test_selector: "op-app-header--modules-menu-button",
- "aria-label": I18n.t("label_modules"))
+ render Primer::Alpha::Dialog.new(classes: "op-app-menu--item",
+ title: I18n.t("label_modules"),
+ visually_hide_title: true,
+ size: :small,
- menu_id: "op-app-header--modules-menu",
+ position: :left) do |dialog|
+ dialog.with_show_button(icon: "op-grid-menu",
+ scheme: :invisible,
- classes: "op-app-menu--item-action op-app-header--primer-button",
++ classes: "op-app-header--primer-button",
+ title: I18n.t("label_modules"),
+ test_selector: "op-app-header--modules-menu-button",
+ "aria-controls": "op-app-header--modules-menu-list",
+ "aria-label": I18n.t("label_modules"))
+ dialog.with_header(classes: "op-app-header--modules-menu-header") do
+ render_logo_icon
+ end
item_groups.each do |item_group|
- render_menu_item_group(menu, item_group)
+ render_dialog_item_group(dialog, item_group)
end
end
end
@@@ -143,9 -234,21 +169,10 @@@
end
end
- def render_main_top_menu_nodes(items = main_top_menu_items)
- items.map do |item|
- render_menu_node(item)
- end.join(" ")
- end
-
- # Menu items for the main top menu
- def main_top_menu_items
- split_top_menu_into_main_or_more_menus[:base]
- end
-
# Menu items for the modules top menu
def more_top_menu_items
- split_top_menu_into_main_or_more_menus[:modules]
+ split = split_top_menu_into_main_or_more_menus
+ split[:modules] + split[:my]
end
def module_top_menu_item_groups