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

Refactor/app header (#9110)

Benjamin Bädorf2667cd15817c
diff --git a/app/views/custom_styles/_inline_css.erb b/app/views/custom_styles/_inline_css.erb
index 71df0a90e25..a7af3144b48 100644
--- a/app/views/custom_styles/_inline_css.erb
+++ b/app/views/custom_styles/_inline_css.erb
@@ -55,9 +55,7 @@ See docs/COPYRIGHT.rdoc for more details.
DesignColor.overwritten.select { |design_color| design_color.variable == 'header-bg-color' }.try(:first).try(:hexcode) == '#FFFFFF' &&
DesignColor.overwritten.select { |design_color| design_color.variable == 'header-item-bg-hover-color' }.try(:first).try(:hexcode) == '#FFFFFF' %>
<%# Disable hover background color to not overlap border %>
- #top-menu li > a:hover,
- #top-menu li.drop-down:hover,
- #top-menu li.drop-down.open,
+ .op-app-menu--item-action:hover,
.top-menu-search.-collapsed .top-menu-search--button:hover {
background: transparent;
}
diff --git a/app/views/custom_styles/_inline_css_logo.erb b/app/views/custom_styles/_inline_css_logo.erb
index 17c8633e8e1..b6d066d7c44 100644
--- a/app/views/custom_styles/_inline_css_logo.erb
+++ b/app/views/custom_styles/_inline_css_logo.erb
@@ -40,7 +40,7 @@ See docs/COPYRIGHT.rdoc for more details.
%>
<% end %>
- #logo .home-link {
+ .op-logo--link {
background-image: url(<%= logo_url %>);
}
</style>
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index afe6ff4c82f..b1ceeadc7a7 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -118,30 +118,27 @@ See docs/COPYRIGHT.rdoc for more details.
<% initial_classes = initial_menu_classes(side_displayed, show_decoration) %>
<div id="wrapper" style="<%= initial_menu_styles %>" class="<%= initial_classes %>">
<% if show_decoration %>
- <div id="top-menu">
- <div id="header">
- <div id="top-menu-items">
- <h1 class="hidden-for-sighted">
- <%= t(:label_top_menu) %>
- </h1>
- <main-menu-toggle></main-menu-toggle>
- <a href="" class="hidden-for-sighted skip-navigation-link"
- aria-label="<%= I18n.t('js.work_packages.jump_marks.label_content') %>">
- <%= I18n.t('js.work_packages.jump_marks.content') %>
- </a>
- <%= render_top_menu_left %>
- <div id="logo" class="hidden-for-mobile">
- <%= link_to(I18n.t('label_home'), fixed_home_url, class: 'home-link') %>
- </div>
- <%= call_hook :view_layouts_base_top_menu %>
- <div class="top-menu-items-right">
- <%= render_quick_add_menu %>
- <%= render partial: 'search/mini_form' %>
- <%= render_top_menu_right %>
- </div>
- </div>
+ <header class="op-app-header">
+ <div class="op-app-header--start">
+ <h1 class="hidden-for-sighted">
+ <%= t(:label_top_menu) %>
+ </h1>
+ <main-menu-toggle></main-menu-toggle>
+ <a href="" class="hidden-for-sighted skip-navigation-link"
+ aria-label="<%= I18n.t('js.work_packages.jump_marks.label_content') %>">
+ <%= I18n.t('js.work_packages.jump_marks.content') %>
+ </a>
+ <%= render_top_menu_left %>
+ </div>
+ <div class="op-app-header--center op-logo">
+ <%= link_to(I18n.t('label_home'), fixed_home_url, class: 'op-logo--link') %>
+ </div>
+ <%= call_hook :view_layouts_base_top_menu %>
+ <div class="op-app-header--end">
+ <%= render partial: 'search/mini_form' %>
+ <%= render_top_menu_right %>
</div>
- </div>
+ </header>
<% end %>
<div id="main"
class="<%= initial_classes %>">
diff --git a/app/views/layouts/only_logo.html.erb b/app/views/layouts/only_logo.html.erb
index f83fd561fde..b5790f8af5b 100644
--- a/app/views/layouts/only_logo.html.erb
+++ b/app/views/layouts/only_logo.html.erb
@@ -42,15 +42,11 @@ See docs/COPYRIGHT.rdoc for more details.
</head>
<body>
<div id="wrapper">
- <div id="top-menu">
- <div id="header">
- <div id="top-menu-items">
- <div id="logo" class="hidden-for-mobile">
- <%= link_to(I18n.t('label_home'), home_url, class: 'home-link') %>
- </div>
- </div>
+ <header class="op-app-header">
+ <div class="op-app-header--center op-logo">
+ <%= link_to(I18n.t('label_home'), home_url, class: 'op-logo--link') %>
</div>
- </div>
+ </header>
<%= yield %>
</div>
</body>
diff --git a/app/views/onboarding/_menu_item.html.erb b/app/views/onboarding/_menu_item.html.erb
index 51d0a1fd560..ac1d2691ea8 100644
--- a/app/views/onboarding/_menu_item.html.erb
+++ b/app/views/onboarding/_menu_item.html.erb
@@ -26,14 +26,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See docs/COPYRIGHT.rdoc for more details.
++#%>
-<section data-augmented-model-wrapper
- data-modal-iframe-url="<%= OpenProject::Configuration.onboarding_video_url %>"
- data-modal-class-name="onboarding-modal -highlight">
- <li>
- <%= link_to t(:label_introduction_video),
- '',
- title: t(:label_introduction_video),
- class: 'modal-delivery-element--activation-link' %>
- </li>
+<li
+ class="op-menu--item"
+ data-augmented-model-wrapper
+ data-modal-iframe-url="<%= OpenProject::Configuration.onboarding_video_url %>"
+ data-modal-class-name="onboarding-modal -highlight"
+>
+ <%= link_to t(:label_introduction_video),
+ '',
+ title: t(:label_introduction_video),
+ class: 'op-menu--item-action modal-delivery-element--activation-link' %>
<%= render partial: '/onboarding/onboarding_video_modal' %>
-</section>
+</li>
diff --git a/app/views/search/_mini_form.html.erb b/app/views/search/_mini_form.html.erb
index 8960ecbde25..c2ea7e15b93 100644
--- a/app/views/search/_mini_form.html.erb
+++ b/app/views/search/_mini_form.html.erb
@@ -26,10 +26,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See docs/COPYRIGHT.rdoc for more details.
++#%>
-<div class="top-menu-search--wrapper">
+<div class="op-app-search">
<%= label_tag("q", t(:label_search), class: "hidden-for-sighted") %>
- <global-search-input>
-
- </global-search-input>
+ <global-search-input></global-search-input>
</div>
diff --git a/config/initializers/menus.rb b/config/initializers/menus.rb
index bd7ad3a7c68..a15bf6a17b0 100644
--- a/config/initializers/menus.rb
+++ b/config/initializers/menus.rb
@@ -59,10 +59,9 @@ Redmine::MenuManager.map :top_menu do |menu|
OpenProject::Static::Links.help_link,
last: true,
caption: '',
- icon: 'icon5 icon-help',
+ icon: 'icon-help op-app-help--icon',
html: { accesskey: OpenProject::AccessKeys.key_for(:help),
title: I18n.t('label_help'),
- class: 'top-menu-help',
target: '_blank' }
end
diff --git a/docker-compose.yml b/docker-compose.yml
index 74dd1077731..76102bd8d57 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -46,7 +46,7 @@ services:
environment:
LOCAL_DEV_CHECK: "${LOCAL_DEV_CHECK:?The docker-compose file for OpenProject has moved to https://github.com/opf/openproject-deploy}"
RAILS_ENV: development
- RAILS_CACHE_STORE: memcache
+ RAILS_CACHE_STORE: file_store
OPENPROJECT_CACHE__MEMCACHE__SERVER: cache:11211
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
DATABASE_URL: postgresql://${DB_USERNAME:-postgres}:${DB_PASSWORD:-postgres}@${DB_HOST:-db}:${DB_PORT:-5432}/${DB_DATABASE:-openproject}
diff --git a/frontend/src/app/components/main-menu/main-menu-navigation.service.ts b/frontend/src/app/components/main-menu/main-menu-navigation.service.ts
index 5674bee6722..f09c975308d 100644
--- a/frontend/src/app/components/main-menu/main-menu-navigation.service.ts
+++ b/frontend/src/app/components/main-menu/main-menu-navigation.service.ts
@@ -37,7 +37,6 @@ export class MainMenuNavigationService {
.addClass('open')
.find('li > a:first, .tree-menu--title:first').first().focus();
- console.log("Activating " + targetLi.data('name'));
that.navigationEvents$.next(targetLi.data('name'));
}
return false;
@@ -108,7 +107,7 @@ export class MainMenuNavigationService {
}
jQuery('#main-menu ul.main-menu--children').each(function(_i, child) {
- var title = jQuery(child).parents('li').find('.main-item-wrapper .menu-item--title').contents()[0].textContent;
+ var title = jQuery(child).parents('li').find('.main-item-wrapper .op-menu--item-title').contents()[0].textContent;
var parentURL = jQuery(child).parents('li').find('.main-item-wrapper > a').attr('href');
var header = jQuery('<div class="main-menu--children-menu-header"></div>');
var upLink = jQuery('<a class="main-menu--arrow-left-to-project" href="#"><i class="icon-arrow-left1" aria-hidden="true"></i></a>');
diff --git a/frontend/src/app/components/main-menu/main-menu-toggle.component.ts b/frontend/src/app/components/main-menu/main-menu-toggle.component.ts
index 1cc566d0b81..d0928bff446 100644
--- a/frontend/src/app/components/main-menu/main-menu-toggle.component.ts
+++ b/frontend/src/app/components/main-menu/main-menu-toggle.component.ts
@@ -27,28 +27,34 @@
//++
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnInit } from '@angular/core';
-import { MainMenuToggleService } from './main-menu-toggle.service';
import { distinctUntilChanged } from 'rxjs/operators';
import { CurrentProjectService } from "core-components/projects/current-project.service";
import { DeviceService } from "app/modules/common/browser/device.service";
import { InjectField } from "core-app/helpers/angular/inject-field.decorator";
import { UntilDestroyedMixin } from "core-app/helpers/angular/until-destroyed.mixin";
+import { MainMenuToggleService } from './main-menu-toggle.service';
export const mainMenuToggleSelector = 'main-menu-toggle';
@Component({
selector: mainMenuToggleSelector,
changeDetection: ChangeDetectionStrategy.OnPush,
+ host: {
+ class: 'op-app-menu',
+ },
template: `
- <div *ngIf="this.currentProject.id !== null || this.deviceService.isMobile" id="main-menu-toggle"
- aria-haspopup="true"
- [attr.title]="toggleTitle"
- (accessibleClick)="toggleService.toggleNavigation($event)"
- tabindex="0">
- <a icon="icon-hamburger">
- <i class="icon-hamburger" aria-hidden="true"></i>
- </a>
- </div>
+ <button
+ *ngIf="this.currentProject.id !== null || this.deviceService.isMobile"
+ class="op-app-menu--item-action"
+ id="main-menu-toggle"
+ aria-haspopup="true"
+ type="button"
+ [attr.title]="toggleTitle"
+ (click)="toggleService.toggleNavigation($event)"
+ >
+ <op-icon class="icon-hamburger" aria-hidden="true"></op-icon>
+ <op-icon class="icon-close" aria-hidden="true"></op-icon>
+ </button>
`
})
diff --git a/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts b/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts
index fe856418c4a..3357b746555 100644
--- a/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts
+++ b/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts
@@ -89,7 +89,7 @@ export class ProjectMenuAutocompleteComponent extends ILazyAutocompleterBridge<I
ngOnInit() {
this.$element = jQuery(this.elementRef.nativeElement);
- this.dropdownMenu = this.$element.parents('li.drop-down');
+ this.dropdownMenu = this.$element.parents('li.op-app-menu--item_has-dropdown');
this.input = this.$element.find('.project-menu-autocomplete--input');
this.noResults = this.$element.find('.project-menu-autocomplete--no-results');
diff --git a/frontend/src/app/globals/global-listeners.ts b/frontend/src/app/globals/global-listeners.ts
index 39e4c20d2d3..3dfa240beeb 100644
--- a/frontend/src/app/globals/global-listeners.ts
+++ b/frontend/src/app/globals/global-listeners.ts
@@ -131,7 +131,7 @@ import { detectOnboardingTour } from "core-app/globals/onboarding/onboarding_tou
setupToggableFieldsets();
// Top menu click handling
- new TopMenu(jQuery('#top-menu-items'));
+ new TopMenu(jQuery('.op-app-header'));
// Action menu logic
jQuery('.project-actions, .toolbar-items').each(function (idx:number, menu:HTMLElement) {
diff --git a/frontend/src/app/globals/global-listeners/top-menu.ts b/frontend/src/app/globals/global-listeners/top-menu.ts
index 0f7bab76306..127d8db4b2c 100644
--- a/frontend/src/app/globals/global-listeners/top-menu.ts
+++ b/frontend/src/app/globals/global-listeners/top-menu.ts
@@ -56,7 +56,7 @@ export class TopMenu {
}
accessibility() {
- jQuery(".drop-down > ul").attr("aria-expanded", "false");
+ jQuery(".op-app-menu--dropdown").attr("aria-expanded", "false");
}
toggleClick(dropdown:JQuery) {
@@ -104,65 +104,62 @@ export class TopMenu {
}
closeOnBodyClick() {
- const self = this;
const wrapper = document.getElementById('wrapper');
-
if (!wrapper) {
return;
}
- wrapper.addEventListener('click', function (evt) {
- if (self.menuIsOpen && !self.openDropdowns()[0].contains(evt.target as HTMLElement)) {
- self.closing();
+ wrapper.addEventListener('click', (evt) => {
+ if (this.menuIsOpen && !this.openDropdowns()[0].contains(evt.target as HTMLElement)) {
+ this.closing();
}
}, true);
}
openDropdowns() {
- return this.dropdowns().filter(".open");
+ return this.menuContainer.find(".op-app-menu--item_dropdown-open");
}
dropdowns() {
- return this.menuContainer.find("li.drop-down");
+ return this.menuContainer.find(".op-app-menu--item_has-dropdown");
}
withHeadingFoldOutAtBorder() {
- var menu_start_position;
+ let menu_start_position;
if (this.menuContainer.next().get(0) !== undefined && (this.menuContainer.next().get(0).tagName === 'H2')) {
menu_start_position = this.menuContainer.next().innerHeight()! + this.menuContainer.next().position().top;
- this.menuContainer.find("ul.menu-drop-down-container").css({ top: menu_start_position });
+ this.menuContainer.find(".op-app-menu--body").css({ top: menu_start_position });
} else if (this.menuContainer.next().hasClass("wiki-content") &&
this.menuContainer.next().children().next().first().get(0) !== undefined &&
this.menuContainer.next().children().next().first().get(0).tagName === 'H1') {
var wiki_heading = this.menuContainer.next().children().next().first();
menu_start_position = wiki_heading.innerHeight()! + wiki_heading.position().top;
- this.menuContainer.find("ul.menu-drop-down-container").css({ top: menu_start_position });
+ this.menuContainer.find(".op-app-menu--body").css({ top: menu_start_position });
}
}
setupDropdownClick() {
- var self = this;
- this.dropdowns().each(function (ix, it) {
- jQuery(it).click(function () {
- self.toggleClick(jQuery(this));
+ this.dropdowns().each((ix, it) => {
+ jQuery(it).find('.op-app-menu--item-action').click(() => {
+ this.toggleClick(jQuery(it));
return false;
});
- jQuery(it).on('touchstart', function (e) {
+ jQuery(it).find('op-app-menu--item-action').on('touchstart', function (e) {
// This shall avoid the hover event is fired,
// which would otherwise lead to menu being closed directly after its opened.
// Ignore clicks from within the dropdown
- if (jQuery(e.target).closest('.menu-drop-down-container').length) {
+ if (jQuery(e.target).closest('.op-app-menu--body').length) {
return true;
}
e.preventDefault();
- jQuery(this).click();
+ jQuery(it).click();
return false;
});
});
}
isOpen(dropdown:JQuery) {
- return dropdown.filter(".open").length === 1;
+ return dropdown.filter(".op-app-menu--item_dropdown-open").length === 1;
}
isClosed(dropdown:JQuery) {
@@ -183,10 +180,9 @@ export class TopMenu {
}
closeOtherItems(dropdown:JQuery) {
- var self = this;
- this.openDropdowns().each(function (ix, it) {
+ this.openDropdowns().each((ix, it) => {
if (jQuery(it) !== jQuery(dropdown)) {
- self.close(jQuery(it), true);
+ this.close(jQuery(it), true);
}
});
}
@@ -206,14 +202,14 @@ export class TopMenu {
}
slideDown(dropdown:JQuery, callback:any) {
- var toDrop = dropdown.find("> ul");
- dropdown.addClass("open");
+ const toDrop = dropdown.find(".op-app-menu--dropdown");
+ dropdown.addClass("op-app-menu--item_dropdown-open");
toDrop.slideDown(ANIMATION_RATE_MS, callback).attr("aria-expanded", "true");
}
slideUp(dropdown:JQuery, immediate:any) {
- var toDrop = jQuery(dropdown).find("> ul");
- dropdown.removeClass("open");
+ const toDrop = jQuery(dropdown).find(".op-app-menu--dropdown");
+ dropdown.removeClass("op-app-menu--item_dropdown-open");
if (immediate) {
toDrop.hide();
@@ -243,10 +239,10 @@ export class TopMenu {
registerEventHandlers() {
const toggler = jQuery("#main-menu-toggle");
- this.menuContainer.on("closeDropDown", (event) => {
- this.close(jQuery(event.target));
+ this.menuContainer.on("closeDropDown", (event: Event) => {
+ this.close(jQuery(event.target as HTMLElement));
}).on("openDropDown", (event) => {
- this.open(jQuery(event.target));
+ this.open(jQuery(event.target as HTMLElement));
}).on("closeMenu", () => {
this.closing();
}).on("openMenu", () => {
diff --git a/frontend/src/app/globals/onboarding/onboarding_tour.ts b/frontend/src/app/globals/onboarding/onboarding_tour.ts
index 35f3a935275..01797d57f72 100644
--- a/frontend/src/app/globals/onboarding/onboarding_tour.ts
+++ b/frontend/src/app/globals/onboarding/onboarding_tour.ts
@@ -23,6 +23,7 @@ declare global {
export function start(name:OnboardingTourNames) {
+ console.log('star tour', name);
switch (name) {
case 'backlogs':
initializeTour('startTaskBoardTour');
@@ -68,6 +69,7 @@ function initializeTour(storageValue:any, disabledElements?:any, projectSelectio
}
function startTour(steps:any) {
+ console.log('startTour', steps);
window.onboardingTourInstance.set(steps);
window.onboardingTourInstance.run();
}
diff --git a/frontend/src/app/globals/onboarding/tours/homescreen_tour.ts b/frontend/src/app/globals/onboarding/tours/homescreen_tour.ts
index 8919306bed5..2b077fa7aef 100644
--- a/frontend/src/app/globals/onboarding/tours/homescreen_tour.ts
+++ b/frontend/src/app/globals/onboarding/tours/homescreen_tour.ts
@@ -3,7 +3,7 @@ import { demoProjectName, preventClickHandler, scrumDemoProjectName } from "core
export function homescreenOnboardingTourSteps() {
return [
{
- 'next #top-menu': I18n.t('js.onboarding.steps.welcome'),
+ 'next .op-app-header': I18n.t('js.onboarding.steps.welcome'),
'skipButton': { className: 'enjoyhint_btn-transparent', text: I18n.t('js.onboarding.buttons.skip') },
'nextButton': { text: I18n.t('js.onboarding.buttons.next') },
'containerClass': '-hidden-arrow',
diff --git a/frontend/src/app/globals/onboarding/tours/menu_tour.ts b/frontend/src/app/globals/onboarding/tours/menu_tour.ts
index 818b86d0640..983163ccc54 100644
--- a/frontend/src/app/globals/onboarding/tours/menu_tour.ts
+++ b/frontend/src/app/globals/onboarding/tours/menu_tour.ts
@@ -11,7 +11,7 @@ export function menuTourSteps() {
'nextButton': { text: I18n.t('js.onboarding.buttons.next') },
},
{
- 'next .top-menu-help': I18n.t('js.onboarding.steps.help_menu'),
+ 'next .op-app-help': I18n.t('js.onboarding.steps.help_menu'),
'shape': 'circle',
'showSkip': false,
'nextButton': { text: I18n.t('js.onboarding.buttons.got_it') }
diff --git a/frontend/src/app/modules/common/header/app-header.sass b/frontend/src/app/modules/common/header/app-header.sass
new file mode 100644
index 00000000000..2e530f1fcd1
--- /dev/null
+++ b/frontend/src/app/modules/common/header/app-header.sass
@@ -0,0 +1,73 @@
+.op-app-header
+ display: grid
+ grid-template-columns: 1fr auto 1fr
+ grid-template-rows: auto
+ grid-template-areas: "start center end"
+ background-color: var(--header-bg-color)
+ height: var(--header-height)
+ padding: 0
+ position: relative
+ z-index: 22
+ border-bottom-style: solid
+ border-bottom-width: var(--header-border-bottom-width)
+ border-bottom-color: var(--header-border-bottom-color)
+ width: 100vw
+
+ @include breakpoint(680px down)
+ position: fixed
+ top: 0
+ left: 0
+ right: 0
+
+ @at-root .zen-mode &
+ display: none
+
+ &--start,
+ &--center,
+ &--end
+ display: flex
+ height: var(--header-height)
+
+ &--start
+ grid-area: start
+ justify-content: flex-start
+
+ &--center
+ grid-area: center
+ justify-content: center
+
+ &--end
+ grid-area: end
+ justify-content: flex-end
+
+ &--avatar
+ border: 1px solid var(--header-item-font-color)
+
+ &_search-open
+ @include breakpoint(850px down)
+ .op-logo
+ display: none
+
+ @include breakpoint(680px down)
+ display: flex
+
+ .op-app-header--start,
+ .op-app-header--center
+ display: none
+
+ .op-app-header--end
+ flex-grow: 1
+
+ .top-menu-search
+ margin: 0
+
+ .top-menu-search--button
+ display: none
+ color: var(--header-item-font-color)
+
+ @include breakpoint(480px down)
+ .op-app-menu
+ display: none
+
+ .top-menu-search
+ padding-right: 1rem
diff --git a/frontend/src/app/modules/common/header/app-help.sass b/frontend/src/app/modules/common/header/app-help.sass
new file mode 100644
index 00000000000..b18f0f9c524
--- /dev/null
+++ b/frontend/src/app/modules/common/header/app-help.sass
@@ -0,0 +1,11 @@
+.op-app-help
+ &--icon
+ &::before
+ display: flex
+ justify-content: center
+ align-items: center
+ border: 2px solid var(--header-item-font-color)
+ border-radius: 50%
+ width: 26px
+ height: 26px
+ padding: 1px 8px 0 8px
diff --git a/frontend/src/app/modules/common/header/app-menu.sass b/frontend/src/app/modules/common/header/app-menu.sass
new file mode 100644
index 00000000000..4ceb6081ef7
--- /dev/null
+++ b/frontend/src/app/modules/common/header/app-menu.sass
@@ -0,0 +1,80 @@
+.op-app-menu
+ list-style: none
+ display: flex
+ margin: 0
+ height: 100%
+
+ &--item
+ display: flex
+ position: relative
+ height: 100%
+
+ &--item-dropdown-indicator
+ display: inline-flex
+ justify-content: center
+ align-items: center
+
+ &--item-action
+ background: transparent
+ border: 0
+ display: flex
+ justify-content: center
+ align-items: center
+ height: var(--header-height)
+ line-height: var(--header-height)
+ zoom: 1
+ color: var(--header-item-font-color)
+ font-size: var(--header-item-font-size)
+ text-decoration: none
+ padding: 0 15px
+ text-overflow: ellipsis
+ white-space: nowrap
+
+
+ .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)
+
+ &:focus
+ color: var(--header-item-font-hover-color)
+
+ &--dropdown
+ position: absolute
+ top: 100%
+ left: auto
+ right: 0
+
+ background: #fff
+ border-radius: 0
+ box-shadow: 1px 1px 4px rgba(0,0,0,.15)
+ overflow: visible
+ padding: 3px 0
+ margin: 0
+
+ min-width: 270px
+ padding: 6px 0
+ border: 1px solid var(--header-drop-down-border-color)
+ border-top: 0
+ background-color: var(--header-drop-down-bg-color)
+ 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
+
+ @include breakpoint(680px down)
+ position: fixed
+ top: var(--header-height)
+ left: 0
+ right: 0
+ width: 100vw
diff --git a/frontend/src/app/modules/common/header/app-search.sass b/frontend/src/app/modules/common/header/app-search.sass
new file mode 100644
index 00000000000..5d3b1de0b62
--- /dev/null
+++ b/frontend/src/app/modules/common/header/app-search.sass
@@ -0,0 +1,3 @@
+.op-app-search
+ @include breakpoint(680px down)
+ flex-grow: 1
diff --git a/frontend/src/app/modules/common/header/index.sass b/frontend/src/app/modules/common/header/index.sass
new file mode 100644
index 00000000000..27fc02228b7
--- /dev/null
+++ b/frontend/src/app/modules/common/header/index.sass
@@ -0,0 +1,6 @@
+@import './app-header'
+@import './logo'
+@import './app-menu'
+@import './app-search'
+@import './app-help'
+@import './quick-add-menu'
diff --git a/frontend/src/app/modules/common/header/logo.sass b/frontend/src/app/modules/common/header/logo.sass
new file mode 100644
index 00000000000..3a4b1a5f3dc
--- /dev/null
+++ b/frontend/src/app/modules/common/header/logo.sass
@@ -0,0 +1,17 @@
+.op-logo
+ width: 230px
+ height: var(--header-height)
+
+ &--link
+ margin-top: 12px
+ width: 100%
+ display: block
+ height: 30px
+ background: var(--header-home-link-bg)
+ text-indent: -9999em
+ background-position: center
+ background-size: contain
+ background-repeat: no-repeat
+
+ @include breakpoint(680px down)
+ display: none
diff --git a/frontend/src/app/modules/common/header/quick-add-menu.sass b/frontend/src/app/modules/common/header/quick-add-menu.sass
new file mode 100644
index 00000000000..730b4adc5b9
--- /dev/null
+++ b/frontend/src/app/modules/common/header/quick-add-menu.sass
@@ -0,0 +1,34 @@
+.op-quick-add-menu
+ @include breakpoint(680px down)
+ display: none
+
+ &--button
+ display: flex
+ justify-content: center
+ align-items: center
+ position: relative
+ color: var(--button--alt-highlight-font-color)
+ font-size: 0.8rem
+
+ > *
+ z-index: 1
+
+ &::after
+ display: block
+ background: var(--button--alt-highlight-background-color)
+ border-width: 2px
+ border-style: solid
+ border-color: var(--button--alt-highlight-background-color)
+ border-radius: 50%
+ padding: 0.25rem
+ width: 26px
+ height: 26px
+ content: ''
+ position: absolute
+
+ &:hover
+ > *
+ opacity: 0.9
+
+ &::after
+ opacity: 0.8
diff --git a/frontend/src/app/modules/common/menu/menu.sass b/frontend/src/app/modules/common/menu/menu.sass
new file mode 100644
index 00000000000..85e340f1f6e
--- /dev/null
+++ b/frontend/src/app/modules/common/menu/menu.sass
@@ -0,0 +1,42 @@
+.op-menu
+ display: flex
+ flex-direction: column
+
+ &--item
+
+ &-action
+ display: block
+ height: 32px
+ line-height: 32px
+ text-decoration: none
+ padding: 0px 13px 0px 10px
+ white-space: nowrap
+ font-weight: 400
+ overflow: hidden
+ text-overflow: ellipsis
+ color: var(--context-menu-unselected-font-color)
+
+ &:focus
+ background-color: #f0f0f0
+ color: var(--context-menu-unselected-font-color)
+
+ &:hover,
+ &:active
+ background-color: #f0f0f0
+ color: var(--context-menu-hover-font-color)
+ cursor: pointer
+ text-decoration: none
+
+ &--item-action,
+ &--headline
+ padding: 0 10px
+
+ &--headline
+ font-size: 12px
+ color: var(--gray-dark)
+ text-transform: uppercase
+
+ &--separator
+ border-bottom: 1px solid var(--content-form-separator-color)
+ margin: 0 0 10px
+ background: none
diff --git a/frontend/src/app/modules/common/openproject-common.module.sass b/frontend/src/app/modules/common/openproject-common.module.sass
index c064607a36c..ceb57d89b77 100644
--- a/frontend/src/app/modules/common/openproject-common.module.sass
+++ b/frontend/src/app/modules/common/openproject-common.module.sass
@@ -1,3 +1,5 @@
+@import './header/index'
+@import './menu/menu'
@import './input/input'
@import './link/link'
@import './form-field/form-field'
diff --git a/frontend/src/app/modules/global_search/input/global-search-input-mobile.component.sass b/frontend/src/app/modules/global_search/input/global-search-input-mobile.component.sass
index c70f8d70a1e..16b8ac1a421 100644
--- a/frontend/src/app/modules/global_search/input/global-search-input-mobile.component.sass
+++ b/frontend/src/app/modules/global_search/input/global-search-input-mobile.component.sass
@@ -3,29 +3,15 @@
$search-input-height-mobile: 36px
@media only screen and (max-width: 679px)
- #top-menu
- &.-global-search-expanded
- #account-nav-right,
- #account-nav-left,
- #main-menu-toggle
- display: none
-
- .top-menu-search
- width: 100vw
- margin: 0
- padding-right: 15px
-
- .top-menu-search--button
- display: none
- color: var(--header-item-font-color)
-
+ .top-menu-search
#global-search-input
display: none
&.-expanded
display: block
- width: calc(100vw - 50px)
min-width: unset
+ width: auto
position: unset
+ flex-grow: 1
.scroll-host
max-height: calc(100vh - #{var(--header-height)})
diff --git a/frontend/src/app/modules/global_search/input/global-search-input.component.ts b/frontend/src/app/modules/global_search/input/global-search-input.component.ts
index 0c14eadceed..76d0f4f546f 100644
--- a/frontend/src/app/modules/global_search/input/global-search-input.component.ts
+++ b/frontend/src/app/modules/global_search/input/global-search-input.component.ts
@@ -438,7 +438,7 @@ export class GlobalSearchInputComponent implements OnInit, OnDestroy {
}
private toggleTopMenuClass() {
- jQuery('#top-menu').toggleClass('-global-search-expanded', this.expanded);
+ jQuery('.op-app-header').toggleClass('op-app-header_search-open', this.expanded);
}
}
diff --git a/frontend/src/app/modules/invite-user-modal/invite-user-modal-augment.service.ts b/frontend/src/app/modules/invite-user-modal/invite-user-modal-augment.service.ts
index e9bad2a0187..52d642ac689 100644
--- a/frontend/src/app/modules/invite-user-modal/invite-user-modal-augment.service.ts
+++ b/frontend/src/app/modules/invite-user-modal/invite-user-modal-augment.service.ts
@@ -27,9 +27,8 @@
//++
-import {Inject, Injectable, Injector} from "@angular/core";
+import {Inject, Injectable} from "@angular/core";
import {DOCUMENT} from "@angular/common";
-import {DynamicContentModal} from "core-components/modals/modal-wrapper/dynamic-content.modal";
import {OpModalService} from "core-app/modules/modal/modal.service";
import {CurrentProjectService} from "core-components/projects/current-project.service";
import {InviteUserModalComponent} from "./invite-user.component";
@@ -71,7 +70,7 @@ export class OpInviteUserModalAugmentService {
modal
.closingEvent
- .subscribe((modal:{data:unknown}) => {
+ .subscribe((modal:InviteUserModalComponent) => {
// Just reload the page for now if we saved anything
if (modal.data) {
window.location.reload();
diff --git a/frontend/src/global_styles/content/_accounts.sass b/frontend/src/global_styles/content/_accounts.sass
index 10dbdf44e2e..d016476ab0f 100644
--- a/frontend/src/global_styles/content/_accounts.sass
+++ b/frontend/src/global_styles/content/_accounts.sass
@@ -47,9 +47,15 @@
float: none
display: inline-block
+#nav-login-content
+ padding: 1rem
+
+#login-pulldown
+ margin-right: 0
+
// use id selectors to be specific enough to override general content and top-menu definitions
#content .login-auth-providers,
-#top-menu #nav-login-content .login-auth-providers
+#nav-login-content .login-auth-providers
width: 471px
margin-top: 25px
@@ -110,7 +116,7 @@
line-height: normal
white-space: normal
-#top-menu #nav-login-content .login-auth-providers
+#nav-login-content .login-auth-providers
h3
&:before
width: 100%
@@ -120,7 +126,7 @@
margin-top: -15px
margin-bottom: 10px
-#top-menu #nav-login-content .login-auth-providers.no-pwd
+#nav-login-content .login-auth-providers.no-pwd
margin-top: 0
.registration-footer
diff --git a/frontend/src/global_styles/content/menus/_project_autocompletion.sass b/frontend/src/global_styles/content/menus/_project_autocompletion.sass
index ce689703349..6900f2657f9 100644
--- a/frontend/src/global_styles/content/menus/_project_autocompletion.sass
+++ b/frontend/src/global_styles/content/menus/_project_autocompletion.sass
@@ -28,6 +28,9 @@
// (May not be supported by all browsers yet, but soonish)
overscroll-behavior: contain
+ @include breakpoint(680px down)
+ width: 100vw
+
@include default-font(var(--header-drop-down-projects-search-font-color), 13px)
li
padding: 0 10px
@@ -58,6 +61,10 @@
height: 2.125rem
background: var(--header-drop-down-projects-search-input-bg-color)
+ @include breakpoint(680px down)
+ margin-left: 0px
+ width: calc(100% - 35px)
+
// Lens icon on the right
.project-menu-autocomplete--search-icon
position: absolute
@@ -66,13 +73,16 @@
right: 20px
font-size: 14px
+ @include breakpoint(680px down)
+ right: 40px
+
// Override top menu height
ul.project-menu-autocomplete--results
max-height: 55vh
overflow-y: auto
// Override the computed width of the input, but span the entire width
// of the dropdown
- width: 398px !important
+ width: 100% !important
padding-top: 0px
// Borders to complete the menu look
border-right: 1px solid var(--header-drop-down-border-color)
diff --git a/frontend/src/global_styles/layout/_index.sass b/frontend/src/global_styles/layout/_index.sass
index 56d19ef2bec..3055779bbb0 100644
--- a/frontend/src/global_styles/layout/_index.sass
+++ b/frontend/src/global_styles/layout/_index.sass
@@ -44,9 +44,6 @@
@import toolbar_mobile
@import zen_mode
-// Top menu styles
-@import top_menu/index
-
// Work packages page layouts
@import work_packages/index
diff --git a/frontend/src/global_styles/layout/_main_menu.sass b/frontend/src/global_styles/layout/_main_menu.sass
index eb1a416c589..cbd7f395fb8 100644
--- a/frontend/src/global_styles/layout/_main_menu.sass
+++ b/frontend/src/global_styles/layout/_main_menu.sass
@@ -409,3 +409,7 @@ $badge_offset: 4px
margin-left: 5px
font-weight: bold
font-style: italic
+
+#main-menu-toggle
+ .icon-close
+ display: none
diff --git a/frontend/src/global_styles/layout/_main_menu_mobile.sass b/frontend/src/global_styles/layout/_main_menu_mobile.sass
index e16d5d3a3eb..88500fce828 100644
--- a/frontend/src/global_styles/layout/_main_menu_mobile.sass
+++ b/frontend/src/global_styles/layout/_main_menu_mobile.sass
@@ -27,7 +27,6 @@
//++
@include breakpoint(680px down)
-
.main-menu
position: fixed
z-index: 12
@@ -36,8 +35,21 @@
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.15)
min-width: 75vw
- .hidden-navigation .main-menu
- display: none
+ #main-menu-toggle
+ .icon-hamburger
+ display: none
+ .icon-close
+ display: block
+
+ .hidden-navigation
+ .main-menu
+ display: none
+ #main-menu-toggle
+ .icon-hamburger
+ display: block
+ .icon-close
+ display: none
+
.main-item-wrapper a
width: 100%
@@ -46,15 +58,15 @@
display: none
.content-overlay
- display: block
// Background color transition simulates a fade-in effect
background: #fff
transition: background .3s
- #wrapper:not(.hidden-navigation)
- #main-menu-toggle i:before
- @include icon-mixin-close
+ #main:not(.nosidebar)
+ .content-overlay
+ display: block
+ #wrapper:not(.hidden-navigation)
.content-overlay
position: fixed
height: 100%
diff --git a/frontend/src/global_styles/layout/top_menu/_dropdown.sass b/frontend/src/global_styles/layout/top_menu/_dropdown.sass
deleted file mode 100644
index 0caafc00002..00000000000
--- a/frontend/src/global_styles/layout/top_menu/_dropdown.sass
+++ /dev/null
@@ -1,44 +0,0 @@
-//-- copyright
-// OpenProject is an open source project management software.
-// Copyright (C) 2012-2021 the OpenProject GmbH
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License version 3.
-//
-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-// Copyright (C) 2006-2013 Jean-Philippe Lang
-// Copyright (C) 2010-2013 the ChiliProject Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See docs/COPYRIGHT.rdoc for more details.
-//++
-
-.top-menu-dropdown
- &--link
- @extend %top-menu-link-styles
-
- &--headline
- padding-left: 10px
- font-size: 12px
- color: var(--gray-dark)
- text-transform: uppercase
-
- &--separator
- background: none
- border-bottom: 1px solid var(--content-form-separator-color)
- margin: 0 0 10px
- &+ li
- margin-bottom: 5px
diff --git a/frontend/src/global_styles/layout/top_menu/_help_menu.sass b/frontend/src/global_styles/layout/top_menu/_help_menu.sass
deleted file mode 100644
index 2a534ced41e..00000000000
--- a/frontend/src/global_styles/layout/top_menu/_help_menu.sass
+++ /dev/null
@@ -1,14 +0,0 @@
-.top-menu-help
- &--icon
- border-width: 2px
- border-style: solid
- color: var(--header-item-font-color)
- border-color: var(--header-item-font-color)
- border-radius: 50%
- width: 26px
- height: 26px
- display: inline-flex
-
- &--dropdown
- left: auto
- right: 0
diff --git a/frontend/src/global_styles/layout/top_menu/_index.sass b/frontend/src/global_styles/layout/top_menu/_index.sass
deleted file mode 100644
index c66b5544307..00000000000
--- a/frontend/src/global_styles/layout/top_menu/_index.sass
+++ /dev/null
@@ -1,38 +0,0 @@
-//-- copyright
-// OpenProject is an open source project management software.
-// Copyright (C) 2012-2021 the OpenProject GmbH
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License version 3.
-//
-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-// Copyright (C) 2006-2013 Jean-Philippe Lang
-// Copyright (C) 2010-2013 the ChiliProject Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See docs/COPYRIGHT.rdoc for more details.
-//++
-
-// General top_menu
-@import mixins
-@import top_menu_legacy
-@import dropdown
-@import top_menu_mobile
-
-// Specifics for certain menus
-@import quick_add_menu
-@import help_menu
-@import overridden_help_link
diff --git a/frontend/src/global_styles/layout/top_menu/_mixins.sass b/frontend/src/global_styles/layout/top_menu/_mixins.sass
deleted file mode 100644
index c6c93d07824..00000000000
--- a/frontend/src/global_styles/layout/top_menu/_mixins.sass
+++ /dev/null
@@ -1,48 +0,0 @@
-//-- copyright
-// OpenProject is an open source project management software.
-// Copyright (C) 2012-2021 the OpenProject GmbH
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License version 3.
-//
-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-// Copyright (C) 2006-2013 Jean-Philippe Lang
-// Copyright (C) 2010-2013 the ChiliProject Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See docs/COPYRIGHT.rdoc for more details.
-//++
-
-%top-menu-hover-styles
- background: var(--header-item-bg-hover-color)
- color: var(--header-item-font-hover-color)
- border-bottom-width: var(--header-border-bottom-width)
- border-bottom-color: var(--header-border-bottom-color)
- border-bottom-style: solid
- text-decoration: none
-
-%top-menu-link-styles
- display: block
- height: var(--header-height)
- line-height: var(--header-height)
- zoom: 1
- color: var(--header-item-font-color)
- font-size: var(--header-item-font-size)
- text-decoration: none
- padding: 0 15px
- &:hover
- @extend %top-menu-hover-styles
-
diff --git a/frontend/src/global_styles/layout/top_menu/_overridden_help_link.sass b/frontend/src/global_styles/layout/top_menu/_overridden_help_link.sass
deleted file mode 100644
index df6d1b348a3..00000000000
--- a/frontend/src/global_styles/layout/top_menu/_overridden_help_link.sass
+++ /dev/null
@@ -1,7 +0,0 @@
-.overridden-help-menu
- // We have no control over the menu item being rendered
- // so we cannot enforce bem element here
- .help-menu-item
- @extend %top-menu-link-styles
-
-
diff --git a/frontend/src/global_styles/layout/top_menu/_quick_add_menu.sass b/frontend/src/global_styles/layout/top_menu/_quick_add_menu.sass
deleted file mode 100644
index 3ea994cef12..00000000000
--- a/frontend/src/global_styles/layout/top_menu/_quick_add_menu.sass
+++ /dev/null
@@ -1,45 +0,0 @@
-//-- copyright
-// OpenProject is an open source project management software.
-// Copyright (C) 2012-2021 the OpenProject GmbH
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License version 3.
-//
-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-// Copyright (C) 2006-2013 Jean-Philippe Lang
-// Copyright (C) 2010-2013 the ChiliProject Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See docs/COPYRIGHT.rdoc for more details.
-//++
-
-.quick-add-menu
- &--icon
- background: var(--button--alt-highlight-background-color)
- color: var(--button--alt-highlight-font-color)
- border-width: 2px
- border-style: solid
- border-color: var(--button--alt-highlight-background-color)
- border-radius: 50%
- padding: 0.25rem
- width: 26px
- height: 26px
- display: inline-flex
-
- &:hover
- background: var(--button--alt-highlight-background-hover-color)
- border-color: var(--button--alt-highlight-background-hover-color)
- color: var(--button--alt-highlight-font-color)
diff --git a/frontend/src/global_styles/layout/top_menu/_top_menu_legacy.sass b/frontend/src/global_styles/layout/top_menu/_top_menu_legacy.sass
deleted file mode 100644
index 364e3a34511..00000000000
--- a/frontend/src/global_styles/layout/top_menu/_top_menu_legacy.sass
+++ /dev/null
@@ -1,210 +0,0 @@
-//-- copyright
-// OpenProject is an open source project management software.
-// Copyright (C) 2012-2021 the OpenProject GmbH
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License version 3.
-//
-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-// Copyright (C) 2006-2013 Jean-Philippe Lang
-// Copyright (C) 2010-2013 the ChiliProject Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See docs/COPYRIGHT.rdoc for more details.
-//++
-
-
-// These styles do not follow BEM
-// instead of modifying, please extract into BEM pieces when you touch these
-
-#logo
- width: 230px
- height: var(--header-height)
- position: absolute
- left: calc(50% - 230px / 2)
-
- .home-link
- margin-top: 12px
- display: block
- height: 30px
- background: var(--header-home-link-bg)
- text-indent: -9999em
- background-position: center
- background-size: contain
- background-repeat: no-repeat
-
-#top-menu
- background-color: var(--header-bg-color)
- height: var(--header-height)
- padding: 0
- z-index: 22
- border-bottom-style: solid
- border-bottom-width: var(--header-border-bottom-width)
- border-bottom-color: var(--header-border-bottom-color)
- .menu_root
- margin: 0
- padding: 0
- float: left
- height: var(--header-height)
- border-top: 0
- flex: 1 1 auto
- li.drop-down,
- li.top-menu--login
- float: left
- list-style-type: none
- white-space: nowrap
- position: relative
- z-index: 5
- padding: 0
-
- > ul
- min-width: 270px
- padding: 6px 0
- border: 1px solid var(--header-drop-down-border-color)
- border-top: 0
- background-color: var(--header-drop-down-bg-color)
- max-height: calc(100vh - var(--header-height))
- overflow-y: auto
- overflow-x: hidden
-
- @include styled-scroll-bar
-
- li
- float: none
- > ul.drop-down--projects
- width: 400px
- left: 0px
-
- li.drop-down.open
- .button--dropdown-indicator:before
- @include icon-mixin-pulldown-up
-
- li.last-child > ul,
- .drop-down--modules
- left: auto
- right: 0
-
- .drop-down--projects
- > li
- &:nth-last-child(2)
- margin-bottom: 6px
-
- #nav-login-content
- width: 506px
- position: relative
- position-top: 44px
- float: right
- background: #FFFFFF
- border: 0 solid #194E60
- border-top: 0
- line-height: 19px
- padding: 15px 10px 15px 15px
- @include default-font(#555555, 13px)
-
- a
- display: inline
- padding: 0
- font-weight: normal
- table td
- padding: 3px
-
- .skip-navigation-link:focus
- top: 40px
- left: 260px
- color: var(--font-color-on-primary)
-
-#quick-search
- float: right
-
-#top-menu-items
- padding-top: 0
- display: flex
- align-items: center
- .top-menu-items-right
- display: flex
-
-.account-nav
- display: block
- li
- a
- @include text-shortener
- display: block
- padding: 0 9px 0
-
-#account-nav-left
- .drop-down
- // Half viewport width minus half logo.
- max-width: calc((100vW/2) - 115px - var(--hamburger-width) + var(--hamburger-right))
- .nosidebar &
- max-width: calc((100vW/2) - 115px)
- #projects-menu
- font-weight: bold
- padding-left: 6px
- .nosidebar &
- padding-left: 15px
-
- .button--dropdown-text
- @include text-shortener
- // Half viewport width minus half logo minus margins.
- max-width: calc((100vW/2) - 115px - 50px - var(--hamburger-width) + var(--hamburger-right))
- .nosidebar &
- max-width: calc((100vW/2) - 115px - 50px)
-
- &:after
- position: absolute
- right: 15px
- top: calc(50% - 10px / 2)
-
-#top-menu #account-nav-left .menu-drop-down-container
- overflow: hidden
-
-#account-nav-right
- display: flex
- .last-child
- .avatar
- // To accommodate the padding of the help icon which exists because of the circle
- margin-top: -5px
- .avatar-default
- border: 1px solid
- border-color: var(--header-item-font-color)
-
- .icon-user
- font-size: 18px
- [class*="icon-"]:before
- padding: 0.25rem
-
-
-#main-menu-toggle
- display: block
- width: var(--hamburger-width)
- height: var(--header-height-mobile)
- float: left
- text-align: center
- margin-right: var(--hamburger-right)
- > a
- @extend %top-menu-link-styles
-
- .nosidebar &
- display: none
-
-@media only screen and (max-width: 750px)
- #logo
- display: none
-
-// Decrease logo size so that the "Buy now" teaser still fits into the empty space to the right of it.
-@media only screen and (max-width: 1200px)
- #logo
- max-width: 100px
diff --git a/frontend/src/global_styles/layout/top_menu/_top_menu_mobile.sass b/frontend/src/global_styles/layout/top_menu/_top_menu_mobile.sass
deleted file mode 100644
index 15caa7fcd9a..00000000000
--- a/frontend/src/global_styles/layout/top_menu/_top_menu_mobile.sass
+++ /dev/null
@@ -1,122 +0,0 @@
-//-- copyright
-// OpenProject is an open source project management software.
-// Copyright (C) 2012-2021 the OpenProject GmbH
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License version 3.
-//
-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-// Copyright (C) 2006-2013 Jean-Philippe Lang
-// Copyright (C) 2010-2013 the ChiliProject Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See docs/COPYRIGHT.rdoc for more details.
-//++
-
-@include breakpoint(680px down)
- $hamburger-right: -3px
- $hamburger-width: 50px
-
- #logo
- background-color: transparent
-
- #top-menu
- position: fixed
- right: 0
- left: 0
- margin-top: 0px
- transition: margin-top .4s
-
- // Slide header in and out on scroll (see also: _base_mobile.sass)
- .-header-scrolled &
- margin-top: -#{var(--header-height)}
- transition: margin-top .4s
-
- #nav-login-content
- float: none
- padding: 15px 20px
- width: 100%
-
- .grid-block
- display: block
-
- .form--field
- padding-right: 0
-
- .login-auth-providers
- width: 100% !important
- white-space: normal
-
- h3.login-auth-providers-title:before
- border: none !important
-
- .button
- margin-right: 0
- li > a:before
- font-size: 1.25rem !important
- vertical-align: text-bottom
- li.drop-down > ul.drop-down--projects
- width: 100vw
- border-right: none
- border-left: none
- left: -1 * ($hamburger-width + $hamburger-right)
- .nosidebar &
- left: 0px
-
- #account-nav-right
- > li ul
- top: var(--header-height-mobile)
- width: 100vw
- box-shadow: 1px 1px 4px #cccccc
- border: solid 1px rgba(0, 0, 0, 0.2)
-
- li
- max-width: none
-
- #more-menu.drop-down--modules
- // 66 = Width of one menu item
- right: -66px
-
- #account-nav-left
- #projects-menu
- .button--dropdown-text
- // Viewport minus #account-nav-right when logged out, which is
- // 165px, as this is the space for the long login text label: "Connexion" (French).
- // 36px is the padding around the project name.
- max-width: calc(100vW - 165px - 36px - #{$hamburger-width + $hamburger-right})
- .nosidebar &
- max-width: calc(100vW - 165px - 36px)
- .drop-down
- // Viewport minus #account-nav-right when logged out
- // 165px as this is the space for the long login text label: "Connexion" (French)
- max-width: calc(100vW - 165px - #{$hamburger-width + $hamburger-right})
- .nosidebar &
- max-width: calc(100vW - 165px)
- ul
- width: 100vw !important
- border: none
- top: var(--header-height-mobile)
-
- .project-search-results
- width: 100vw !important
- left: 0 !important
- border-right: 0
-
- .project-menu-autocomplete--input-container
- border-right: none !important
- border-left: none !important
- .project-menu-autocomplete--results
- border-bottom: 2px solid var(--header-drop-down-border-color) !important
diff --git a/lib/redmine/menu_manager/menu_helper.rb b/lib/redmine/menu_manager/menu_helper.rb
index ce6c1e9b571..c6ecc28c3a0 100644
--- a/lib/redmine/menu_manager/menu_helper.rb
+++ b/lib/redmine/menu_manager/menu_helper.rb
@@ -84,6 +84,7 @@ module Redmine::MenuManager::MenuHelper
selected = any_item_selected?(items)
label_node = render_drop_down_label_node(label, selected, label_options)
+ options[:drop_down_class] = 'op-menu ' + options.fetch(:drop_down_class, '')
render_menu_dropdown(label_node, options) do
items.each do |item|
concat render_menu_node(item, project)
@@ -100,12 +101,12 @@ module Redmine::MenuManager::MenuHelper
# menu_item_class: Additional classes for the menu item li wrapper
# drop_down_class: Additional classes for the hidden drop down
def render_menu_dropdown(label_node, options = {}, &block)
- content_tag :li, class: "top-menu-dropdown #{options[:menu_item_class]} drop-down" do
+ content_tag :li, class: "op-app-menu--item op-app-menu--item_has-dropdown #{options[:menu_item_class]}" do
concat(label_node)
concat(content_tag(:ul,
style: 'display:none',
id: options[:drop_down_id],
- class: 'menu-drop-down-container ' + options.fetch(:drop_down_class, ''),
+ class: 'op-app-menu--dropdown ' + options.fetch(:drop_down_class, ''),
&block))
end
end
@@ -113,13 +114,13 @@ module Redmine::MenuManager::MenuHelper
def render_drop_down_label_node(label, selected, options = {})
options[:title] ||= selected ? t(:description_current_position) + label : label
options[:aria] = { haspopup: 'true' }
- options[:class] = "top-menu-dropdown--link #{options[:class]} #{selected ? 'selected' : ''}"
+ options[:class] = "op-app-menu--item-action #{options[:class]} #{selected ? 'selected' : ''}"
- link_to('', options) do
+ link_to('#', options) do
concat(op_icon(options[:icon])) if options[:icon]
concat(you_are_here_info(selected).html_safe)
concat(content_tag(:span, label, class: 'button--dropdown-text'))
- concat('<i class="button--dropdown-indicator"></i>'.html_safe) unless options.key?(:icon)
+ concat('<i class="op-app-menu--item-dropdown-indicator button--dropdown-indicator"></i>'.html_safe) unless options.key?(:icon)
end
end
@@ -163,19 +164,20 @@ module Redmine::MenuManager::MenuHelper
end
end
- def render_single_menu_node(item, project = nil)
+ def render_single_menu_node(item, project = nil, menu_class = 'op-menu')
caption, url, selected = extract_node_details(item, project)
link_text = ''.html_safe
link_text << op_icon(item.icon(project)) if item.icon(project).present?
link_text << content_tag(:span,
- class: "menu-item--title ellipsis #{item.badge(project).present? ? '-has-badge' : ''}",
+ class: "#{menu_class}--item-title #{item.badge(project).present? ? "#{menu_class}--item-title_has-badge" : ''}",
lang: menu_item_locale(item)) do
''.html_safe + caption + badge_for(item)
end
link_text << ' '.html_safe + op_icon(item.icon_after) if item.icon_after.present?
html_options = item.html_options(selected: selected)
html_options[:title] ||= selected ? t(:description_current_position) + caption : caption
+ html_options[:class] = "#{html_options[:class]} #{menu_class}--item-action"
link_to link_text, url, html_options
end
diff --git a/lib/redmine/menu_manager/menu_item.rb b/lib/redmine/menu_manager/menu_item.rb
index b132d0bf3f2..67cb72c8e4f 100644
--- a/lib/redmine/menu_manager/menu_item.rb
+++ b/lib/redmine/menu_manager/menu_item.rb
@@ -62,7 +62,7 @@ class Redmine::MenuManager::MenuItem < Redmine::MenuManager::TreeNode
@html_options = options[:html].nil? ? {} : options[:html].dup
# Adds a unique class to each menu item based on its name
@html_options[:class] = [
- @html_options[:class], "#{@name.to_s.dasherize}-menu-item", 'ellipsis'
+ @html_options[:class], "#{@name.to_s.dasherize}-menu-item"
].compact.join(' ')
@parent = options[:parent]
@child_menus = options[:children]
diff --git a/lib/redmine/menu_manager/top_menu/help_menu.rb b/lib/redmine/menu_manager/top_menu/help_menu.rb
index 3f880e18755..a8f80d12836 100644
--- a/lib/redmine/menu_manager/top_menu/help_menu.rb
+++ b/lib/redmine/menu_manager/top_menu/help_menu.rb
@@ -35,7 +35,9 @@ module Redmine::MenuManager::TopMenu::HelpMenu
OpenProject::Cache.fetch(cache_key) do
if OpenProject::Static::Links.help_link_overridden?
- content_tag('li', render_single_menu_node(item), class: 'overridden-help-menu')
+ content_tag('li',
+ render_single_menu_node(item, nil, 'op-app-menu'),
+ class: 'op-app-menu--item op-app-help op-app-help_overridden')
else
render_help_dropdown
end
@@ -43,17 +45,17 @@ module Redmine::MenuManager::TopMenu::HelpMenu
end
def render_help_dropdown
- link_to_help_pop_up = link_to '',
+ link_to_help_pop_up = link_to '#',
title: I18n.t(:label_help),
- class: 'top-menu-dropdown--link',
+ class: 'op-app-menu--item-action',
aria: { haspopup: 'true' } do
- op_icon('icon-help top-menu-help--icon')
+ op_icon('icon-help op-app-help--icon')
end
render_menu_dropdown(
link_to_help_pop_up,
- menu_item_class: 'hidden-for-mobile top-menu-help',
- drop_down_class: 'top-menu-help--dropdown'
+ menu_item_class: 'op-app-help hidden-for-mobile',
+ drop_down_class: 'op-menu'
) do
result = ''.html_safe
render_onboarding result
@@ -67,13 +69,13 @@ module Redmine::MenuManager::TopMenu::HelpMenu
private
def render_onboarding(result)
- result << content_tag(:li) do
+ result << content_tag(:li, class: 'op-menu--item') do
content_tag(:span, I18n.t('top_menu.getting_started'),
- class: 'top-menu-dropdown--headline',
+ class: 'op-menu--headline',
title: I18n.t('top_menu.getting_started'))
end
result << render_onboarding_menu_item
- result << content_tag(:hr, '', class: 'top-menu-dropdown--separator')
+ result << content_tag(:hr, '', class: 'op-menu--separator')
end
def render_onboarding_menu_item
@@ -81,9 +83,9 @@ module Redmine::MenuManager::TopMenu::HelpMenu
end
def render_help_and_support(result)
- result << content_tag(:li) do
+ result << content_tag(:li, class: 'op-menu--item') do
content_tag :span, I18n.t('top_menu.help_and_support'),
- class: 'top-menu-dropdown--headline',
+ class: 'op-menu--headline',
title: I18n.t('top_menu.help_and_support')
end
if EnterpriseToken.show_banners?
@@ -91,23 +93,24 @@ module Redmine::MenuManager::TopMenu::HelpMenu
href_suffix: "/?utm_source=unknown&utm_medium=op-instance&utm_campaign=ee-upsale-help-menu")
end
result << static_link_item(:user_guides)
- result << content_tag(:li) do
+ result << content_tag(:li, class: 'op-menu--item') do
link_to I18n.t('label_videos'),
OpenProject::Configuration.youtube_channel,
title: I18n.t('label_videos'),
+ class: 'op-menu--item-action',
target: '_blank'
end
result << static_link_item(:shortcuts)
result << static_link_item(:forums)
result << static_link_item(:professional_support)
- result << content_tag(:hr, '', class: 'top-menu-dropdown--separator')
+ result << content_tag(:hr, '', class: 'op-menu--separator')
end
def render_additional_resources(result)
- result << content_tag(:li) do
+ result << content_tag(:li, class: 'op-menu--item') do
content_tag :span,
I18n.t('top_menu.additional_resources'),
- class: 'top-menu-dropdown--headline',
+ class: 'op-menu--headline',
title: I18n.t('top_menu.additional_resources')
end
@@ -135,8 +138,12 @@ module Redmine::MenuManager::TopMenu::HelpMenu
def static_link_item(key, options = {})
link = OpenProject::Static::Links.links[key]
label = I18n.t(link[:label])
- content_tag(:li) do
- link_to label, "#{link[:href]}#{options[:href_suffix]}", title: label, target: '_blank'
+ content_tag(:li, class: 'op-menu--item') do
+ link_to label,
+ "#{link[:href]}#{options[:href_suffix]}",
+ title: label,
+ target: '_blank',
+ class: 'op-menu--item-action'
end
end
end
diff --git a/lib/redmine/menu_manager/top_menu/projects_menu.rb b/lib/redmine/menu_manager/top_menu/projects_menu.rb
index 810e1834672..efd2076dc74 100644
--- a/lib/redmine/menu_manager/top_menu/projects_menu.rb
+++ b/lib/redmine/menu_manager/top_menu/projects_menu.rb
@@ -53,7 +53,7 @@ module Redmine::MenuManager::TopMenu::ProjectsMenu
end
def project_items
- [project_index_item, project_new_item]
+ [project_index_item]
end
def project_index_item
@@ -68,20 +68,5 @@ module Redmine::MenuManager::TopMenu::ProjectsMenu
)
end
- def project_new_item
- Redmine::MenuManager::MenuItem.new(
- :new_project,
- main_app.new_project_path,
- caption: Project.model_name.human,
- icon: "icon-add icon4",
- html: {
- accesskey: OpenProject::AccessKeys.key_for(:new_project),
- aria: { label: t(:label_project_new) },
- title: t(:label_project_new)
- },
- if: Proc.new { User.current.allowed_to?(:add_project, nil, global: true) }
- )
- end
-
include OpenProject::StaticRouting::UrlHelpers
end
diff --git a/lib/redmine/menu_manager/top_menu/quick_add_menu.rb b/lib/redmine/menu_manager/top_menu/quick_add_menu.rb
index afee2f19eca..ad26dfeecbf 100644
--- a/lib/redmine/menu_manager/top_menu/quick_add_menu.rb
+++ b/lib/redmine/menu_manager/top_menu/quick_add_menu.rb
@@ -32,9 +32,7 @@ module Redmine::MenuManager::TopMenu::QuickAddMenu
def render_quick_add_menu
return unless show_quick_add_menu?
- content_tag :ul, class: 'menu_root account-nav quick-add-menu' do
- render_quick_add_dropdown
- end
+ render_quick_add_dropdown
end
private
@@ -44,11 +42,14 @@ module Redmine::MenuManager::TopMenu::QuickAddMenu
label: '',
label_options: {
title: I18n.t('menus.quick_add.label'),
- icon: 'icon-add quick-add-menu--icon',
- class: 'quick-add-menu--button'
+ icon: 'icon-add',
+ class: 'op-quick-add-menu--button'
},
items: first_level_menu_items_for(:quick_add_menu),
- options: { drop_down_id: 'quick-add-menu' },
+ options: {
+ drop_down_id: 'quick-add-menu',
+ menu_item_class: 'op-quick-add-menu'
+ },
project: @project
) do
work_package_quick_add_items
@@ -60,7 +61,7 @@ module Redmine::MenuManager::TopMenu::QuickAddMenu
def work_package_quick_add_items
return unless visible_types.any?
- concat content_tag(:hr, '', class: 'top-menu-dropdown--separator')
+ concat content_tag(:hr, '', class: 'op-menu--separator')
concat work_package_type_heading
visible_types
@@ -71,10 +72,10 @@ module Redmine::MenuManager::TopMenu::QuickAddMenu
end
def work_package_type_heading
- content_tag(:li) do
+ content_tag(:li, class: 'op-menu--item') do
content_tag :span,
I18n.t(:label_work_package_plural),
- class: 'top-menu-dropdown--headline'
+ class: 'op-menu--headline'
end
end
@@ -89,15 +90,15 @@ module Redmine::MenuManager::TopMenu::QuickAddMenu
end
def work_package_create_link(type_id, type_name)
- content_tag(:li) do
+ content_tag(:li, class: 'op-menu--item') do
if in_project_context?
link_to type_name,
new_project_work_packages_path(project_id: @project.identifier, type: type_id),
- class: "__hl_inline_type_#{type_id}"
+ class: "__hl_inline_type_#{type_id} op-menu--item-action"
else
link_to type_name,
new_work_packages_path(type: type_id),
- class: "__hl_inline_type_#{type_id}"
+ class: "__hl_inline_type_#{type_id} op-menu--item-action"
end
end
end
diff --git a/lib/redmine/menu_manager/top_menu_helper.rb b/lib/redmine/menu_manager/top_menu_helper.rb
index 633fe7c36b9..f406f488ac5 100644
--- a/lib/redmine/menu_manager/top_menu_helper.rb
+++ b/lib/redmine/menu_manager/top_menu_helper.rb
@@ -32,14 +32,15 @@ module Redmine::MenuManager::TopMenuHelper
include Redmine::MenuManager::TopMenu::QuickAddMenu
def render_top_menu_left
- content_tag :ul, id: 'account-nav-left', class: 'menu_root account-nav top-menu' do
+ content_tag :ul, class: 'op-app-menu op-app-menu_drop-left' do
[render_main_top_menu_nodes,
- render_projects_top_menu_node].join.html_safe
+ render_projects_top_menu_node,
+ render_quick_add_menu].join.html_safe
end
end
def render_top_menu_right
- content_tag :ul, id: 'account-nav-right', class: 'menu_root account-nav top-menu-right' do
+ content_tag :ul, class: 'op-app-menu' do
[render_module_top_menu_node,
render_help_top_menu_node,
render_user_top_menu_node].join.html_safe
@@ -61,33 +62,33 @@ module Redmine::MenuManager::TopMenuHelper
def render_login_drop_down
url = { controller: '/account', action: 'login' }
link = link_to url,
- class: 'top-menu-dropdown--link login',
+ class: 'op-app-menu--item-action',
title: I18n.t(:label_login) do
concat('<span class="button--dropdown-text hidden-for-mobile">'.concat(I18n.t(:label_login)).concat('</span>').html_safe)
- concat('<i class="button--dropdown-indicator hidden-for-mobile"></i>'.html_safe)
+ concat('<i class="op-app-menu--item-dropdown-indicator button--dropdown-indicator hidden-for-mobile"></i>'.html_safe)
concat('<i class="icon2 icon-user hidden-for-desktop"></i>'.html_safe)
end
- render_menu_dropdown(link, menu_item_class: 'drop-down last-child top-menu--login') do
+ render_menu_dropdown(link, menu_item_class: '') do
render_login_partial
end
end
def render_direct_login
link = link_to signin_path,
- class: 'login',
+ class: 'op-app-menu--item-action login',
title: I18n.t(:label_login) do
concat('<span class="button--dropdown-text hidden-for-mobile">'.concat(I18n.t(:label_login)).concat('</span>').html_safe)
concat('<i class="icon2 icon-user hidden-for-desktop"></i>'.html_safe)
end
- content_tag :li, class: "last-child top-menu--login" do
+ content_tag :li, class: "" do
concat link
end
end
def render_user_drop_down(items)
- avatar = avatar(User.current)
+ avatar = avatar(User.current, class: 'op-app-header--avatar')
render_menu_dropdown_with_items(
label: avatar.presence || '',
label_options: {
diff --git a/modules/auth_plugins/spec/features/auth_provider_spec.rb b/modules/auth_plugins/spec/features/auth_provider_spec.rb
index 0b378ad0404..437bee02e30 100644
--- a/modules/auth_plugins/spec/features/auth_provider_spec.rb
+++ b/modules/auth_plugins/spec/features/auth_provider_spec.rb
@@ -45,7 +45,7 @@ describe 'rendering the login buttons', js: true do
it 'renders correctly' do
visit project_path(public_project)
- page.find('a.login').click
+ page.find('a', text: 'Sign in').click
item = page.find('a.auth-provider', text: 'mock_auth')
expect(item[:href]).to end_with '/auth/mock_auth'
end
diff --git a/modules/bim/spec/features/bim_revit_add_in_navigation_spec.rb b/modules/bim/spec/features/bim_revit_add_in_navigation_spec.rb
index 6b33a0f6241..28d1710e1fd 100644
--- a/modules/bim/spec/features/bim_revit_add_in_navigation_spec.rb
+++ b/modules/bim/spec/features/bim_revit_add_in_navigation_spec.rb
@@ -82,7 +82,7 @@ describe 'BIM Revit Add-in navigation spec',
end
it 'the user menu has an option to go to the add-in settings' do
- within '.top-menu-items-right' do
+ within '.op-app-header' do
page.find("a[title='#{user.name}']").click
expect(page).to have_selector('li', text: I18n.t('js.revit.revit_add_in_settings'))
diff --git a/modules/reporting/spec/features/top_menu_item_spec.rb b/modules/reporting/spec/features/top_menu_item_spec.rb
index 2f44296b41f..bdab5f42520 100644
--- a/modules/reporting/spec/features/top_menu_item_spec.rb
+++ b/modules/reporting/spec/features/top_menu_item_spec.rb
@@ -33,7 +33,7 @@ feature 'Top menu items', js: true do
let(:open_menu) { true }
def has_menu_items?(*labels)
- within '#top-menu' do
+ within '.op-app-header' do
labels.each do |l|
expect(page).to have_link(l)
end
@@ -41,7 +41,7 @@ feature 'Top menu items', js: true do
end
def expect_no_menu_item(*labels)
- within '#top-menu' do
+ within '.op-app-header' do
labels.each do |l|
expect(page).not_to have_link(l)
end
@@ -52,7 +52,7 @@ feature 'Top menu items', js: true do
# if the menu is not completely expanded (e.g. if the frontend thread is too fast),
# the click might be ignored
- within '.drop-down.open ul[aria-expanded=true]' do
+ within '.op-app-menu--item_has-dropdown .op-app-menu--dropdown[aria-expanded=true]' do
expect(page).not_to have_selector('[style~=overflow]')
page.find_link(title).find('span').click
diff --git a/spec/features/auth/logout_spec.rb b/spec/features/auth/logout_spec.rb
index 6df2f1a6ee1..5901d9baa62 100644
--- a/spec/features/auth/logout_spec.rb
+++ b/spec/features/auth/logout_spec.rb
@@ -43,7 +43,7 @@ describe 'Logout', type: :feature, js: true do
it 'prevents the user from making any more changes' do
visit my_page_path
- within '.top-menu-items-right' do
+ within '.op-app-header' do
page.find("a[title='#{user.name}']").click
click_link I18n.t(:label_logout)
diff --git a/spec/features/menu_items/help_menu_spec.rb b/spec/features/menu_items/help_menu_spec.rb
index e71ef0cdc2a..ac0079bb86b 100644
--- a/spec/features/menu_items/help_menu_spec.rb
+++ b/spec/features/menu_items/help_menu_spec.rb
@@ -30,7 +30,7 @@ require 'spec_helper'
feature 'Help menu items' do
let(:user) { FactoryBot.create :admin }
- let(:help_item) { find('.top-menu-help') }
+ let(:help_item) { find('.op-app-help .op-app-menu--item-action') }
before do
login_as user
@@ -41,13 +41,13 @@ feature 'Help menu items' do
visit home_path
help_item.click
- expect(page).to have_selector('.top-menu-help li',
+ expect(page).to have_selector('.op-app-help .op-menu--item-action',
text: I18n.t('homescreen.links.user_guides'))
end
end
- describe 'When force_help_link is set' do
- let(:custom_url) { 'https://mycustomurl.example.org' }
+ describe 'When force_help_link is set', js: true do
+ let(:custom_url) { 'https://mycustomurl.example.org/' }
before do
allow(OpenProject::Configuration).to receive(:force_help_link)
.and_return custom_url
@@ -56,7 +56,7 @@ feature 'Help menu items' do
visit home_path
expect(help_item[:href]).to eq(custom_url)
- expect(page).to have_no_selector('.top-menu-help .top-menu-dropdown--link', visible: false)
+ expect(page).to have_no_selector('.op-app-help .op-app-menu--dropdown', visible: false)
end
end
end
diff --git a/spec/features/menu_items/menu_permissions_spec.rb b/spec/features/menu_items/menu_permissions_spec.rb
index edc6f7afb02..ba84b18124e 100644
--- a/spec/features/menu_items/menu_permissions_spec.rb
+++ b/spec/features/menu_items/menu_permissions_spec.rb
@@ -47,9 +47,9 @@ describe 'menu permissions', type: :feature, js: true do
end
it 'I can see all menu entries' do
- expect(page).to have_selector('#menu-sidebar .menu-item--title', text: 'Versions')
- expect(page).to have_selector('#menu-sidebar .menu-item--title', text: 'Information')
- expect(page).to have_selector('#menu-sidebar .menu-item--title', text: 'Modules')
+ expect(page).to have_selector('#menu-sidebar .op-menu--item-title', text: 'Versions')
+ expect(page).to have_selector('#menu-sidebar .op-menu--item-title', text: 'Information')
+ expect(page).to have_selector('#menu-sidebar .op-menu--item-title', text: 'Modules')
end
it 'the parent node directs to the generic settings page' do
@@ -71,9 +71,9 @@ describe 'menu permissions', type: :feature, js: true do
end
it 'I can only see the version settings page' do
- expect(page).to have_selector('#menu-sidebar .menu-item--title', text: 'Versions')
- expect(page).not_to have_selector('#menu-sidebar .menu-item--title', text: 'Information')
- expect(page).not_to have_selector('#menu-sidebar .menu-item--title', text: 'Modules')
+ expect(page).to have_selector('#menu-sidebar .op-menu--item-title', text: 'Versions')
+ expect(page).not_to have_selector('#menu-sidebar .op-menu--item-title', text: 'Information')
+ expect(page).not_to have_selector('#menu-sidebar .op-menu--item-title', text: 'Modules')
end
it 'the parent node directs to the only visible children page' do
diff --git a/spec/features/menu_items/top_menu_item_spec.rb b/spec/features/menu_items/top_menu_item_spec.rb
index 9015a6ccc3c..6782713d59e 100644
--- a/spec/features/menu_items/top_menu_item_spec.rb
+++ b/spec/features/menu_items/top_menu_item_spec.rb
@@ -33,7 +33,7 @@ feature 'Top menu items', js: true, selenium: true do
let(:open_menu) { true }
def has_menu_items?(*labels)
- within '#top-menu' do
+ within '.op-app-header' do
labels.each do |l|
expect(page).to have_link(l)
end
@@ -47,7 +47,7 @@ feature 'Top menu items', js: true, selenium: true do
# if the menu is not completely expanded (e.g. if the frontend thread is too fast),
# the click might be ignored
- within '.drop-down.open ul[aria-expanded=true]' do
+ within '.op-app-menu--dropdown[aria-expanded=true]' do
expect(page).not_to have_selector('[style~=overflow]')
page.find_link(title).find('span').click
@@ -111,20 +111,13 @@ feature 'Top menu items', js: true, selenium: true do
describe 'Projects' do
let(:top_menu) { find(:css, '#projects-menu') }
- let(:new_project) { I18n.t(:label_project_new) }
let(:all_projects) { I18n.t(:label_project_view_all) }
- let(:all_items) { [new_project, all_projects] }
+ let(:all_items) { [all_projects] }
context 'as an admin' do
let(:user) { FactoryBot.create :admin }
it 'displays all items' do
- has_menu_items?(new_project, all_projects)
- end
-
- it 'visits the work package page' do
- click_link_in_open_menu(new_project)
-
- expect(page).to have_current_path(new_project_path)
+ has_menu_items?(all_projects)
end
it 'visits the projects page' do
diff --git a/spec/features/users/self_registration_spec.rb b/spec/features/users/self_registration_spec.rb
index 22689df5a8d..ad4eb7c073d 100644
--- a/spec/features/users/self_registration_spec.rb
+++ b/spec/features/users/self_registration_spec.rb
@@ -58,7 +58,7 @@ describe 'user self registration', type: :feature, js: true do
home_page.visit!
# registration as an anonymous user
- within '.top-menu-items-right .menu_root' do
+ within '.op-app-header' do
click_link 'Sign in'
SeleniumHubWaiter.wait
@@ -120,7 +120,7 @@ describe 'user self registration', type: :feature, js: true do
# Test logging in as newly created and activated user
login_with 'heidi', 'test123=321test'
- within '.top-menu-items-right .menu_root' do
+ within '.op-app-header' do
expect(page)
.to have_selector("a[title='#{registered_user.name}']")
end
diff --git a/spec/features/work_packages/cancel_editing_spec.rb b/spec/features/work_packages/cancel_editing_spec.rb
index 5926c145c39..99154aa064e 100644
--- a/spec/features/work_packages/cancel_editing_spec.rb
+++ b/spec/features/work_packages/cancel_editing_spec.rb
@@ -62,7 +62,7 @@ describe 'Cancel editing work package', js: true do
end
def move_to_home_page(alert: true)
- find('.home-link').click
+ find('.op-logo--link').click
page.driver.browser.switch_to.alert.accept if alert
expect(page).to have_selector('#projects-menu', text: 'Select a project')
@@ -153,7 +153,7 @@ describe 'Cancel editing work package', js: true do
expect(wp_page).not_to have_alert_dialog
# Visiting another page does not create alert
- find('.home-link').click
+ find('.op-logo--link').click
expect(wp_page).not_to have_alert_dialog
end
diff --git a/spec/support/components/menu/dropdown.rb b/spec/support/components/menu/dropdown.rb
index 0b9c4bbb785..982c5c62b25 100644
--- a/spec/support/components/menu/dropdown.rb
+++ b/spec/support/components/menu/dropdown.rb
@@ -38,15 +38,15 @@ module Components
end
def expect_closed
- expect(page).to have_no_selector('ul.menu-drop-down-container')
+ expect(page).to have_no_selector('.op-app-menu--dropdown')
end
def expect_open
- expect(page).to have_selector('ul.menu-drop-down-container')
+ expect(page).to have_selector('.op-app-menu--dropdown')
end
def within_dropdown(&block)
- page.within('ul.menu-drop-down-container', &block)
+ page.within('.op-app-menu--dropdown', &block)
end
def trigger_element
diff --git a/spec/support/pages/work_packages/abstract_work_package.rb b/spec/support/pages/work_packages/abstract_work_package.rb
index 7cff38b1643..f93116a9071 100644
--- a/spec/support/pages/work_packages/abstract_work_package.rb
+++ b/spec/support/pages/work_packages/abstract_work_package.rb
@@ -147,13 +147,13 @@ module Pages
def expect_zen_mode
expect(page).to have_selector('.zen-mode')
expect(page).to have_selector('#main-menu', visible: false)
- expect(page).to have_selector('#top-menu', visible: false)
+ expect(page).to have_selector('.op-app-header', visible: false)
end
def expect_no_zen_mode
expect(page).not_to have_selector('.zen-mode')
expect(page).to have_selector('#main-menu', visible: true)
- expect(page).to have_selector('#top-menu', visible: true)
+ expect(page).to have_selector('.op-app-header', visible: true)
end
def expect_custom_action(name)