From ae6632be5ff6ce58f95bfe765dd156f730daf69a Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Wed, 20 Nov 2024 13:12:25 +0100 Subject: [PATCH 01/18] [#59421] Help resolving database encoding related exception when migration to v15 https://community.openproject.org/work_packages/59421 From 809ea7f8b8e66219a9ff37bfc844288d05e8c3ec Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Wed, 20 Nov 2024 13:12:57 +0100 Subject: [PATCH 02/18] warn + exit(1) = abort --- config/initializers/03-db_check.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/config/initializers/03-db_check.rb b/config/initializers/03-db_check.rb index 0d7206b9d028..87ce59c01462 100644 --- a/config/initializers/03-db_check.rb +++ b/config/initializers/03-db_check.rb @@ -30,7 +30,7 @@ if (db_config = ActiveRecord::Base.configurations.configs_for(env_name: env)[0]) && db_config.configuration_hash["adapter"]&.start_with?("mysql") - warn <<~ERROR + abort <<~ERROR ======= INCOMPATIBLE DATABASE DETECTED ======= Your database is set up for use with a MySQL or MySQL-compatible variant. This installation of OpenProject no longer supports these variants. @@ -45,8 +45,4 @@ ============================================== ERROR - - # rubocop:disable Rails/Exit - Kernel.exit 1 - # rubocop:enable Rails/Exit end From d142302c7503bb99700cf9117b5aa47110868515 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Wed, 20 Nov 2024 15:19:55 +0100 Subject: [PATCH 03/18] check database encoding in initializer --- ..._db_fallback.rb => 04-null_db_fallback.rb} | 0 config/initializers/05-check_db_encoding.rb | 49 +++++++++++++++++++ 2 files changed, 49 insertions(+) rename config/initializers/{05-null_db_fallback.rb => 04-null_db_fallback.rb} (100%) create mode 100644 config/initializers/05-check_db_encoding.rb diff --git a/config/initializers/05-null_db_fallback.rb b/config/initializers/04-null_db_fallback.rb similarity index 100% rename from config/initializers/05-null_db_fallback.rb rename to config/initializers/04-null_db_fallback.rb diff --git a/config/initializers/05-check_db_encoding.rb b/config/initializers/05-check_db_encoding.rb new file mode 100644 index 000000000000..afe594300cbe --- /dev/null +++ b/config/initializers/05-check_db_encoding.rb @@ -0,0 +1,49 @@ +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) 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. +#++ + +icu_incompatible_encodings = %w[ + EUC_JIS_2004 + LATIN10 + MULE_INTERNAL + SQL_ASCII + WIN874 +] + +database_encoding = ActiveRecord::Base.connection.select_value("SHOW SERVER_ENCODING") + +if database_encoding.in?(icu_incompatible_encodings) + abort <<~ERROR + INCOMPATIBLE DATABASE ENCODING DETECTED + + Your database encoding is #{database_encoding}, which is incompatible with ICU + collation used in OpenProject v15. + + Please check the instructions on how to change database encoding: + https://www.openproject.org/docs/installation-and-operations/misc/changing-database-encoding/ + ERROR +end From 4a939aff3714c0e3d5cca947c5d424d7d1e24a08 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Wed, 20 Nov 2024 15:22:01 +0100 Subject: [PATCH 04/18] reraise exception with intsructions in ICU collation migration --- ...40920152544_set_versions_name_collation.rb | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/db/migrate/20240920152544_set_versions_name_collation.rb b/db/migrate/20240920152544_set_versions_name_collation.rb index 1109bf9eec4f..cbfb9541b8cb 100644 --- a/db/migrate/20240920152544_set_versions_name_collation.rb +++ b/db/migrate/20240920152544_set_versions_name_collation.rb @@ -1,8 +1,23 @@ class SetVersionsNameCollation < ActiveRecord::Migration[7.1] def up - execute <<-SQL.squish - CREATE COLLATION IF NOT EXISTS versions_name (provider = icu, locale = 'und-u-kn-true'); - SQL + begin + execute <<-SQL.squish + CREATE COLLATION IF NOT EXISTS versions_name (provider = icu, locale = 'und-u-kn-true'); + SQL + rescue StandardError => e + raise unless e.message.include?("encoding") + + abort <<~MESSAGE + \e[31mERROR:\e[0m Failed to create an ICU collation with current database encoding. + You need to change the database encoding before proceeding. + + Please check the instructions on how to do it: + https://www.openproject.org/docs/installation-and-operations/misc/changing-database-encoding/ + + Original error: + #{e.message} + MESSAGE + end change_column :versions, :name, :string, collation: "versions_name" end From 63eead00265cb919081375c499c16e4c3b33bb36 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Wed, 20 Nov 2024 19:16:01 +0100 Subject: [PATCH 05/18] add instructions for changing database encoding --- .../misc/changing-database-encoding/README.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/installation-and-operations/misc/changing-database-encoding/README.md diff --git a/docs/installation-and-operations/misc/changing-database-encoding/README.md b/docs/installation-and-operations/misc/changing-database-encoding/README.md new file mode 100644 index 000000000000..c8117f04dedd --- /dev/null +++ b/docs/installation-and-operations/misc/changing-database-encoding/README.md @@ -0,0 +1,69 @@ +# Changing database encoding + +This instructions are primarily intended to help with an error encountered when migrating to OpenProject 15. +The error happens when migration tries to create an ICU collation and database encoding doesn't support it. +We suggest to use unicode encoding for maximum compatibility. + +## Preconditions + +* Credentials with the permission to create a database in the database server the OpenProject installation is running against. +* Shell access to the OpenProject server. + +## 1. Create a database dump + +This and following steps assume that you are using built in `openproject` command. + +```shell +openproject run backup +``` + +Ensure it finished successfully and note down the path after `Generating database backup` that should normally be +in form `/var/db/openproject/backup/postgresql-dump-.pgdump`. + +See also [Backing up your OpenProject installation page](../../operation/backing-up). + +## 2. Create a new database with different encoding + +Note down the database connection URL that should be in form `postgres://:@:/`: + +```shell +openproject config:get DATABASE_URL +``` + +Create new database using `psql` command, after deciding on the name, for example `openproject-unicode`: + +```shell +psql '' -c 'CREATE DATABASE "" ENCODING UNICODE' +``` + +Options for `CREATE DATABASE` can be found at [PostgreSQL documentation page](https://www.postgresql.org/docs/current/sql-createdatabase.html). + +Or alternatively using `createdb` command: + +```shell +su postgres -c createdb -E UNICODE -O openproject_backup +``` + +Instructions for `createdb` command can be found at [PostgreSQL documentation page](https://www.postgresql.org/docs/17/app-createdb.html). + +## 3. Restore the dump to the new database + +To get the new database URL you need to replace the old database name with the new database name in the connection URL that you got in the previous step. +For example if it was `postgres://openproject:hard-password@some-host:5432/openproject` and new database name was chosen to be `openproject-unicode`, then +new database URL will be `postgres://openproject:hard-password@some-host:5432/openproject-unicode`. + +```shell +pg_restore -d '' '' +``` + +See also [Restoring an OpenProject backup](../../operation/restoring/). + +## 4. Change configuration to use the new database + +Using the new database URL from previous step: + +```shell +openproject config:set DATABASE_URL= +``` + +See also [Configuring a custom database server page](../../configuration/database/). From 81a03fc87c9f37bf77d3a6e5a23df95334ca62a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Fri, 1 Nov 2024 14:52:10 +0100 Subject: [PATCH 06/18] Wait for network in members spec --- spec/features/admin/enterprise/enterprise_spec.rb | 1 + spec/features/members/membership_filter_spec.rb | 4 +++- spec/support/pages/members.rb | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/features/admin/enterprise/enterprise_spec.rb b/spec/features/admin/enterprise/enterprise_spec.rb index dc04edbdbde5..056713f1f5b6 100644 --- a/spec/features/admin/enterprise/enterprise_spec.rb +++ b/spec/features/admin/enterprise/enterprise_spec.rb @@ -108,6 +108,7 @@ # Remove token click_on "Delete" + wait_for_network_idle # Expect modal find_test_selector("confirmation-modal--confirmed").click diff --git a/spec/features/members/membership_filter_spec.rb b/spec/features/members/membership_filter_spec.rb index 4d96a7b5a18f..6b9c6c3ecbc0 100644 --- a/spec/features/members/membership_filter_spec.rb +++ b/spec/features/members/membership_filter_spec.rb @@ -28,7 +28,9 @@ require "spec_helper" -RSpec.describe "group memberships through groups page", :js do +RSpec.describe "group memberships through groups page", + :js, + :with_cuprite do shared_let(:admin) { create(:admin) } let!(:project) { create(:project, name: "Project 1", identifier: "project1") } diff --git a/spec/support/pages/members.rb b/spec/support/pages/members.rb index 7b5fea377e0d..0dbe8cafe1ef 100644 --- a/spec/support/pages/members.rb +++ b/spec/support/pages/members.rb @@ -61,6 +61,7 @@ def open_filters! def search_for_name(name) fill_in "name", with: name find(".simple-filters--controls input[type=submit]").click + wait_for_network_idle end def expect_menu_item(text, selected: false) @@ -188,6 +189,7 @@ def edit_user!(name, add_roles: [], remove_roles: []) Array(remove_roles).each { |role| uncheck role } click_on "Change" + wait_for_network_idle end def has_group_membership?(user_name) @@ -270,6 +272,7 @@ def expect_role(role_name, present: true) def go_to_page!(number) find(".op-pagination--pages a", text: number.to_s).click + wait_for_network_idle end end end From d86b9a71dd22e3b7c019653d8b9ddd0a8a18d915 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Thu, 21 Nov 2024 14:23:41 +0100 Subject: [PATCH 07/18] stop returning self from Pages::Page#visit! --- spec/support/pages/members.rb | 6 ------ spec/support/pages/page.rb | 2 -- 2 files changed, 8 deletions(-) diff --git a/spec/support/pages/members.rb b/spec/support/pages/members.rb index 0dbe8cafe1ef..5d7a8de0cb47 100644 --- a/spec/support/pages/members.rb +++ b/spec/support/pages/members.rb @@ -40,12 +40,6 @@ def initialize(project_identifier) @project_identifier = project_identifier end - def visit! - super - - self - end - def path "/projects/#{project_identifier}/members" end diff --git a/spec/support/pages/page.rb b/spec/support/pages/page.rb index ac75b11a9202..00880c26776f 100644 --- a/spec/support/pages/page.rb +++ b/spec/support/pages/page.rb @@ -47,8 +47,6 @@ def visit! raise "No path defined" unless path visit path - - self end def reload! From d680c9928b0725b3d782cc3449c0d08c5c147280 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Thu, 21 Nov 2024 15:37:09 +0100 Subject: [PATCH 08/18] wait_for_reload at the end of Pages::Page#visit! --- spec/support/pages/page.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/support/pages/page.rb b/spec/support/pages/page.rb index 00880c26776f..8f601a4ec82d 100644 --- a/spec/support/pages/page.rb +++ b/spec/support/pages/page.rb @@ -46,7 +46,9 @@ def current_page? def visit! raise "No path defined" unless path - visit path + visit(path) + + wait_for_reload end def reload! From 82bb6930b872e6aa268328c71c4cf43ccc3c56f7 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Thu, 21 Nov 2024 15:37:25 +0100 Subject: [PATCH 09/18] remove random usage of namespace --- spec/support/pages/groups.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/pages/groups.rb b/spec/support/pages/groups.rb index 51fc51dfe49a..99bd9d13eb8a 100644 --- a/spec/support/pages/groups.rb +++ b/spec/support/pages/groups.rb @@ -69,7 +69,7 @@ def group(group_name) end end - class Group < Pages::Page + class Group < Page include ::Components::Autocompleter::NgSelectAutocompleteHelpers attr_reader :id From 48588fd38b0303aab7bb9fcd5368edc01b54e944 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Thu, 21 Nov 2024 15:45:05 +0100 Subject: [PATCH 10/18] use cuprite in members pagination spec --- spec/features/members/pagination_spec.rb | 8 +------- spec/support/pages/members.rb | 6 +++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/spec/features/members/pagination_spec.rb b/spec/features/members/pagination_spec.rb index d9b972ed8c7d..2a76f71bb12b 100644 --- a/spec/features/members/pagination_spec.rb +++ b/spec/features/members/pagination_spec.rb @@ -28,7 +28,7 @@ require "spec_helper" -RSpec.describe "members pagination", :js do +RSpec.describe "members pagination", :js, :with_cuprite do shared_let(:admin) { create(:admin) } let(:project) do create(:project, @@ -59,11 +59,9 @@ members_page.set_items_per_page! 2 members_page.visit! - SeleniumHubWaiter.wait expect(members_page).to have_user "Alice Alison" # members are sorted by last name desc members_page.add_user! "Peter Pan", as: "Manager" - SeleniumHubWaiter.wait members_page.go_to_page! 2 expect(members_page).to have_user "Peter Pan" end @@ -82,12 +80,10 @@ members_page.set_items_per_page! 1 members_page.visit! - SeleniumHubWaiter.wait members_page.remove_user! "Alice Alison" expect_and_dismiss_flash message: "Removed Alice Alison from project" expect(members_page).to have_user "Bob Bobbit" - SeleniumHubWaiter.wait members_page.go_to_page! 2 expect(members_page).to have_user "Peter Pan" end @@ -98,13 +94,11 @@ members_page.set_items_per_page! 1 members_page.visit! - SeleniumHubWaiter.wait members_page.go_to_page! 2 members_page.edit_user! "Bob Bobbit", add_roles: ["Developer"] expect(page).to have_text "Successful update" expect(members_page).to have_user "Bob Bobbit", roles: ["Developer", "Manager"] - SeleniumHubWaiter.wait members_page.go_to_page! 1 expect(members_page).to have_user "Alice Alison" end diff --git a/spec/support/pages/members.rb b/spec/support/pages/members.rb index 5d7a8de0cb47..42a2bb0111b9 100644 --- a/spec/support/pages/members.rb +++ b/spec/support/pages/members.rb @@ -55,7 +55,7 @@ def open_filters! def search_for_name(name) fill_in "name", with: name find(".simple-filters--controls input[type=submit]").click - wait_for_network_idle + wait_for_reload end def expect_menu_item(text, selected: false) @@ -183,7 +183,7 @@ def edit_user!(name, add_roles: [], remove_roles: []) Array(remove_roles).each { |role| uncheck role } click_on "Change" - wait_for_network_idle + wait_for_reload end def has_group_membership?(user_name) @@ -266,7 +266,7 @@ def expect_role(role_name, present: true) def go_to_page!(number) find(".op-pagination--pages a", text: number.to_s).click - wait_for_network_idle + wait_for_reload end end end From 5922177dbedc906260795867dacc32140b5a3ab7 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Thu, 21 Nov 2024 15:45:23 +0100 Subject: [PATCH 11/18] switch all specs using Members::Page to cuprite --- spec/features/members/error_messages_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/members/error_messages_spec.rb b/spec/features/members/error_messages_spec.rb index 48df59852021..21ef0fc04172 100644 --- a/spec/features/members/error_messages_spec.rb +++ b/spec/features/members/error_messages_spec.rb @@ -28,7 +28,7 @@ require "spec_helper" -RSpec.describe "Group memberships through groups page" do +RSpec.describe "Group memberships through groups page", :js, :with_cuprite do shared_let(:admin) { create(:admin) } let!(:project) { create(:project, name: "Project 1", identifier: "project1") } From 580fb1c0d9b7c44cfe837e2a55fa872a0467fe0b Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Fri, 22 Nov 2024 20:02:28 +0100 Subject: [PATCH 12/18] use OPENPROJECT_SKIP_DB_ENCODING_CHECK environment variable to skip database encoding check --- config/initializers/05-check_db_encoding.rb | 36 ++++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/config/initializers/05-check_db_encoding.rb b/config/initializers/05-check_db_encoding.rb index afe594300cbe..0f3fa3d3c1ae 100644 --- a/config/initializers/05-check_db_encoding.rb +++ b/config/initializers/05-check_db_encoding.rb @@ -26,24 +26,28 @@ # See COPYRIGHT and LICENSE files for more details. #++ -icu_incompatible_encodings = %w[ - EUC_JIS_2004 - LATIN10 - MULE_INTERNAL - SQL_ASCII - WIN874 -] +if ENV["OPENPROJECT_SKIP_DB_ENCODING_CHECK"].blank? + icu_incompatible_encodings = %w[ + EUC_JIS_2004 + LATIN10 + MULE_INTERNAL + SQL_ASCII + WIN874 + ] -database_encoding = ActiveRecord::Base.connection.select_value("SHOW SERVER_ENCODING") + database_encoding = ActiveRecord::Base.connection.select_value("SHOW SERVER_ENCODING") -if database_encoding.in?(icu_incompatible_encodings) - abort <<~ERROR - INCOMPATIBLE DATABASE ENCODING DETECTED + if database_encoding.in?(icu_incompatible_encodings) + abort <<~ERROR + INCOMPATIBLE DATABASE ENCODING DETECTED - Your database encoding is #{database_encoding}, which is incompatible with ICU - collation used in OpenProject v15. + Your database encoding is #{database_encoding}, which is incompatible with ICU + collation used in OpenProject v15. - Please check the instructions on how to change database encoding: - https://www.openproject.org/docs/installation-and-operations/misc/changing-database-encoding/ - ERROR + Please check the instructions on how to change database encoding: + https://www.openproject.org/docs/installation-and-operations/misc/changing-database-encoding/ + + This check can be skipped by setting environment variable OPENPROJECT_SKIP_DB_ENCODING_CHECK=true + ERROR + end end From be92e46191aa56cf7b4b7e3b9e4f075eb010e909 Mon Sep 17 00:00:00 2001 From: Henriette Darge Date: Tue, 3 Dec 2024 12:37:22 +0100 Subject: [PATCH 13/18] Only increase the height of the dialog when it is really needed. In edit mode, the autocompleter is disabled and thus does not have to be increased --- .../add_work_package_child_dialog_component.html.erb | 2 +- .../add_work_package_child_dialog_component.rb | 4 ++++ .../work_package_relation_dialog_component.html.erb | 2 +- .../work_package_relation_dialog_component.rb | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb index d068472fdcff..1aedf05ea037 100644 --- a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb +++ b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.html.erb @@ -3,7 +3,7 @@ size: :large, id: DIALOG_ID)) do |d| d.with_header(variant: :large) - d.with_body(classes: "Overlay-body_autocomplete_height") do + d.with_body(classes: body_classes) do render(WorkPackageRelationsTab::AddWorkPackageChildFormComponent.new( work_package: @work_package )) diff --git a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.rb b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.rb index 8f3ae85e92d2..fc7e09dee8df 100644 --- a/app/components/work_package_relations_tab/add_work_package_child_dialog_component.rb +++ b/app/components/work_package_relations_tab/add_work_package_child_dialog_component.rb @@ -51,4 +51,8 @@ def dialog_title child_label = t("#{I18N_NAMESPACE}.relations.label_child_singular") t("#{I18N_NAMESPACE}.label_add_x", x: child_label) end + + def body_classes + "Overlay-body_autocomplete_height" + end end diff --git a/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb b/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb index d9cf73a50d36..2a804ff50d0b 100644 --- a/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb +++ b/app/components/work_package_relations_tab/work_package_relation_dialog_component.html.erb @@ -3,7 +3,7 @@ size: :large, id: DIALOG_ID)) do |d| d.with_header(variant: :large) - d.with_body(classes: "Overlay-body_autocomplete_height") do + d.with_body(classes: body_classes) do render(WorkPackageRelationsTab::WorkPackageRelationFormComponent.new( work_package: @work_package, relation: @relation diff --git a/app/components/work_package_relations_tab/work_package_relation_dialog_component.rb b/app/components/work_package_relations_tab/work_package_relation_dialog_component.rb index c56edcd2ba98..02fd5f33dd76 100644 --- a/app/components/work_package_relations_tab/work_package_relation_dialog_component.rb +++ b/app/components/work_package_relations_tab/work_package_relation_dialog_component.rb @@ -58,4 +58,8 @@ def dialog_title t("#{I18N_NAMESPACE}.label_add_x", x: relation_label) end end + + def body_classes + @relation.persisted? ? nil : "Overlay-body_autocomplete_height" + end end From e3e95d12627a5072122c5b04953d40dd88a17209 Mon Sep 17 00:00:00 2001 From: ulferts Date: Wed, 4 Dec 2024 11:13:32 +0100 Subject: [PATCH 14/18] improve robustness of activity back url --- app/helpers/journals_helper.rb | 3 ++- spec/helpers/journals_helper_spec.rb | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb index 85217057380e..821798a5cec2 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -38,7 +38,8 @@ def back_to_activity_page_url(activity_page) in ["users", user_id] user_url(user_id) in ["work_packages", work_package_id] - work_package_url(work_package_id) + # Sometimes the parameter provided is erroneous (having an extra ') for unknown reasons. + work_package_url(work_package_id.chomp("'")) else nil end diff --git a/spec/helpers/journals_helper_spec.rb b/spec/helpers/journals_helper_spec.rb index fb9dcba080e3..8910302da9a3 100644 --- a/spec/helpers/journals_helper_spec.rb +++ b/spec/helpers/journals_helper_spec.rb @@ -38,6 +38,8 @@ "unsupported_gizmo" => nil, "users/5" => "http://test.host/users/5", "work_packages/42" => "http://test.host/work_packages/42", + # Sometimes the url is erroneous (having an extra ') for unknown reasons. + "work_packages/42'" => "http://test.host/work_packages/42", nil => nil }.each do |activity_page, expected_url| context "when activity page is #{activity_page.inspect}" do From 4d4c8ad4724dfa9bf5ca4c7dffdbdebd90997fd5 Mon Sep 17 00:00:00 2001 From: ulferts Date: Wed, 4 Dec 2024 16:40:18 +0100 Subject: [PATCH 15/18] update release image for 15.1 --- frontend/src/assets/images/15_1_features.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/assets/images/15_1_features.svg b/frontend/src/assets/images/15_1_features.svg index d8559b64b106..9d3109d6a5b9 100644 --- a/frontend/src/assets/images/15_1_features.svg +++ b/frontend/src/assets/images/15_1_features.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 06f64b689940b4e2e03ab991663588e82d683897 Mon Sep 17 00:00:00 2001 From: as-op Date: Thu, 5 Dec 2024 11:42:39 +0100 Subject: [PATCH 16/18] [#59781] Export of an unsaved query not working properly https://community.openproject.org/work_packages/59781 --- .../dynamic/work-packages/export/form.controller.ts | 12 ++++++++---- spec/features/work_packages/export_spec.rb | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/src/stimulus/controllers/dynamic/work-packages/export/form.controller.ts b/frontend/src/stimulus/controllers/dynamic/work-packages/export/form.controller.ts index 149bd00801b6..70832ed8b335 100644 --- a/frontend/src/stimulus/controllers/dynamic/work-packages/export/form.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/work-packages/export/form.controller.ts @@ -41,12 +41,16 @@ export default class FormController extends Controller { return result.job_id; } + generateExportURL():string { + const formatURL = this.element.getAttribute('action') as string; + const searchParams = this.getExportParams(); + const append = formatURL.includes('?') ? '&' : '?'; + return `${formatURL}${append}${searchParams.toString()}` + } + submitForm(evt:CustomEvent) { evt.preventDefault(); // Don't submit - const formatURL = this.element.getAttribute('action'); - const searchParams = this.getExportParams(); - const exportURL = `${formatURL}?${searchParams.toString()}`; - this.requestExport(exportURL) + this.requestExport(this.generateExportURL()) .then((job_id) => this.showJobModal(job_id)) .catch((error:HttpErrorResponse) => this.handleError(error)); } diff --git a/spec/features/work_packages/export_spec.rb b/spec/features/work_packages/export_spec.rb index 8c16a1bd3b4d..e4d14d052b17 100644 --- a/spec/features/work_packages/export_spec.rb +++ b/spec/features/work_packages/export_spec.rb @@ -126,7 +126,7 @@ def export! context "with activated options" do let(:query) do create( - :query, user: current_user, project:, + :query, id: 1234, user: current_user, project:, display_sums: true, include_subprojects: true, show_hierarchies: true, @@ -135,6 +135,7 @@ def export! end let(:expected_params) do default_expected_params.merge({ + query_id: "1234", showSums: "true", includeSubprojects: "true", showHierarchies: "true" From 6a12958ac90acc71626f044a79c020cdfd1a2fba Mon Sep 17 00:00:00 2001 From: as-op Date: Thu, 5 Dec 2024 11:55:57 +0100 Subject: [PATCH 17/18] obey eslint --- .../dynamic/work-packages/export/form.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/stimulus/controllers/dynamic/work-packages/export/form.controller.ts b/frontend/src/stimulus/controllers/dynamic/work-packages/export/form.controller.ts index 70832ed8b335..e051a7ce57b0 100644 --- a/frontend/src/stimulus/controllers/dynamic/work-packages/export/form.controller.ts +++ b/frontend/src/stimulus/controllers/dynamic/work-packages/export/form.controller.ts @@ -42,10 +42,10 @@ export default class FormController extends Controller { } generateExportURL():string { - const formatURL = this.element.getAttribute('action') as string; + const actionURL = this.element.getAttribute('action') as string; const searchParams = this.getExportParams(); - const append = formatURL.includes('?') ? '&' : '?'; - return `${formatURL}${append}${searchParams.toString()}` + const append = actionURL.includes('?') ? '&' : '?'; + return `${actionURL}${append}${searchParams.toString()}`; } submitForm(evt:CustomEvent) { From 0b31ada23ec1786752c4c4d2d66d647e95d63870 Mon Sep 17 00:00:00 2001 From: OpenProject Actions CI Date: Fri, 6 Dec 2024 03:24:00 +0000 Subject: [PATCH 18/18] update locales from crowdin [ci skip] --- config/locales/crowdin/js-de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/crowdin/js-de.yml b/config/locales/crowdin/js-de.yml index bf27e3438309..e020343c7f49 100644 --- a/config/locales/crowdin/js-de.yml +++ b/config/locales/crowdin/js-de.yml @@ -359,7 +359,7 @@ de: "15_1": standard: new_features_html: > - Die Version bringt verschiedene Funktionen und Verbesserungen für Sie, z.B.
  • Benutzerdefinierte Felder vom Typ Hierarchie (Enterprise Add-on).
  • Neugestaltung des Beziehungen-Tabs in Arbeitspaketen.
  • Neugestaltung der Meeting-Indexseite.
  • Manuelle Seitenumbrüche beim Export von PDF-Arbeitspaketen.
  • Zen-Modus für Projektlisten.
+ Die Version bringt verschiedene Funktionen und Verbesserungen für Sie, z.B.
  • Selbstdefinierte Felder vom Typ Hierarchie (Enterprise Add-on).
  • Neugestaltung des Beziehungen-Tabs in Arbeitspaketen.
  • Neugestaltung der Besprechungen-Indexseite.
  • Manuelle Seitenumbrüche beim PDF-Export von Arbeitspaketen.
  • Zen-Modus für Projektlisten.
ical_sharing_modal: title: "Kalender abonnieren" inital_setup_error_message: "Beim Abrufen der Daten ist ein Fehler aufgetreten."