128 Commits

Author SHA1 Message Date
Mir Bhatia 997166bb61 Update to use constant instead of magic numbers 2026-04-30 15:07:47 +02:00
Mir Bhatia 96f73a43a9 Add max length to password_min_length setting 2026-04-29 11:36:37 +02:00
Oliver Günther 3075bbd5a2 Rewrite setting accessors as define_methods 2026-02-10 13:37:22 +01:00
Oliver Günther 680d3293dd Refactor installation uuid to use new persist_on_first_read 2026-02-10 07:40:32 +01:00
Oliver Günther 9ac8ec7ad1 Add persist_on_first_read: true option to settings to lazy-save default 2026-02-05 09:33:41 +01:00
Oliver Günther fa36f1a098 Disallow writing of sendmail settings 2025-12-02 09:46:15 +01:00
Alexander Brandon Coles d17da65477 Freeze string literals in app/models
rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze app/models
2025-07-22 18:26:13 +01:00
ulferts 14c8ae1bf5 adapt deprecation method calls 2025-03-11 13:27:56 +01:00
ulferts 6eac5926eb adapt deprecation warning 2025-03-01 21:04:48 +01:00
Markus Kahl e3b52ed91d return nil for unknown setting whose format we cannot determine instead of throwing an error 2025-01-10 09:28:14 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Ivan Kuchin b10e6d718c rubocop autocorrect 2024-06-24 19:01:59 +02:00
Oliver Günther c29279d99b Remove the definition for LDAP tls options
https://community.openproject.org/work_packages/45959
2024-04-02 11:11:47 +02:00
Christophe Bliard 8fa8584538 Run rubocop --autocorrect on all files
Only the safe cops have run. rubocop version is 1.59.0.
2024-01-05 15:27:09 +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
Pavel Balashov fc63e5a65c Remove Setting.definitions.
In favor for `Settings::Definition.all`.
Let's have one way for getting the list of core settings definitions.
2023-02-23 20:46:57 +01:00
Pavel Balashov c5d75459dd [#45965] Setting definitions validations access nonloaded constants
https://community.openproject.org/work_packages/45965
2023-02-22 16:03:50 +01:00
Christophe Bliard c19ff1e96e Merge pull request #11925 from opf/implementation/45083-update-look-of-activity-items-in-activity-module-for-project-and-work-packages
[#45083] Update look of activity items in activity module for project and work packages
2023-02-06 10:04:29 +01:00
Christophe Bliard 47acc2c932 Refactor with better names and simplified logic 2023-02-06 09:30:25 +01:00
Christophe Bliard f88889489f Remove deprecated Setting::CallbackHelper (#11965) 2023-01-23 11:39:19 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 790551c4c8 Allow nil for integer settings with nil default value 2022-11-10 18:41:05 +01:00
Oliver Günther 49b1cd32e5 Revert timezone setting back to string, validate using canonical (#11607)
* Revert timezone setting back to string, validate using canonical

Add spec

* Update config/constants/settings/definitions.rb

Co-authored-by: Christophe Bliard <c.bliard@openproject.com>

Co-authored-by: Christophe Bliard <c.bliard@openproject.com>
2022-11-10 16:07:39 +01:00
Oliver Günther 64801fed54 Allow setting timezone values 2022-11-03 16:31:04 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Oliver Günther 22b7849520 Remove legacy mailer configuration and move into settings
Split from "Remove Setting.protocol in favor of static config"

Restore cache store setup
2022-05-18 16:21:55 +02:00
Markus Kahl 3436b3694d set smtp opts via settings allowing runtime override
otherwise it's impossible to update
it at runtime/inapp since the merge
of configuration and settings in 12.1
2022-05-10 13:29:55 +02:00
Christophe Bliard 99af076a4c [#42226] Psych::DisallowedClass: Tried to load unspecified class: URI::Generic while upgrading from 12.01 to 12.10
https://community.openproject.org/work_packages/42226

properly deserialize setting hash value having a URI::Generic inside
2022-05-04 21:33:06 +02:00
Christophe Bliard 2c67f992a5 stringify hash settings keys and support OPENPROJECT_2FA env var
updated code to look up the string key instead of the symbol key

introduce a 'with settings' rspec shared context
2022-04-27 21:27:42 +02:00
Christophe Bliard c6ff4be74f deserialize empty string setting value to nil when not string format
the seeder blindly saves all settings to database, setting the value to empty string when no value is defined. When the setting is read back, it can be misinterpreted. For instance a boolean setting with a nil value will have the value '' once seeded, and it is truthy which is wrong.

add a helper to restore settings after resetting them in tests
2022-04-15 15:59:56 +02:00
Christophe Bliard 23e95dd3c9 refactor: fix naming and make rubocop happier 2022-04-11 16:05:02 +02:00
ulferts 056fce4b19 improve error message on unwritable setting assignment 2022-04-01 14:56:44 +02:00
ulferts 07801a8cf8 raise if non writable setting is attempted to be written 2022-04-01 14:41:13 +02:00
ulferts f4c4544f7a bail when trying to write a configuration & deprecte non bool setting_name? access 2022-04-01 11:27:52 +02:00
ulferts 0b5575aa64 harmonize settings & configuration
They are for now still available as separate entities but that is more due to existing references to them both. Under the hood, they now depend on the
same structure `Settings::Definition` which just as well could have been named `Configuration::Definition`, that defines:
* the name
* the default value
* the type (which might be deferred from the default value)
* the array of allowed values

Both Setting and Configuration can now be overwritten using the same mechanisms:
* Default value
* Database value
* configuration.yml (settings.yml is removed)
* ENV vars
2022-03-14 13:37:22 +01:00
Christophe Bliard a33524ef6d remove ruby magic comment for utf-8
ruby interprets source encoding as utf-8 since 2.0.0, making magic comment redundant and useless
2022-03-10 19:36:58 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Christophe Bliard 823900e4ec fix resolution of Setting::Callbacks
Callbacks was resolved as ActiveRecord::Callbacks, so file setting/callbacks.rb was never required and method fire_callbacks was missing. Renaming the class fixed it.
2022-02-03 13:39:44 +01:00
Christophe Bliard 77a6c832c7 Merge branch 'dev' into fix/remove_require_dependency 2022-02-02 17:39:15 +01:00
ulferts 407e5ffa1e avoid overwriting default setting value 2022-01-07 15:21:42 +01:00
ulferts 89cfee203f remove usage of require_dependency
according to the rails 6 migration guide, it should no longer be necessary: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#require-dependency
2022-01-07 14:46:21 +01:00
ulferts e3f8d1efe3 adapt to changes in Psych.safe_load 2022-01-07 14:35:12 +01:00
ulferts 8ef6c1110c Merge branch 'release/11.3' into dev 2021-09-13 09:44:34 +02:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
Markus Kahl b8c04551b8 fixed cache key so it works in spec too
during tests `Setting.column_names` returned strings rather than symbols
which is why setting caching didn't work
as expected
2021-09-01 12:42:51 +01:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
luz paz 3683042c9b Fix typos in user facing and non-user facing code
Found via `codespell v2.1.dev0`
2021-01-24 15:08:21 +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
ulferts 6cce947cbd Chore/rename timestamps (#8765)
* rename timestamps on time entry

* add updated_at filter/order for time entries

* rename on cost entries as well

This will make handling in the cost query easier

* adapt specs

* linting

* adapt project activity

* update references to updated_on

* remove outdated docs/code

* global memberships are just memberships

* rewire global membership creation/update/deletion

* delete no longer required code and patches

* move code to core

* move specs to core

* completely remove global roles in the form of a plugin

* adapt specs

* remove unused methods

* migrate existing data

* adapt membership representer to changed timestamps

* global memberships available via API

* implements created/update_at filters on memberships

* update member on roles being added/removed

* specify default value for created_at

* fix project permission check and validation on members

* adapt membership schema

* adapt usage of sort by on members widget

* support created/updated_on for api sort and filter

* remove outdated model file

* rename timestamps

* allow specifying timestamp column for aaj

* reload column information

* further rename of created_on

* include updated_at into journal creation

* adapt document updated_at calculation

* remove references to JournalVersion
2020-12-03 12:00:19 +01:00
Oliver Günther 53f2d694ff Use AnyFixtures to generate fixtures from factories (#7230)
Uses FactoryBot to keep and maintain specific records in a special transaction that does not get removed after each spec.
They automatically are created whenever first hitting them.
This makes an excellent time saver for items that are commonly used, such as an admin user account
2020-04-09 11:54:26 +02:00