87 Commits

Author SHA1 Message Date
Kabiru Mwenja 5e3dd6a1d1 fix(documents): strip invisible characters from document titles
Documents created with zero-width Unicode characters (e.g. U+200B)
in their titles become unclickable on the index page, making them
hard to manage or delete.

Introduce RemoveInvisibleCharacters normalizer, replacing the former
RemoveAsciiControlCharacters. It strips both ASCII control characters
and Unicode zero-width characters, with each category defined as a
named constant for clarity. Apply it to Document#title and update
existing callers (Project#identifier, CustomField#name).

Add a shared RSpec example "strips invisible characters" to verify
normalization consistently across all three models.
2026-03-31 18:18:41 +03:00
Oliver Günther c3b075d391 Merge remote-tracking branch 'origin/release/17.1' into release/17.2 2026-03-16 11:11:43 +01:00
Oliver Günther 8d61c5fe7f Merge remote-tracking branch 'origin/release/16.6' into release/17.0 2026-03-16 11:08:23 +01:00
Klaus Zanders aea211c0b5 Prevent custom field names to contain ascii control characters 2026-03-13 09:54:01 +01:00
Ivan Kuchin c5bb54a462 test can_have_comment? and comment_for of CustomField 2026-03-09 17:05:34 +01:00
Ivan Kuchin e2e3d2f2ee test CustomField comment attribute name methods 2026-02-25 20:07:19 +01:00
Henriette Darge 6e228dc06a Fine-tune the shown forms of custom fields & fix tests 2026-02-23 09:08:21 +01:00
Klaus Zanders f7699e4592 fix specs after switching from User to Principal 2025-11-19 11:28:58 +01:00
Klaus Zanders f73f31d4b4 Allow setting all users visible in the instance to the current user 2025-11-18 12:28:30 +01:00
Ivan Kuchin 4f45b57742 ensure that CustomField#cast_value handles all field formats 2025-10-28 16:34:43 +01:00
Ivan Kuchin 4f796ef2f7 block CustomField field_format from changing 2025-09-17 17:53:22 +02:00
Tobias Dillmann 9eb1954422 [#64347] calculated value model specs 2025-06-25 10:13:15 +02:00
Dombi Attila f940304d31 Add custom field version spec, use kw arguments for the scope, fix specs 2025-03-17 14:13:46 +02:00
Dombi Attila 486ce0c96b Fix specs 2025-03-05 12:45:08 +01:00
Dombi Attila 517253431e Fix specs 2025-03-05 12:45:08 +01:00
Kabiru Mwenja 221627d496 bug/60976 Setting the user display format without lastname breaks user CFs with Group values
Fix an internal server error that occurs when using custom fields of type 'user' with user format settings that exclude 'lastname'.
The error manifests when Groups are included in the possible values and the user format setting doesn't include 'lastname' (e.g., when set to 'username' only).

https://community.openproject.org/work_packages/60976
2025-02-03 06:46:20 +01:00
ulferts 7efed5b277 limit select for user cf value options 2024-12-04 14:38:20 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Ivan Kuchin 0b87ed9b6a remove newlines from context descriptions 2024-07-29 19:27:17 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Richard "Virgo" Richter 206613aa20 fixed custom_field_spec.rb and added tests for allow_non_open_versions? 2023-10-26 14:54:19 +00:00
Christophe Bliard df827db627 Refactor CustomField factories using traits
Reduce duplication and harmonize the factory names:
- bool/boolean => boolean
- int/integer => integer

Co-authored-by: Aaron Contreras <aaronlcaq@gmail.com>
2023-08-29 08:57:39 +02:00
Christophe Bliard 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Christophe Bliard d76609dd6a Fix rubocop warning 2023-01-23 14:54:26 +02:00
Dombi Attila b3f3ed8f43 refactor: Extract customField1 json format into the CustomField#attribute_name method 2023-01-23 14:54:25 +02:00
Christophe Bliard ac27dba493 refactor: Extract CustomField#column_name for "cf_#{id}" 2023-01-18 10:22:48 +01:00
Christophe Bliard 10085736da refactor: Rename and generalize #accessor_name as #attribute_name
Also extract #attribute_getter and #attribute_setter when
using #attribute_name in the context of calling the getter/setter
methods.
2023-01-17 09:39:27 +01:00
Christophe Bliard 85b3258a29 Autocorrect with some rubocop cops
RSpec/Rails/InferredSpecType and Style/RedundantConstantBase

rubocop --autocorrect-all --only RSpec/Rails/InferredSpecType,Style/RedundantConstantBase spec modules/*/spec
2023-01-13 14:28:59 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
ulferts bd3f182c3d adapt specs 2021-07-01 21:49:31 +02:00
ulferts 9edc7244a9 fix displaying multi toggle in cf form (#9269) 2021-05-17 11:15:14 +02:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
Oliver Günther a65992c354 Allow placeholder and group assignment to custom field (#8972)
* Allow placeholder and group assignment to custom field

* Review feedback
2021-02-09 08:36:38 +01:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.

Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
2021-01-13 17:47:45 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
ulferts 9c3206220b remove mysql specific code throughout the application 2019-06-06 15:07:43 +02:00
Jens Ulferts cc776553c3 allow setting shared versions for version cfs 2018-10-15 14:20:25 +02:00
Jens Ulferts 070802549f replace legacy unit spec 2018-10-15 10:28:04 +02:00
Oliver Günther 059770f533 FactoryGirl => FactoryBot
Removes the deprecation
2018-05-07 22:38:20 +02:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Jens Ulferts 3717f6e0d3 less complicated custom_field#possible_values_options 2017-12-01 14:25:37 +01:00
Jens Ulferts feeed1402b fix touch: true option on custo_field association
Adding inverse_of on the custom_field association seems to fix a bug in rails which otherwise prevents the custom_field to be touched because of the after_commit callbacks defined on custom_field by acts_as_list
2017-09-28 09:53:33 +02:00
Oliver Günther d4182ef24e [25877] Validate the correctness of a CF regexp
https://community.openproject.com/work_packages/25877
2017-07-20 11:42:32 +02:00