diff --git a/config/locales/de.yml b/config/locales/de.yml index ad95e60290..6c22860746 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,77 +1,49 @@ -#-- copyright -# OpenProject Reporting Plugin -# -# Copyright (C) 2010 - 2014 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# version 3. -# -# 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. -#++ - ---- de: - button_save_as: "Speichern unter ..." - - comments: "Kommentar" - cost_reports_title: "Kostenauswertungen" - label_cost_report: "Kostenauswertung" - - description_drill_down: "Details anzeigen" - description_filter_selection: "Auswahl" - description_multi_select: "Mehrfachauswahl anzeigen" - description_remove_filter: "Filter entfernen" - - information_restricted_depending_on_permission: "Abhängig von Ihren Berechtigungen können die Informationen auf dieser Seite eingeschränkt sein." - - label_click_to_edit: "Zum Bearbeiten hier klicken." - label_closed: "Geschlossen" - label_columns: "Spalten" - label_cost_entry_attributes: "Attribute am Kosteneintrag" - label_days_ago: "in den letzten Tagen" - label_entry: "Kosteneintrag" - label_filter_text: "Filtertext" - label_filter_value: "Wert" - label_filters: "Filter" - label_greater: ">" - label_is_not_project_with_subprojects: "ist nicht (mit Unterprojekten)" - label_is_project_with_subprojects: "ist (mit Unterprojekten)" - label_work_package_attributes: "Attribute am Ticket" - label_less: "<" - label_money: "Geldwert" - label_month_reporting: "Monat der Buchung" - label_new_report: "Neue Kostenauswertung" - label_open: "Offen" - label_operator: "Operator" - label_private_report_plural: "Persönliche Kostenauswertungen" - label_progress_bar_explanation: "Kostenauswertung wird erstellt ..." - label_public_report_plural: "Gemeinsame Kostenauswertungen" - label_really_delete_question: "Diese Kostenauswertung wirklich löschen?" - label_rows: "Zeilen" - label_saving: "Speichern..." - label_spent_on_reporting: "Datum der Buchung" - label_sum: "Summe" - label_units: "Einheiten" - label_week_reporting: "Woche der Buchung" - label_year_reporting: "Jahr der Buchung" - load_query_question: "Die Kostenauswertung wird %{size} Tabellen-Zellen haben, was sehr rechenintensiv sein kann. Wollen Sie dennoch versuchen, die Kostenauswertung durch zu führen?" - - permission_save_cost_reports: "Speichern gemeinsamer Kostenauswertungen" - permission_save_private_cost_reports: "Speichern persönlicher Kostenauswertungen" - project_module_reporting_module: "Kostenauswertungen" - - text_costs_are_rounded_note: "Die angezeigten Werte sind gerundet. Alle Berechnungen basieren auf ungerundeten Werten." - toggle_multiselect: "Mehrfachauswahl aktivieren/deaktivieren" - - units: "Einheiten" - - validation_failure_date: "ist kein gültiges Datum" - validation_failure_integer: "ist keine ganze Zahl" + button_save_as: Speichern unter ... + comments: Kommentar + cost_reports_title: Kostenauswertungen + label_cost_report: Kostenauswertung + description_drill_down: Details anzeigen + description_filter_selection: Auswahl + description_multi_select: Mehrfachauswahl anzeigen + description_remove_filter: Filter entfernen + information_restricted_depending_on_permission: Abhängig von Ihren Berechtigungen können die Informationen auf dieser Seite eingeschränkt sein. + label_click_to_edit: Zum Bearbeiten hier klicken. + label_closed: Geschlossen + label_columns: Spalten + label_cost_entry_attributes: Attribute am Kosteneintrag + label_days_ago: in den letzten Tagen + label_entry: Kosteneintrag + label_filter_text: Filtertext + label_filter_value: Wert + label_filters: Filter + label_greater: '>' + label_is_not_project_with_subprojects: ist nicht (mit Unterprojekten) + label_is_project_with_subprojects: ist (mit Unterprojekten) + label_work_package_attributes: Attribute am Ticket + label_less: '<' + label_money: Geldwert + label_month_reporting: Monat der Buchung + label_new_report: Neue Kostenauswertung + label_open: Offen + label_operator: Operator + label_private_report_plural: Persönliche Kostenauswertungen + label_progress_bar_explanation: Kostenauswertung wird erstellt ... + label_public_report_plural: Gemeinsame Kostenauswertungen + label_really_delete_question: Diese Kostenauswertung wirklich löschen? + label_rows: Zeilen + label_saving: Speichern... + label_spent_on_reporting: Datum der Buchung + label_sum: Summe + label_units: Einheiten + label_week_reporting: Woche der Buchung + label_year_reporting: Jahr der Buchung + load_query_question: 'Die Kostenauswertung wird %{size} Tabellen-Zellen haben, was sehr rechenintensiv sein kann. Wollen Sie dennoch versuchen, die Kostenauswertung durch zu führen?' + permission_save_cost_reports: Speichern gemeinsamer Kostenauswertungen + permission_save_private_cost_reports: Speichern persönlicher Kostenauswertungen + project_module_reporting_module: Kostenauswertungen + text_costs_are_rounded_note: Die angezeigten Werte sind gerundet. Alle Berechnungen basieren auf ungerundeten Werten. + toggle_multiselect: Mehrfachauswahl aktivieren/deaktivieren + units: Einheiten + validation_failure_date: ist kein gültiges Datum + validation_failure_integer: ist keine ganze Zahl diff --git a/spec/features/menu_spec.rb b/spec/features/menu_spec.rb new file mode 100644 index 0000000000..61cefb8e38 --- /dev/null +++ b/spec/features/menu_spec.rb @@ -0,0 +1,119 @@ +#-- copyright +# OpenProject is a project management system. +# Copyright (C) 2012-2015 the OpenProject Foundation (OPF) +# +# 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 doc/COPYRIGHT.rdoc for more details. +#++ + +require 'spec_helper' + +describe 'project menu', type: :feature do + let(:current_user) { FactoryGirl.create :admin } + let!(:project) { FactoryGirl.create :valid_project, identifier: 'ponyo', name: 'Ponyo' } + + before do + allow(User).to receive(:current).and_return current_user + end + + ## + # Depending on the current page the link to the cost reports was broken. + # This seems to be due to a peculiarity of the rails routing where + # `url_for controller: :foo` would return a link relative to the controller + # handling the current request path if the controller was routed to via a + # namespaced route. + # + # Example: + # + # `url_for controller: 'cost_reports'` will yield different results ... + # + # when on `/projects/ponyo/work_packages`: `/projects/ponyo/cost_reports` (correct) + # when on `/projects/ponyo/work_packages/calendar`: `/work_packages/cost_reports?project_id=ponyo` + # + # This is only relevant for project menu entries, not global ones (`project_id` param is nil)*. + # Meaning that you have to make sure to force the absolute URL in a project menu entry + # by specificying the controller as e.g. '/cost_reports' instead of just 'cost_reports'. + # + # Refer to `engine.rb` to see where the menu entries are declared. + # + # * May apply to routes used with parameters in general. + describe '#18788 (cost reports not found (404)) regression test' do + describe 'link to project cost reports' do + shared_examples 'it leads to the project costs reports' do + before do + visit current_path + end + + it 'leads to cost reports' do + click_on 'Cost Reports' + + expect(page).to have_selector('.breadcrumb', text: 'HomePonyoCost Reports') + end + end + + context "when on the project's activity page" do + let(:current_path) { '/projects/ponyo/activity' } + + it_behaves_like 'it leads to the project costs reports' + end + + context "when on the project's calendar" do + let(:current_path) { '/projects/ponyo/work_packages/calendar' } + + it_behaves_like 'it leads to the project costs reports' + end + end + + describe 'link to global cost reports', js: true do + shared_examples 'it leads to the cost reports' do + before do + visit current_path + end + + it 'leads to cost reports' do + click_on 'Modules' + within '#more-menu ul' do + click_on 'Cost Reports' + end + + expect(page).to have_selector('.breadcrumb', text: 'Cost Reports') + + # to make sure we're not seeing the project cost reports: + expect(page).not_to have_text('Ponyo') + end + end + + context "when on the project's activity page" do + let(:current_path) { '/projects/ponyo/activity' } + + it_behaves_like 'it leads to the cost reports' + end + + context "when on the project's calendar" do + let(:current_path) { '/projects/ponyo/work_packages/calendar' } + + it_behaves_like 'it leads to the cost reports' + end + end + end +end