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

Revert "Fix trailing slash by fixing optional_project route"

Oliver Günther916363cdcf1f
diff --git a/frontend/src/app/core/routing/openproject.routes.ts b/frontend/src/app/core/routing/openproject.routes.ts
index 8910c2f70d4..28597b25085 100644
--- a/frontend/src/app/core/routing/openproject.routes.ts
+++ b/frontend/src/app/core/routing/openproject.routes.ts
@@ -78,13 +78,13 @@ export const OPENPROJECT_ROUTES:Ng2StateDeclaration[] = [
{
name: 'optional_project',
parent: 'root',
- url: '/{projects:(?:projects)}/{projectPath}',
+ url: '/{projects}/{projectPath}',
abstract: true,
params: {
// value: null makes the parameter optional
// squash: true avoids duplicate slashes when the parameter is not provided
projectPath: { type: 'path', value: null, squash: true },
- projects: { value: null, squash: true },
+ projects: { type: 'path', value: null, squash: true },
},
views: {
'!$default': { component: ApplicationBaseComponent },
diff --git a/spec/features/work_packages/navigation_spec.rb b/spec/features/work_packages/navigation_spec.rb
index 45935724bc1..b08c57d21c2 100644
--- a/spec/features/work_packages/navigation_spec.rb
+++ b/spec/features/work_packages/navigation_spec.rb
@@ -29,8 +29,8 @@
require 'spec_helper'
RSpec.describe 'Work package navigation', js: true, selenium: true do
- shared_let(:user) { create(:admin) }
- shared_let(:project) { create(:project, name: 'Some project', enabled_module_names: [:work_package_tracking]) }
+ let(:user) { create(:admin) }
+ let(:project) { create(:project, name: 'Some project', enabled_module_names: [:work_package_tracking]) }
let(:work_package) { build(:work_package, project:) }
let(:global_html_title) { Components::HtmlTitle.new }
let(:project_html_title) { Components::HtmlTitle.new project }
@@ -39,7 +39,7 @@ RSpec.describe 'Work package navigation', js: true, selenium: true do
"#{work_package.type.name}: #{work_package.subject} (##{work_package.id})"
end
- shared_let(:query) do
+ let!(:query) do
query = build(:query, user:, project:)
query.column_names = %w(id subject)
query.name = "My fancy query"
@@ -156,15 +156,6 @@ RSpec.describe 'Work package navigation', js: true, selenium: true do
page404.expect_and_dismiss_toaster type: :error, message: I18n.t('api_v3.errors.not_found.work_package')
end
- it 'loading a work package with trailing slash (Regression #49672)' do
- work_package.subject = 'Foobar'
- work_package.save!
- visit "/work_packages/#{work_package.id}/"
-
- wp_page = Pages::FullWorkPackage.new(work_package)
- wp_page.expect_subject
- end
-
# Regression #29994
it 'access the work package views directly from a non-angular view' do
visit project_path(project)