106 Commits

Author SHA1 Message Date
Mir Bhatia cfafd01fb0 Show different status matrices per tab 2026-03-17 15:52:01 +01:00
Mir Bhatia cf24316722 Show role specific statuses on workflow edit page by default 2026-03-12 17:52:08 +01:00
Jan Sandbrink 272ff67619 Introduce visible scope for types and statuses
Both models are only supposed to be visible
to users that have some basic permissions in at least
one project. While the desired scoping is not very fine grained
(you either see all or nothing), it still makes sense for all
models to have such a scope for consistency purposes.
2026-02-19 13:27:24 +01:00
Klaus Zanders 591e2b4025 Remove redundant validations and fix specs 2025-12-18 12:01:34 +01:00
Klaus Zanders ba82ffd482 Switch to case sensitive uniqueness validation 2025-12-18 11:32:52 +01:00
Eric Schubert e36d115295 [#65242] moved most of the wp types related files to new namespace
- https://community.openproject.org/work_packages/65242
- moved a lot of classes under ::Types or ::WorkPackages::Types to
  ::WorkPackageTypes namespace
2025-06-30 13:31:39 +02:00
Marcello Rocha 3a8b9bc056 Move the AM:Validations out of the model to the Contract 2025-06-13 14:36:06 +02:00
as-op 862f84b6ce refactor spread code into a type sub class 2025-02-17 12:47:46 +01:00
as-op 29f151e6bd connect the settings UI with the model 2025-02-13 15:30:19 +01:00
as-op 5de92c9b7f obey rubocop 2025-02-11 13:54:42 +01:00
as-op 119733f4ad add admin settings tab for pdf export templates 2025-02-11 13:02:13 +01:00
Jan Sandbrink 66363d4b54 Update patterns by changing subject-pattern only
This means if there were other (non-subject) keys in the patterns,
we'd not inadvertently overwrite them.

This includes a change to the Patterns::Collection:
* The subject pattern is now considered optional
    * This is in line with most code ignoring it if it's disabled anyways,
      there was never a strong expectation to always have a subject pattern
* The patterns-collection itself will now always be present on a type, it will
  never be nil (but it can be empty)

The latter change means that we can get rid of some nil-checks, and thus we don't
need to differentiate between "create" cases (when there are no patterns yet) and
"update" cases (there are patterns and we change them). Everything is an update to
the patterns.

This is consistent with other enumerable relations and attributes attached to a
record. E.g. one wouldn't perform a nil-check on a has_many relation.

This also means that invalid assignments, such as

    type.patterns = "Bob"

will now not set patterns to nil, but to the null object (an empty collection)
as well.
2025-01-09 13:31:21 +01:00
Jan Sandbrink 871d7bfd1f Change replacement_patterns_defined to require an attribute name
This ensures that the method is only used in contexts where we know
for which attribute we expect a replacement pattern to be defined.

This change makes errors less likely where one would expect that
all replacement patterns are defined for subjects (which is the status
quo as implemented, but not as designed).

Also all code that I've seen so far that calls this method, needed to
validate the subject attribute separately afterwards. This change should
make such code shorter.
2025-01-07 13:35:57 +01:00
Marcello Rocha 426dbeaf2e Returns all possible tokens and its translations when available 2024-12-30 12:28:22 +01:00
Marcello Rocha 07002998bf Changes the Update / Create work package contract. 2024-12-30 12:27:53 +01:00
Marcello Rocha 3629d5d00e Introduces the patterns attribute to Type
We should probably rename `Type` to `WorkPackageType` to avoid
using a already loaded term.
2024-12-16 10:21:40 +01: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
Christophe Bliard cdb0505ded refactor: Remove useless top-level :: when defining classes
It was messing up with ruby-lsp extension of vs code.
2024-08-01 07:23:09 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +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
ulferts 158f3e4e3a remove methods no longer in use - especially pagination 2023-10-02 22:50:43 +02:00
Christophe Bliard 96415fd16c Mark some belongs_to association as optional
The ones I could find while trying to cope with config.active_record.belongs_to_required_by_default = true to make tests pass, before finally giving up when I realized that Notification.journal cannot be nil, and be set in tests.
2023-03-15 08:53:10 +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 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
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 cc4ed56e2a use AR`s scope method instead of singleton class method (#8976)
* use AR`s scope method instead of singleton class method

By using the scope method, all of Rails` checks and method definition usually done on a method are now also performed on the extracted scope methods

https://github.com/rails/rails/blob/5f3ff60084ab5d5921ca3499814e4697f8350ee7/activerecord/lib/active_record/scoping/named.rb#L154-L190

* turn scope classes into modules
2021-02-05 10:53:44 +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 2ad215fed1 add milestone type filter for default project gantt query (#8869) 2020-12-08 10:47:29 +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
Oliver Günther 18e4ed1a9a Change case insensitive validations to false 2020-03-11 11:32:53 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
ulferts 6c4e572f4e consolidate allowed_* logic in the wp contract 2019-12-02 09:28:02 +01:00
ulferts 587e61c647 nil non provided parameters on put 2019-12-02 08:18:03 +01:00
ulferts c83ba63640 Revert revert unwanted in dev branch
This reverts commit b05a8f7b54.

The release/10 branch received a revert that was applied after changes
from dev unwillingly where merged into it. But when merging release/10.0
back into dev, that revert was also applied to dev where the changes are
indeed wanted. So we revert the revert for dev.
2019-09-20 08:36:05 +02:00
Oliver Günther b05a8f7b54 Revert "[31080] Trigger wpEvent after custom action" 2019-09-18 14:28:33 +02:00
ulferts e7263fcedb migrate to rails 6.0.0 2019-09-12 16:14:51 +02:00
Oliver Günther 83e9849b54 Merge remote-tracking branch 'origin/dev' into housekeeping/colors 2018-08-29 08:45:36 +02:00
Jens Ulferts 5a1e597d84 remove in_aggregation from type 2018-07-17 12:41:55 +02:00
Oliver Günther f254c9ea71 Merge remote-tracking branch 'origin/dev' into housekeeping/colors 2018-06-14 07:50:44 +02:00
Oliver Günther 0c2851a579 Rewrite Type#statuses to always return AR relation 2018-05-25 07:45:34 +02:00
Oliver Günther ab847b81d7 [27780] Assign default status when type changes and old status does not exist
When switching the type, the status is not validated in the target type,
resulting in a correctly saved work package whose status can no longer
be changed.

https://community.openproject.com/wp/27780
2018-05-24 10:50:58 +02:00
Oliver Günther e77aae007b Rename PlanningElementTypeColors => Colors and add autocomplete 2018-05-11 14:17:50 +02:00
Oliver Günther 2f0e9c1c07 Add color to status 2018-05-09 20:25:21 +02:00