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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
use resouce based routing
ulfertsf89f19dffcfd
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rbindex c7fcd88a336..d426b30265a 100644--- a/app/controllers/categories_controller.rb+++ b/app/controllers/categories_controller.rb@@ -48,7 +48,7 @@ class CategoriesController < ApplicationControllerrespond_to do |format|format.html doflash[:notice] = I18n.t(:notice_successful_create)- redirect_to categories_settings_project_path(@project)+ redirect_to project_settings_categories_path(@project)endformat.js dorender locals: { project: @project, category: @category }@@ -70,7 +70,7 @@ class CategoriesController < ApplicationController@category.attributes = permitted_params.categoryif @category.saveflash[:notice] = I18n.t(:notice_successful_update)- redirect_to categories_settings_project_path(@project)+ redirect_to project_settings_categories_path(@project)elserender action: 'edit'end@@ -81,12 +81,12 @@ class CategoriesController < ApplicationControllerif @issue_count == 0# No issue assigned to this category@category.destroy- redirect_to categories_settings_project_path(@project)+ redirect_to project_settings_categories_path(@project)returnelsif params[:todo]reassign_to = @project.categories.find_by(id: params[:reassign_to_id]) if params[:todo] == 'reassign'@category.destroy(reassign_to)- redirect_to categories_settings_project_path(@project)+ redirect_to project_settings_categories_path(@project)returnend@categories = @project.categories - [@category]diff --git a/app/controllers/project_settings_controller.rb b/app/controllers/project_settings_controller.rbindex de71c84cd8a..0a8e7a637b5 100644--- a/app/controllers/project_settings_controller.rb+++ b/app/controllers/project_settings_controller.rb@@ -29,7 +29,7 @@#++class ProjectSettingsController < ApplicationController- before_action :find_project+ before_action :find_project_by_project_idbefore_action :authorizedef show; enddiff --git a/app/controllers/projects/settings/custom_fields_controller.rb b/app/controllers/projects/settings/custom_fields_controller.rbindex 47a565b5851..94b9d467ecc 100644--- a/app/controllers/projects/settings/custom_fields_controller.rb+++ b/app/controllers/projects/settings/custom_fields_controller.rb@@ -46,7 +46,7 @@ class Projects::Settings::CustomFieldsController < ProjectSettingsControllerendend- redirect_to custom_fields_settings_project_path(@project)+ redirect_to project_settings_custom_fields_path(@project)endprivatediff --git a/app/controllers/projects/settings/modules_controller.rb b/app/controllers/projects/settings/modules_controller.rbindex f8cae5f0793..c45dd1eaedd 100644--- a/app/controllers/projects/settings/modules_controller.rb+++ b/app/controllers/projects/settings/modules_controller.rb@@ -39,7 +39,7 @@ class Projects::Settings::ModulesController < ProjectSettingsControllerif call.success?flash[:notice] = I18n.t(:notice_successful_update)- redirect_to modules_settings_project_path(@project)+ redirect_to project_settings_modules_path(@project)else@errors = call.errorsrender 'show'diff --git a/app/controllers/projects/settings/types_controller.rb b/app/controllers/projects/settings/types_controller.rbindex 90a6ae4e4ca..5edeb55296d 100644--- a/app/controllers/projects/settings/types_controller.rb+++ b/app/controllers/projects/settings/types_controller.rb@@ -42,6 +42,6 @@ class Projects::Settings::TypesController < ProjectSettingsControllerflash[:error] = @project.errors.full_messagesend- redirect_to types_settings_project_path(@project.identifier)+ redirect_to project_settings_types_path(@project.identifier)endenddiff --git a/app/controllers/projects/templated_controller.rb b/app/controllers/projects/templated_controller.rbindex 8c286557a2d..ef8a2cced34 100644--- a/app/controllers/projects/templated_controller.rb+++ b/app/controllers/projects/templated_controller.rb@@ -29,7 +29,7 @@#++class Projects::TemplatedController < ApplicationController- before_action :find_project+ before_action :find_project_by_project_idbefore_action :authorizedef create@@ -50,7 +50,7 @@ class Projects::TemplatedController < ApplicationControllerif service_call.success?flash[:notice] = t(:notice_successful_update)- redirect_to general_settings_project_path(@project)+ redirect_to project_settings_general_path(@project)else@errors = service_call.errorsrender template: 'projects/settings/general'diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rbindex 515e6170693..5dff8b311d8 100644--- a/app/controllers/projects_controller.rb+++ b/app/controllers/projects_controller.rb@@ -77,7 +77,7 @@ class ProjectsController < ApplicationControllerif service_call.success?flash[:notice] = I18n.t(:notice_successful_update)- redirect_to general_settings_project_path(@project)+ redirect_to project_settings_general_path(@project)elserender action: 'identifier'enddiff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rbindex 9cbd87f99e7..fa54b815e61 100644--- a/app/controllers/repositories_controller.rb+++ b/app/controllers/repositories_controller.rb@@ -58,7 +58,7 @@ class RepositoriesController < ApplicationController@repository = @project.repositoryupdate_repository(params.fetch(:repository, {}))- redirect_to repository_settings_project_path(@project)+ redirect_to project_settings_repository_path(@project)enddef create@@ -71,7 +71,7 @@ class RepositoriesController < ApplicationControllerflash[:error] = service.build_errorend- redirect_to repository_settings_project_path(@project)+ redirect_to project_settings_repository_path(@project)enddef committers@@ -95,7 +95,7 @@ class RepositoriesController < ApplicationControllerdef destroy_info@repository = @project.repository- repository_settings_project_path(@project)+ project_settings_repository_path(@project)enddef destroy@@ -105,7 +105,7 @@ class RepositoriesController < ApplicationControllerelseflash[:error] = repository.errors.full_messagesend- redirect_to repository_settings_project_path(@project)+ redirect_to project_settings_repository_path(@project)enddef showdiff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rbindex 01711fd5e88..a4d331018b6 100644--- a/app/controllers/versions_controller.rb+++ b/app/controllers/versions_controller.rb@@ -97,7 +97,7 @@ class VersionsController < ApplicationControllerif request.put?@project.close_completed_versionsend- redirect_to versions_settings_project_path(@project)+ redirect_to project_settings_versions_path(@project)enddef destroy@@ -110,13 +110,13 @@ class VersionsController < ApplicationControllerflash[:error] = call.errors.full_messagesend- redirect_to versions_settings_project_path(@project)+ redirect_to project_settings_versions_path(@project)endprivatedef redirect_back_or_version_settings- redirect_back_or_default(versions_settings_project_path(@project))+ redirect_back_or_default(project_settings_versions_path(@project))enddef find_projectdiff --git a/app/helpers/project_settings_helper.rb b/app/helpers/project_settings_helper.rbdeleted file mode 100644index b1c29d9e5a4..00000000000--- a/app/helpers/project_settings_helper.rb+++ /dev/null@@ -1,88 +0,0 @@-#-- encoding: UTF-8--#-- 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 COPYRIGHT and LICENSE files for more details.-#++--module ProjectSettingsHelper- extend self- def project_settings_tabs- [- {- name: 'general',- action: { controller: '/projects/settings/general', action: 'show' },- label: :label_information_plural- },- {- name: 'modules',- action: { controller: '/projects/settings/modules', action: 'show' },- label: :label_module_plural- },- {- name: 'types',- action: { controller: '/projects/settings/types', action: 'show' },- label: :label_work_package_types- },- {- name: 'custom_fields',- action: { controller: '/projects/settings/custom_fields', action: 'show' },- label: :label_custom_field_plural- },- {- name: 'versions',- action: { controller: '/projects/settings/versions', action: 'show' },- label: :label_version_plural- },- {- name: 'categories',- action: { controller: '/projects/settings/categories', action: 'show' },- label: :label_work_package_category_plural,- last: true- },- {- name: 'repository',- action: { controller: '/projects/settings/repository', action: 'show' },- label: :label_repository- },- {- name: 'time_entry_activities',- action: { controller: '/projects/settings/time_entry_activities', action: 'show' },- label: :enumeration_activities- },- {- name: :backlogs,- action: { controller: '/projects/settings/backlogs', action: 'show' },- label: :label_backlogs,- },- {- name: 'storage',- action: { controller: '/projects/settings/storage', action: 'show' },- label: :label_required_disk_storage- }- ]- end-enddiff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rbindex b6590244b91..f5edca5ffe7 100644--- a/app/helpers/projects_helper.rb+++ b/app/helpers/projects_helper.rb@@ -87,7 +87,7 @@ module ProjectsHelperdef project_more_menu_settings_item(project)if User.current.allowed_to?({ controller: '/projects/settings/general', action: 'show' }, project)[t(:label_project_settings),- general_settings_project_path(project),+ project_settings_general_path(project),{ class: 'icon-context icon-settings',title: t(:label_project_settings) }]enddiff --git a/app/views/projects/_toolbar.html.erb b/app/views/projects/_toolbar.html.erbindex 1e72290c867..d5224b1ff0a 100644--- a/app/views/projects/_toolbar.html.erb+++ b/app/views/projects/_toolbar.html.erb@@ -66,7 +66,7 @@ See COPYRIGHT and LICENSE files for more details.</li><li class="toolbar-item hidden-for-mobile"><% label = @project.templated ? 'remove_from_templates' : 'make_template' %>- <%= link_to(templated_project_path(@project),+ <%= link_to(project_templated_path(@project),method: @project.templated ? :delete : :post,title: t("project.template.#{label}"),class: 'button') do %>diff --git a/app/views/projects/identifier.html.erb b/app/views/projects/identifier.html.erbindex a2e5b72b5ab..c5668f08be7 100644--- a/app/views/projects/identifier.html.erb+++ b/app/views/projects/identifier.html.erb@@ -50,7 +50,7 @@ See COPYRIGHT and LICENSE files for more details.<%= f.submit t(:button_update), class: 'button -highlight -with-icon icon-checkmark' %></span><span>- <%= link_to general_settings_project_path(@project), class: 'button' do %>+ <%= link_to project_settings_general_path(@project), class: 'button' do %><%= op_icon('button--icon icon-cancel') %><span class="button--text"><%= t(:button_cancel) %></span><% end %>diff --git a/app/views/projects/settings/custom_fields/show.html.erb b/app/views/projects/settings/custom_fields/show.html.erbindex fc386e45755..5095637b729 100644--- a/app/views/projects/settings/custom_fields/show.html.erb+++ b/app/views/projects/settings/custom_fields/show.html.erb@@ -45,7 +45,7 @@ See COPYRIGHT and LICENSE files for more details.<% if @wp_custom_fields.any? %><%= labelled_tabular_form_for @project,- url: custom_fields_settings_project_path(@project),+ url: project_settings_custom_fields_path(@project),html: { id: 'modules-form' } do |form| %><%= render partial: 'form',diff --git a/app/views/projects/settings/modules/show.html.erb b/app/views/projects/settings/modules/show.html.erbindex 820e54bf03e..dfb13a44076 100644--- a/app/views/projects/settings/modules/show.html.erb+++ b/app/views/projects/settings/modules/show.html.erb@@ -34,7 +34,7 @@ See COPYRIGHT and LICENSE files for more details.<%= error_messages_for_contract(@project, @errors) %><%= labelled_tabular_form_for @project,- url: modules_settings_project_path(@project) do |form| %>+ url: project_settings_modules_path(@project) do |form| %><%= render partial: "form",locals: { form: form } %>diff --git a/app/views/projects/settings/types/show.html.erb b/app/views/projects/settings/types/show.html.erbindex d138a4aeab9..20dee72b751 100644--- a/app/views/projects/settings/types/show.html.erb+++ b/app/views/projects/settings/types/show.html.erb@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.<% if Type.any? %><%= form_for @project,- url: types_settings_project_path(@project),+ url: project_settings_types_path(@project),method: :patch,html: { id: 'types-form' } do |f| %><%= render partial: 'form',diff --git a/app/views/repositories/_repository_header.html.erb b/app/views/repositories/_repository_header.html.erbindex 214b360e6b6..97eed2d45b6 100644--- a/app/views/repositories/_repository_header.html.erb+++ b/app/views/repositories/_repository_header.html.erb@@ -73,7 +73,7 @@ See COPYRIGHT and LICENSE files for more details.{ repository: @repository, project: @project, repository_empty: empty }) %><% if User.current.allowed_to?(:manage_repository, @project) %><li class="toolbar-item -icon-only">- <%= link_to repository_settings_project_path(@project),+ <%= link_to project_settings_repository_path(@project),class: 'button', title: t(:label_setting_plural) do %><%= op_icon('button--icon icon-settings') %><% end %>diff --git a/app/views/repositories/committers.html.erb b/app/views/repositories/committers.html.erbindex 75f25b761af..f85ef11fd79 100644--- a/app/views/repositories/committers.html.erb+++ b/app/views/repositories/committers.html.erb@@ -81,7 +81,7 @@ See COPYRIGHT and LICENSE files for more details.<hr class="form--separator" /><p><%= submit_tag t(:button_update), class: 'button -highlight' %>- <%= link_to repository_settings_project_path(@project.id), class: 'button' do %>+ <%= link_to project_settings_repository_path(@project.id), class: 'button' do %><span class="button--text"><%= t(:button_cancel) %></span><% end %></p>diff --git a/app/views/repositories/destroy_info.html.erb b/app/views/repositories/destroy_info.html.erbindex 01f193c0da7..72ea284de83 100644--- a/app/views/repositories/destroy_info.html.erb+++ b/app/views/repositories/destroy_info.html.erb@@ -55,7 +55,7 @@ See COPYRIGHT and LICENSE files for more details.<%= op_icon('button--icon icon-delete') %><span class="button--text"><%= t(:button_delete) %></span><% end %>- <%= link_to repository_settings_project_path(@project),+ <%= link_to project_settings_repository_path(@project),title: t(:button_cancel),class: 'button -with-icon icon-cancel' do %><%= t(:button_cancel) %>@@ -84,7 +84,7 @@ See COPYRIGHT and LICENSE files for more details.<%= op_icon('button--icon icon-remove') %><span class="button--text"><%= t(:button_remove) %></span><% end %>- <%= link_to repository_settings_project_path(@project),+ <%= link_to project_settings_repository_path(@project),title: t(:button_cancel),class: 'button -with-icon icon-cancel' do %><%= t(:button_cancel) %>diff --git a/config/initializers/menus.rb b/config/initializers/menus.rbindex 94384bcf673..bf83fc577eb 100644--- a/config/initializers/menus.rb+++ b/config/initializers/menus.rb@@ -480,12 +480,20 @@ Redmine::MenuManager.map :project_menu do |menu|icon: 'icon2 icon-settings2',allow_deeplink: true- ProjectSettingsHelper.project_settings_tabs.each do |node|- menu.push :"settings_#{node[:name]}",- node[:action],- caption: node[:label],- parent: :settings,- last: node[:last],- if: node[:if]+ {+ general: :label_information_plural,+ modules: :label_module_plural,+ types: :label_work_package_types,+ custom_fields: :label_custom_field_plural,+ versions: :label_version_plural,+ categories: :label_work_package_category_plural,+ repository: :label_repository,+ time_entry_activities: :enumeration_activities,+ storage: :label_required_disk_storage+ }.each do |key, caption|+ menu.push :"settings_#{key}",+ { controller: "/projects/settings/#{key}", action: 'show' },+ caption: caption,+ parent: :settingsendenddiff --git a/config/routes.rb b/config/routes.rbindex e4c049f9094..f45553716f6 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -176,25 +176,22 @@ OpenProject::Application.routes.draw doendresources :projects, except: %i[show edit create update] do- member do- scope module: 'projects' do- post :templated, controller: 'templated', action: :create- delete :templated, controller: 'templated', action: :destroy-- namespace 'settings' do- ProjectSettingsHelper- .project_settings_tabs- .each do |tab|- get tab[:name],- controller: tab[:name],- action: :show- patch tab[:name],- controller: tab[:name],- action: :update- end- end+ scope module: 'projects' do+ namespace 'settings' do+ resource :general, only: %i[show], controller: 'general'+ resource :modules, only: %i[show update]+ resource :types, only: %i[show update]+ resource :custom_fields, only: %i[show update]+ resource :repository, only: %i[show], controller: 'repository'+ resource :versions, only: %i[show]+ resource :categories, only: %i[show update]+ resource :storage, only: %i[show], controller: 'storage'end+ resource :templated, only: %i[create destroy], controller: 'templated'+ end++ member doget "settings", to: redirect('projects/%{id}/settings/general/') # rubocop:disable Style/FormatStringTokenget 'identifier', action: 'identifier'diff --git a/lib/api/v3/work_packages/create_form_representer.rb b/lib/api/v3/work_packages/create_form_representer.rbindex 54ba13ddba0..6f15dc74f89 100644--- a/lib/api/v3/work_packages/create_form_representer.rb+++ b/lib/api/v3/work_packages/create_form_representer.rb@@ -72,7 +72,7 @@ module APIcurrent_user_allowed_to(:edit_project,context: represented.project)){- href: custom_fields_settings_project_path(represented.project.identifier),+ href: project_settings_custom_fields_path(represented.project.identifier),type: 'text/html',title: I18n.t('label_custom_field_plural')}diff --git a/lib/api/v3/work_packages/create_project_form_representer.rb b/lib/api/v3/work_packages/create_project_form_representer.rbindex 521d303670b..5fb81dd5589 100644--- a/lib/api/v3/work_packages/create_project_form_representer.rb+++ b/lib/api/v3/work_packages/create_project_form_representer.rb@@ -69,7 +69,7 @@ module APIcurrent_user_allowed_to(:edit_project,context: represented.project){- href: custom_fields_settings_project_path(represented.project.identifier),+ href: project_settings_custom_fields_path(represented.project.identifier),type: 'text/html',title: I18n.t('label_custom_field_plural')}diff --git a/lib/api/v3/work_packages/work_package_collection_representer.rb b/lib/api/v3/work_packages/work_package_collection_representer.rbindex 269e9576070..e3832fa112d 100644--- a/lib/api/v3/work_packages/work_package_collection_representer.rb+++ b/lib/api/v3/work_packages/work_package_collection_representer.rb@@ -115,7 +115,7 @@ module APIif project.present? &&(current_user.try(:admin?) || current_user_allowed_to(:edit_project, context: project)){- href: custom_fields_settings_project_path(project.identifier),+ href: project_settings_custom_fields_path(project.identifier),type: 'text/html',title: I18n.t('label_custom_field_plural')}diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rbindex 39b4564d581..7263f35c910 100644--- a/lib/api/v3/work_packages/work_package_representer.rb+++ b/lib/api/v3/work_packages/work_package_representer.rb@@ -147,7 +147,7 @@ module APInext if represented.project.nil?{- href: custom_fields_settings_project_path(represented.project.identifier),+ href: project_settings_custom_fields_path(represented.project.identifier),type: 'text/html',title: "Custom fields"}diff --git a/modules/backlogs/app/controllers/projects/settings/backlogs_controller.rb b/modules/backlogs/app/controllers/projects/settings/backlogs_controller.rbindex 48b97838577..95a14a7c8c7 100644--- a/modules/backlogs/app/controllers/projects/settings/backlogs_controller.rb+++ b/modules/backlogs/app/controllers/projects/settings/backlogs_controller.rb@@ -64,7 +64,7 @@ class Projects::Settings::BacklogsController < ProjectSettingsControllerprivatedef redirect_to_backlogs_settings- redirect_to backlogs_settings_project_path(@project)+ redirect_to project_settings_backlogs_path(@project)enddef log_rebuild_position_errordiff --git a/modules/backlogs/app/views/projects/settings/backlogs/show.html.erb b/modules/backlogs/app/views/projects/settings/backlogs/show.html.erbindex 905f00e75b6..c6722254978 100644--- a/modules/backlogs/app/views/projects/settings/backlogs/show.html.erb+++ b/modules/backlogs/app/views/projects/settings/backlogs/show.html.erb@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.<%= render partial: 'projects/settings/form_toolbar', locals: { form_name: "edit_project_#{@project.id}" } %><% end %>-<%= styled_form_tag(backlogs_settings_project_path(@project),+<%= styled_form_tag(project_settings_backlogs_path(@project),method: :patch,id: "edit_project_#{@project.id}") do %>diff --git a/modules/backlogs/config/routes.rb b/modules/backlogs/config/routes.rbindex 235403eb63c..3b14907345c 100644--- a/modules/backlogs/config/routes.rb+++ b/modules/backlogs/config/routes.rb@@ -55,8 +55,17 @@ OpenProject::Application.routes.draw doendend+ scope 'projects/:project_id', as: 'project', module: 'projects' do+ namespace 'settings' do+ resource :backlogs, only: %i[show update] do+ member do+ post 'rebuild_positions' => 'backlogs#rebuild_positions'+ end+ end+ end+ end+get 'projects/:project_id/versions/:id/edit' => 'version_settings#edit'- post 'projects/:id/settings/rebuild_positions' => 'projects/settings/backlogs#rebuild_positions'scope 'admin' doresource :backlogs,diff --git a/modules/backlogs/lib/open_project/backlogs/engine.rb b/modules/backlogs/lib/open_project/backlogs/engine.rbindex d8e7b53a01f..e097ecb7527 100644--- a/modules/backlogs/lib/open_project/backlogs/engine.rb+++ b/modules/backlogs/lib/open_project/backlogs/engine.rb@@ -97,7 +97,7 @@ module OpenProject::Backlogspermission :update_sprints,{rb_sprints: %i[edit update],- rb_wikis: %i[edit update],+ rb_wikis: %i[edit update]},require: :memberend@@ -109,6 +109,13 @@ module OpenProject::Backlogsbefore: :calendar,param: :project_id,icon: 'icon2 icon-backlogs'++ menu :project_menu,+ :settings_backlogs,+ { controller: '/projects/settings/backlogs', action: :show },+ caption: :label_backlogs,+ parent: :settings,+ before: :settings_storageend# We still override version and project settings views from the core! URHdiff --git a/modules/backlogs/spec/controllers/versions_controller_spec.rb b/modules/backlogs/spec/controllers/versions_controller_spec.rbindex 36a0a48fc0f..d6304866e93 100644--- a/modules/backlogs/spec/controllers/versions_controller_spec.rb+++ b/modules/backlogs/spec/controllers/versions_controller_spec.rb@@ -70,7 +70,7 @@ describe VersionsController, type: :controller dopatch 'update', params: @paramsversion.reload- expect(response).to redirect_to versions_settings_project_path(other_project)+ expect(response).to redirect_to project_settings_versions_path(other_project)expect(version.name).to eq(@oldVersionName)end@@ -79,7 +79,7 @@ describe VersionsController, type: :controller dopatch 'update', params: @paramsversion.reload- expect(response).to redirect_to versions_settings_project_path(version.project)+ expect(response).to redirect_to project_settings_versions_path(version.project)expect(version.name).to eq(@newVersionName)endenddiff --git a/modules/boards/spec/features/action_boards/version_board_spec.rb b/modules/boards/spec/features/action_boards/version_board_spec.rbindex 43ac104303c..75256d5f8d8 100644--- a/modules/boards/spec/features/action_boards/version_board_spec.rb+++ b/modules/boards/spec/features/action_boards/version_board_spec.rb@@ -228,7 +228,7 @@ describe 'Version action board', type: :feature, js: true doboard_page.add_list_with_new_value 'Completely new version'board_page.expect_list 'Completely new version'- visit versions_settings_project_path(project)+ visit project_settings_versions_path(project)expect(page).to have_content 'Completely new version'expect(page).to have_content 'Closed version'diff --git a/modules/costs/app/controllers/projects/settings/time_entry_activities_controller.rb b/modules/costs/app/controllers/projects/settings/time_entry_activities_controller.rbindex e9c536e15cc..72ad86b2da0 100644--- a/modules/costs/app/controllers/projects/settings/time_entry_activities_controller.rb+++ b/modules/costs/app/controllers/projects/settings/time_entry_activities_controller.rb@@ -35,7 +35,7 @@ class Projects::Settings::TimeEntryActivitiesController < ProjectSettingsControlTimeEntryActivitiesProject.upsert_all(update_params, unique_by: %i[project_id activity_id])flash[:notice] = t(:notice_successful_update)- redirect_to time_entry_activities_settings_project_path(@project)+ redirect_to project_settings_time_entry_activities_path(@project)endprivatediff --git a/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb b/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erbindex 58f97788b6d..1d9ead44dc7 100644--- a/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb+++ b/modules/costs/app/views/projects/settings/time_entry_activities/show.html.erb@@ -32,7 +32,7 @@ See COPYRIGHT and LICENSE files for more details.<% if TimeEntryActivity.any? %><%= labelled_tabular_form_for @project,- url: time_entry_activities_settings_project_path(@project) do %>+ url: project_settings_time_entry_activities_path(@project) do %><%= render partial: '/projects/settings/time_entry_activities/activities',locals: { project: @project } %>diff --git a/modules/costs/config/routes.rb b/modules/costs/config/routes.rbindex 7dfdbb2b9e8..70e88af915e 100644--- a/modules/costs/config/routes.rb+++ b/modules/costs/config/routes.rb@@ -35,6 +35,12 @@ OpenProject::Application.routes.draw doendend+ scope 'projects/:project_id', as: 'project', module: 'projects' do+ namespace 'settings' do+ resource :time_entry_activities, only: %i[show update]+ end+ end+scope 'work_packages/:work_package_id', as: 'work_packages' doresources :cost_entries, controller: 'costlog', only: %i[new]enddiff --git a/modules/costs/spec/features/time_entry/activity_spec.rb b/modules/costs/spec/features/time_entry/activity_spec.rbindex 1734376a5cb..addb7b76b50 100644--- a/modules/costs/spec/features/time_entry/activity_spec.rb+++ b/modules/costs/spec/features/time_entry/activity_spec.rb@@ -50,7 +50,7 @@ describe 'Time entry activity', type: :feature doexpect(page).to have_content('A new activity')- visit general_settings_project_path(project)+ visit project_settings_general_path(project)click_on "Time tracking activities"diff --git a/spec/controllers/versions_controller_spec.rb b/spec/controllers/versions_controller_spec.rbindex 564fe8fd6a2..4574d3dc4c2 100644--- a/spec/controllers/versions_controller_spec.rb+++ b/spec/controllers/versions_controller_spec.rb@@ -197,7 +197,7 @@ describe VersionsController, type: :controller dopost :create, params: { project_id: project.id, version: { name: 'test_add_version' } }end- it { expect(response).to redirect_to(versions_settings_project_path(project)) }+ it { expect(response).to redirect_to(project_settings_versions_path(project)) }it 'generates the new version' doversion = Version.find_by(name: 'test_add_version')@@ -231,7 +231,7 @@ describe VersionsController, type: :controller doput :close_completed, params: { project_id: project.id }end- it { expect(response).to redirect_to(versions_settings_project_path(project)) }+ it { expect(response).to redirect_to(project_settings_versions_path(project)) }it { expect(Version.find_by(status: 'closed')).to eq(version3) }end@@ -251,7 +251,7 @@ describe VersionsController, type: :controller dopatch :update, params: paramsend- it { expect(response).to redirect_to(versions_settings_project_path(project)) }+ it { expect(response).to redirect_to(project_settings_versions_path(project)) }it { expect(Version.find_by(name: 'New version name')).to eq(version1) }it { expect(version1.reload.effective_date).to eq(Date.today) }end@@ -297,7 +297,7 @@ describe VersionsController, type: :controller doendit 'redirects to projects versions and the version is deleted' do- expect(response).to redirect_to(versions_settings_project_path(project))+ expect(response).to redirect_to(project_settings_versions_path(project))expect { Version.find(@deleted) }.to raise_error ActiveRecord::RecordNotFoundendenddiff --git a/spec/features/categories/categories_page.rb b/spec/features/categories/categories_page.rbindex 7cfb7b2698e..584b9c3eb7a 100644--- a/spec/features/categories/categories_page.rb+++ b/spec/features/categories/categories_page.rb@@ -35,6 +35,6 @@ class CategoriesPageenddef visit_settings- visit(categories_settings_project_path(@project))+ visit(project_settings_categories_path(@project))endenddiff --git a/spec/features/global_roles/no_module_spec.rb b/spec/features/global_roles/no_module_spec.rbindex b4bb7c5d4f0..81458778ea4 100644--- a/spec/features/global_roles/no_module_spec.rb+++ b/spec/features/global_roles/no_module_spec.rb@@ -49,7 +49,7 @@ describe 'Global role: No module', type: :feature, js: true do# And I am already admin# When I go to the modules tab of the settings page for the project "test"# Then I should not see "Global"- visit modules_settings_project_path(project)+ visit project_settings_modules_path(project)expect(page).to have_text 'Activity'expect(page).to have_no_text 'Foo'diff --git a/spec/features/menu_items/menu_permissions_spec.rb b/spec/features/menu_items/menu_permissions_spec.rbindex d138c2469f7..0485b9914cb 100644--- a/spec/features/menu_items/menu_permissions_spec.rb+++ b/spec/features/menu_items/menu_permissions_spec.rb@@ -43,7 +43,7 @@ describe 'menu permissions', type: :feature, js: true dologin_as(admin)# Allowed to see the settings version page- visit versions_settings_project_path(project)+ visit project_settings_versions_path(project)endit 'I can see all menu entries' do@@ -67,7 +67,7 @@ describe 'menu permissions', type: :feature, js: true dologin_as(user)# Allowed to see the settings version page- visit versions_settings_project_path(project)+ visit project_settings_versions_path(project)endit 'I can only see the version settings page' do@@ -82,7 +82,7 @@ describe 'menu permissions', type: :feature, js: true do# Clicking the menu parent item leads to the version pagefind('.main-menu--parent-node', text: 'Project settings').click- expect(page).to have_current_path(versions_settings_project_path(project))+ expect(page).to have_current_path(project_settings_versions_path(project))endendenddiff --git a/spec/features/projects/edit_settings_spec.rb b/spec/features/projects/edit_settings_spec.rbindex fc52c159061..fac79775887 100644--- a/spec/features/projects/edit_settings_spec.rb+++ b/spec/features/projects/edit_settings_spec.rb@@ -44,7 +44,7 @@ describe 'Projects', 'editing settings', type: :feature, js: true doendit 'hides the field whose functionality is presented otherwise' do- visit general_settings_project_path(project.id)+ visit project_settings_general_path(project.id)expect(page).to have_no_text :all, 'Active'expect(page).to have_no_text :all, 'Identifier'@@ -99,7 +99,7 @@ describe 'Projects', 'editing settings', type: :feature, js: true doproject.custom_field_values.last.value = 'FOO'project.save!- visit general_settings_project_path(project.id)+ visit project_settings_general_path(project.id)expect(page).to have_text 'Optional Foo'expect(page).to have_text 'Required Foo'@@ -118,7 +118,7 @@ describe 'Projects', 'editing settings', type: :feature, js: true dolet(:foo_field) { ::FormFields::InputFormField.new required_custom_field }it 'shows the errors of that field when saving (Regression #33766)' do- visit general_settings_project_path(project.id)+ visit project_settings_general_path(project.id)expect(page).to have_content 'Foo'@@ -141,7 +141,7 @@ describe 'Projects', 'editing settings', type: :feature, js: true dolet(:form_field) { ::FormFields::SelectFormField.new list_custom_field }it 'can select multiple values' do- visit general_settings_project_path(project.id)+ visit project_settings_general_path(project.id)form_field.select_option 'A', 'B'@@ -162,7 +162,7 @@ describe 'Projects', 'editing settings', type: :feature, js: true dolet(:form_field) { ::FormFields::InputFormField.new date_custom_field }it 'can save and remove the date (Regression #37459)' do- visit general_settings_project_path(project.id)+ visit project_settings_general_path(project.id)form_field.set_value '2021-05-26'form_field.send_keys :escape@@ -189,7 +189,7 @@ describe 'Projects', 'editing settings', type: :feature, js: true doendit 'can update the project without destroying the relation to the parent' do- visit general_settings_project_path(project.id)+ visit project_settings_general_path(project.id)fill_in 'Name', with: 'New project name'diff --git a/spec/features/projects/project_status_administration_spec.rb b/spec/features/projects/project_status_administration_spec.rbindex 374f221ba3b..99c047361ff 100644--- a/spec/features/projects/project_status_administration_spec.rb+++ b/spec/features/projects/project_status_administration_spec.rb@@ -73,7 +73,7 @@ describe 'Projects status administration', type: :feature, js: true doexpect(page).to have_current_path /projects\/new-project\/?/# Check that the status has been set correctly- visit general_settings_project_path(id: 'new-project')+ visit project_settings_general_path(id: 'new-project')status_field.expect_selected 'ON TRACK'status_description.expect_value 'Everything is fine at the start'diff --git a/spec/features/projects/projects_custom_fields_spec.rb b/spec/features/projects/projects_custom_fields_spec.rbindex 880021ad22a..146bf8be6a8 100644--- a/spec/features/projects/projects_custom_fields_spec.rb+++ b/spec/features/projects/projects_custom_fields_spec.rb@@ -92,7 +92,7 @@ describe 'Projects custom fields', type: :feature, js: true doexpect(page).to have_current_path /\/projects\/my-project-name\/?/created_project = Project.last- visit general_settings_project_path(created_project)+ visit project_settings_general_path(created_project)default_int_field.expect_value default_int_custom_field.default_value.to_sdefault_string_field.expect_value 'Overwritten'@@ -107,7 +107,7 @@ describe 'Projects custom fields', type: :feature, js: true dolet(:editor) { ::Components::WysiwygEditor.new "[data-qa-field-name='customField#{custom_field.id}']" }scenario 'allows settings the project boolean CF (regression #26313)' do- visit general_settings_project_path(project.id)+ visit project_settings_general_path(project.id)# expect CF, description and status description ckeditor-augmented-textareaexpect(page).to have_selector('.op-ckeditor--wrapper', count: 3)@@ -156,7 +156,7 @@ describe 'Projects custom fields', type: :feature, js: true docv = project.custom_values.find_by(custom_field_id: float_cf.id).typed_valueexpect(cv).to eq 10000.55- visit general_settings_project_path(project)+ visit project_settings_general_path(project)float_field.expect_value '10000.55'endend@@ -181,7 +181,7 @@ describe 'Projects custom fields', type: :feature, js: true docv = project.custom_values.find_by(custom_field_id: float_cf.id).typed_valueexpect(cv).to eq 10000.55- visit general_settings_project_path(project)+ visit project_settings_general_path(project)# The field renders in german locale, but there's no way to test that# as the internal value is always english localefloat_field.expect_value '10000.55'@@ -195,7 +195,7 @@ describe 'Projects custom fields', type: :feature, js: true doendscenario 'allows settings the project boolean CF (regression #26313)' do- visit general_settings_project_path(project.id)+ visit project_settings_general_path(project.id)field = page.find(identifier)expect(field).not_to be_checkeddiff --git a/spec/features/projects/subproject_creation_spec.rb b/spec/features/projects/subproject_creation_spec.rbindex cb875e24cd6..1fcb038c866 100644--- a/spec/features/projects/subproject_creation_spec.rb+++ b/spec/features/projects/subproject_creation_spec.rb@@ -49,7 +49,7 @@ describe 'Subproject creation', type: :feature, js: true doendbefore do- visit general_settings_project_path(parent_project)+ visit project_settings_general_path(parent_project)endit 'can create a subproject' dodiff --git a/spec/features/projects/template_spec.rb b/spec/features/projects/template_spec.rbindex e8b3a21fe99..7620ac51ccb 100644--- a/spec/features/projects/template_spec.rb+++ b/spec/features/projects/template_spec.rb@@ -38,7 +38,7 @@ describe 'Project templates', type: :feature, js: true doendit 'can make the project a template from settings' do- visit general_settings_project_path(project)+ visit project_settings_general_path(project)# Make a templatefind('.button', text: 'Set as template').clickdiff --git a/spec/features/repositories/repository_settings_page.rb b/spec/features/repositories/repository_settings_page.rbindex dae55fad655..4c695826cf1 100644--- a/spec/features/repositories/repository_settings_page.rb+++ b/spec/features/repositories/repository_settings_page.rb@@ -35,6 +35,6 @@ class RepositorySettingsPageenddef visit_repository_settings- visit repository_settings_project_path(@project.id)+ visit project_settings_repository_path(@project.id)endenddiff --git a/spec/features/versions/create_spec.rb b/spec/features/versions/create_spec.rbindex 5819bc749e8..a64488756b6 100644--- a/spec/features/versions/create_spec.rb+++ b/spec/features/versions/create_spec.rb@@ -48,7 +48,7 @@ describe 'version create', type: :feature, js: false dofill_in 'Name', with: new_version_nameclick_on 'Create'- expect(page).to have_current_path(versions_settings_project_path(project))+ expect(page).to have_current_path(project_settings_versions_path(project))expect(page).to have_content new_version_nameenddiff --git a/spec/features/versions/project_settings_index_spec.rb b/spec/features/versions/project_settings_index_spec.rbindex 740bc62d602..0952aa6501d 100644--- a/spec/features/versions/project_settings_index_spec.rb+++ b/spec/features/versions/project_settings_index_spec.rb@@ -48,7 +48,7 @@ feature 'project settings index', type: :feature do@javascriptscenario 'see versions listed in semver order' do- visit versions_settings_project_path(project)+ visit project_settings_versions_path(project)names_in_order = page.all('.version .name').map { |el| el.text.strip }diff --git a/spec/features/wiki/adding_editing_history_spec.rb b/spec/features/wiki/adding_editing_history_spec.rbindex 09087bdc21e..b0ad5927e70 100644--- a/spec/features/wiki/adding_editing_history_spec.rb+++ b/spec/features/wiki/adding_editing_history_spec.rb@@ -57,7 +57,7 @@ describe 'wiki pages', type: :feature, js: true, with_settings: { journal_aggregendscenario 'adding, editing and history' do- visit modules_settings_project_path(project)+ visit project_settings_modules_path(project)expect(page).to have_no_selector('.menu-sidebar .main-item-wrapper', text: 'Wiki')diff --git a/spec/features/work_packages/details/inplace_editor/version_editor_spec.rb b/spec/features/work_packages/details/inplace_editor/version_editor_spec.rbindex 868623df849..8c2c2b97488 100644--- a/spec/features/work_packages/details/inplace_editor/version_editor_spec.rb+++ b/spec/features/work_packages/details/inplace_editor/version_editor_spec.rb@@ -87,7 +87,7 @@ describe 'subject inplace editor', js: true, selenium: true dofield.set_new_value 'Super cool new release'field.expect_state_text 'Super cool new release'- visit versions_settings_project_path(project)+ visit project_settings_versions_path(project)expect(page).to have_content 'Super cool new release'endenddiff --git a/spec/lib/api/v3/work_packages/work_package_representer_spec.rb b/spec/lib/api/v3/work_packages/work_package_representer_spec.rbindex 5ac37c1a892..694c61f85d1 100644--- a/spec/lib/api/v3/work_packages/work_package_representer_spec.rb+++ b/spec/lib/api/v3/work_packages/work_package_representer_spec.rb@@ -1043,7 +1043,7 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter doit_behaves_like 'action link' dolet(:action) { 'customFields' }let(:permission) { :edit_project }- let(:href) { custom_fields_settings_project_path(work_package.project.identifier) }+ let(:href) { project_settings_custom_fields_path(work_package.project.identifier) }endenddiff --git a/spec/support/pages/projects/settings.rb b/spec/support/pages/projects/settings.rbindex b0c27bc50f1..01b1be71177 100644--- a/spec/support/pages/projects/settings.rb+++ b/spec/support/pages/projects/settings.rb@@ -93,7 +93,7 @@ module Pagesenddef path- general_settings_project_path(project)+ project_settings_general_path(project)endendend