37 Commits

Author SHA1 Message Date
Dombi Attila 47af87af4b Move the calculated custom field calculations to a background job. 2025-11-06 09:09:47 +02:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Oliver Günther 12ee9e6b83 Merge remote-tracking branch 'origin/idea/56781-remove-years-from-copyrights' into dev 2024-08-06 10:17:59 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Dombi Attila f8ecc28cc8 Fix more specs 2024-07-29 16:47:27 +03:00
Dombi Attila cd3165c51a Fix specs 2024-07-29 16:47:26 +03:00
Ivan Kuchin 6678cab48d auto correct quotes 2024-03-28 18:22:34 +01:00
Jonas Jabari a91d0ef631 adjusted custom value specs 2024-03-08 10:54:52 +07:00
Jonas Jabari aeba290428 fixed custom value specs 2024-03-07 12:03:07 +07:00
Jonas Jabari a67359f52e fixed custom value specs 2024-03-04 20:26:48 +07:00
Jonas Jabari 8610e769f0 fixing project API 2024-02-28 15:48:28 +07: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
Klaus Zanders 78c1e4fadb Switch all uses of principal factories to use new interface 2023-10-09 10:39:44 +02: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 0029bffe3d Correctly create default values for multi-value list custom field
https://community.openproject.org/wp/49765

https://community.openproject.org/wp/49784

Original bug was OP#49765: creating a list custom field and then adding
a comment to an existing work package would be impossible. An error
"<custom field> was attempted to be written but is not writable" was
displayed.

In WorkPackageContract, when evaluating what was changed by the user and
by the system, it checks if the custom values are newly set and if they
are default.

The default check was wrong for list custom field, as the default value
was an integer, and the value was a string (created automatically by
Redmine::Acts::Customizable#custom_field_values). i.e. check was `367 ==
"367"`

The default check was wrong for multi-value list custom field as well,
as the default value was a stringified array of integers, i.e. check was
`[367, 368] == "[367, 368]"`. And it is plain wrong anyway because two
CustomValue must be created in this case: one with value 367, second
with value 368. This prevented default values to be pre-selected in the
new work package form (bug #49784).

This commit fixes the default check by returning strings for default
value of list custom fields (bug #49765) and by creating multiple
CustomValue for multi-value list custom fields (bug #49784) when none is
present.
2023-08-25 17:27:22 +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 9e865b4f7b lint: Run rubocop safe autocorrect
Command is `rubocop --safe --autocorrect app lib lib_static modules spec`
2023-03-09 10:25:57 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
ulferts c2a824dc3a set foreign key values 2022-11-01 12:29:58 +01:00
ulferts 701622b559 replace legacy spec 2022-06-16 13:55:07 +02: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 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +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
Oliver Günther af4010b003 [33496] Don't try to lookup custom value by value
Only for list types, the value will be an integer to look up by id,
but instead use `CustomValue.new(...).typed_value` to use the formatter
classes to correctly look up the value.

https://community.openproject.com/wp/33496

[ci skip]
2020-09-04 12:50:13 +02:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01: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
Oliver Günther 56c1801e1c [26780] Output the correct date in the typed_value of date CV
https://community.openproject.com/wp/26780
2017-12-13 20:21:03 +01:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Jens Ulferts 701f196c25 eager load user and version custom fields in wp representer 2016-11-22 09:13:02 +01:00
Jens Ulferts e8dec71010 fix specs 2016-09-15 13:22:08 +02:00
Jens Ulferts a6d265eb79 force bool custom values to be stored uniformly 2016-09-14 11:36:44 +02:00
Jan Sandbrink 8e1970b9bb add roundtrip tests for more datatypes 2015-04-17 11:12:31 +02:00
Jan Sandbrink 27d6abfa35 add integrative tests for typed_value for booleans
first charge of tests.

I intend those to fail for postgres, but can't verify that locally, so travis
will have to do it for me.

If you see this build failing for the newly added specs: This is intentional!
2015-04-17 10:38:13 +02:00