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

Add I18n strings for sidebar and fix last usages of new angular layout

Henriette Darge46f439613d22
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index 3af7e367725..2518cfee591 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -95,7 +95,7 @@ class MyController < ApplicationController
# Configure user's mail reminders
def reminders
render html: '',
- layout: 'angular',
+ layout: 'angular/angular',
locals: { menu_name: :my_menu }
end
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index 4d2e573a44b..296178f7e4d 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -579,6 +579,14 @@ en:
mark_as_read: 'Mark as read'
text_update_date: "%{date} by"
total_count_warning: "Showing the %{newest_count} most recent notifications. %{more_count} more are not displayed."
+ menu:
+ accountable: 'Accountable'
+ assigned: 'Assigned'
+ by_project: 'By Project'
+ by_reason: 'By Reason'
+ inbox: 'Inbox'
+ mentioned: '@mentioned'
+ watching: 'Watching'
settings:
title: "Notification settings"
notify_me: "Notify me"
diff --git a/frontend/src/app/core/apiv3/types/hal-collection.type.ts b/frontend/src/app/core/apiv3/types/hal-collection.type.ts
index d2c10246670..826417c5da0 100644
--- a/frontend/src/app/core/apiv3/types/hal-collection.type.ts
+++ b/frontend/src/app/core/apiv3/types/hal-collection.type.ts
@@ -3,7 +3,7 @@ export interface IHALGrouping {
count:number;
_links:{
valueLink:{
- href:string;
+ href:string;
}[];
};
}
diff --git a/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts b/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts
index 74f6cae24b2..9e0a4f892f1 100644
--- a/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts
+++ b/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts
@@ -5,7 +5,7 @@ import {
OnInit,
} from '@angular/core';
import { combineLatest } from 'rxjs';
-import { map, tap } from 'rxjs/operators';
+import { map } from 'rxjs/operators';
import { StateService } from '@uirouter/core';
import idFromLink from 'core-app/features/hal/helpers/id-from-link';
import { I18nService } from 'core-app/core/i18n/i18n.service';
@@ -18,13 +18,13 @@ export const ianMenuSelector = 'op-ian-menu';
selector: ianMenuSelector,
templateUrl: './menu.component.html',
styleUrls: ['./menu.component.sass'],
- providers: [ IanMenuService ],
+ providers: [IanMenuService],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class IanMenuComponent implements OnInit {
baseMenuItems = [
{
- title: 'Inbox',
+ title: this.I18n.t('js.notifications.menu.inbox'),
icon: 'inbox',
href: this.getHrefForFilters({}),
},
@@ -33,33 +33,33 @@ export class IanMenuComponent implements OnInit {
reasonMenuItems = [
{
key: 'mentioned',
- title: '@mentioned',
+ title: this.I18n.t('js.notifications.menu.mentioned'),
icon: 'mention',
href: this.getHrefForFilters({ filter: 'reason', name: 'mentioned' }),
},
{
key: 'assigned',
- title: 'Assigned',
+ title: this.I18n.t('js.notifications.menu.assigned'),
icon: 'assigned',
- href: this.getHrefForFilters({ filter: 'reason', name: 'assigned' }),
+ href: this.getHrefForFilters({ filter: 'reason', name: 'assigned' }),
},
{
key: 'accountable',
- title: 'Accountable',
+ title: this.I18n.t('js.notifications.menu.accountable'),
icon: 'accountable',
- href: this.getHrefForFilters({ filter: 'reason', name: 'accountable' }),
+ href: this.getHrefForFilters({ filter: 'reason', name: 'accountable' }),
},
{
key: 'watched',
- title: 'Watching',
+ title: this.I18n.t('js.notifications.menu.watching'),
icon: 'watching',
- href: this.getHrefForFilters({ filter: 'reason', name: 'watched' }),
+ href: this.getHrefForFilters({ filter: 'reason', name: 'watched' }),
},
];
notificationsByProject$ = this.ianMenuService.query.notificationsByProject$.pipe(
map((items) => items
- .map(item => ({
+ .map((item) => ({
...item,
title: (item.projectHasParent ? '...' : '') + item.value,
href: this.getHrefForFilters({ filter: 'project', name: String(idFromLink(item._links.valueLink[0].href)) }),
@@ -70,15 +70,14 @@ export class IanMenuComponent implements OnInit {
}
return a.value.toLowerCase().localeCompare(b.value.toLowerCase());
- }),
- ),
+ })),
);
notificationsByReason$ = this.ianMenuService.query.notificationsByReason$.pipe(
- map((items) => this.reasonMenuItems.map(reason => ({
- ...items.find(item => item.value === reason.key),
+ map((items) => this.reasonMenuItems.map((reason) => ({
+ ...items.find((item) => item.value === reason.key),
...reason,
- })))
+ }))),
);
menuItems$ = combineLatest([
@@ -88,12 +87,12 @@ export class IanMenuComponent implements OnInit {
map(([byProject, byReason]) => [
...this.baseMenuItems,
{
- title: 'By Reason',
+ title: this.I18n.t('js.notifications.menu.by_reason'),
collapsible: true,
children: byReason,
},
{
- title: 'By Project',
+ title: this.I18n.t('js.notifications.menu.by_project'),
collapsible: true,
children: byProject,
},
@@ -116,7 +115,7 @@ export class IanMenuComponent implements OnInit {
readonly state:StateService,
) { }
- ngOnInit() {
+ ngOnInit():void {
this.ianMenuService.reload();
}
diff --git a/frontend/src/app/shared/components/sidemenu/sidemenu.component.sass b/frontend/src/app/shared/components/sidemenu/sidemenu.component.sass
index 83a446f557d..b151cfbd484 100644
--- a/frontend/src/app/shared/components/sidemenu/sidemenu.component.sass
+++ b/frontend/src/app/shared/components/sidemenu/sidemenu.component.sass
@@ -23,8 +23,6 @@
&--items
list-style: none
- &--item
-
&--item-action
display: flex
align-items: center
@@ -46,5 +44,3 @@
&--item-icon
font-size: 24px
margin-right: 8px
-
- &_collapsed
diff --git a/lib/redmine/menu_manager/menu_helper.rb b/lib/redmine/menu_manager/menu_helper.rb
index 1dab74be75d..f3948e837d8 100644
--- a/lib/redmine/menu_manager/menu_helper.rb
+++ b/lib/redmine/menu_manager/menu_helper.rb
@@ -65,7 +65,7 @@ module Redmine::MenuManager::MenuHelper
@menu = menu
links << render_menu_node(node, project)
end
-
+
first_level = any_item_selected?(select_leafs(menu_items)) || !current_menu_item_part_of_menu?(menu, project)
classes = first_level ? 'open' : 'closed'
diff --git a/modules/backlogs/app/controllers/rb_application_controller.rb b/modules/backlogs/app/controllers/rb_application_controller.rb
index e5e85ee80cb..aafd7065c35 100644
--- a/modules/backlogs/app/controllers/rb_application_controller.rb
+++ b/modules/backlogs/app/controllers/rb_application_controller.rb
@@ -36,7 +36,7 @@ class RbApplicationController < ApplicationController
# Render angular layout to handle CSS loading
# from the frontend
- layout 'angular'
+ layout 'angular/angular'
private
diff --git a/modules/reporting/app/controllers/cost_reports_controller.rb b/modules/reporting/app/controllers/cost_reports_controller.rb
index 3981a3d073c..f0184161880 100644
--- a/modules/reporting/app/controllers/cost_reports_controller.rb
+++ b/modules/reporting/app/controllers/cost_reports_controller.rb
@@ -65,7 +65,7 @@ class CostReportsController < ApplicationController
before_action :set_cost_types # has to be set AFTER the Report::Controller filters run
- layout 'angular'
+ layout 'angular/angular'
# Checks if custom fields have been updated, added or removed since we
# last saw them, to rebuild the filters and group bys.