38 Commits

Author SHA1 Message Date
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
Dombi Attila df130e6523 Restrict searching email fields of autocompleters when the current user lacks :view_user_email permission. 2024-10-08 12:42:35 +03:00
Oliver Günther 9586b06db3 Merge pull request #16331 from opf/chore/verify_partial_doubles
Set verify_partial_doubles=true
2024-08-06 10:54:18 +02:00
Oliver Günther 1df0c00c2a Adapt affected specs to opt-out of double verification 2024-08-05 19:31:30 +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
Aaron Contreras a0ad5fc4e6 Extract base permission set into shared example caller
This cleans up the readability of the spec given it's used in multiple
contexts. Easier to parse when you can refer directly from the caller
you're trying to inspect.
2024-01-08 10:53:56 -05:00
Aaron Contreras 6b9b970699 Correct permissions checked in order to view available assignees 2024-01-08 10:47:59 -05:00
Aaron Contreras 0d5801042d Merge branch 'dev' into implementation/49527-add-work-package-assignable-scopes-and-api 2024-01-03 08:46:35 -05: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
Aaron Contreras 0d929179dc Ensure user count is scope specific 2023-12-28 11:16:37 -05:00
Aaron Contreras 7634eae871 Update API path helpers and contract 2023-12-26 16:39:28 -05:00
ulferts 5b2bc41f41 Merge remote-tracking branch 'origin/dev' into easier-factory-role-setup 2023-10-12 12:09:27 +02:00
ulferts 2b2abf864a introduce ProjectRole model 2023-10-09 14:34:20 +02:00
Klaus Zanders 78c1e4fadb Switch all uses of principal factories to use new interface 2023-10-09 10:39:44 +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 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 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
ulferts d18f60aefe replace assignable column on role 2022-03-03 12:50:24 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Christophe Bliard 47a297daae Fix argument alignment since f08bea3467 (#10129)
* Fix argument alignment since f08bea3467

The FactoryBot.* prefix has been removed in f08bea3467. Since then
rubocop complains about Layout/ArgumentAlignment. This commit fixes it.

* do not fix alignments for modules/*/spec yet

hoping to be under the limit of 65535 characters for reviewdog to report on rubocop errors
2022-02-02 21:48:06 +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 9fa5599392 Feature/member notifications (#8958)
* spec with correctly scoped links

* move db check into own file - fix deprecation

* basic spec for member creation service

* use constants for all notifications

* send an OP notification after member has been created

* send an OP notification after member has been updated

* mails on group member added

Depending on whether the membership existed before or not, an updated or
a created notification is send. This is done asynchronously.

* move all mail sender background jobs into namespace

* wip

* wip

* correct handling group member notifications

* add setting enable/disable mail sending on member alterations

* use services in members controller

* move Notifiable to OpenProject

* remove member after save hooks

* cleanup/testing/linting

* render member mails in receiver locale

* remove add_member! method

* use mailer layout for all mailers

* Update app/services/groups/cleanup_inherited_roles_service.rb

Co-authored-by: Oliver Günther <mail@oliverguenther.de>

* use around callback to avoid prepending

* handle nil params

Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2021-04-20 13:45:42 +02:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
ulferts 5ea185ef66 Placeholder user project members (#8961)
* remove intermediate placeholder scope

Doing so, placeholder users will begin to show up in the system

* remove scope without value

* extract scope

* use enum for status

* allow placeholder users to become project members

* display placeholder user member on members widget

* remove now superfluous method

The status name can simply be queried via #status now

* replace possible_assignees/responsibles on project

This also leads to placeholder users becoming eligible as assignees and
responsibles.

* fix aggregated scope on bulk edit

* linting

* remove IssueHelper
2021-02-04 09:52:56 +01:00
Wieland Lindenthal efbd3e9b41 Placeholder user backend (#8935)
* Add missing copyright note to AnonymousUser [ci skip]

* Addin PlaceholderUser model and its associations

* Ensure PlaceholderUser do not "leak out" uncontrolled

* Extract Associations for User and PlaceholderUser.

- remove obsolete #assigned_issues
- remove obsoete #:responsible_for_issues
- add specs and factory for PlaceholderUser
Adding specs to PlaceholderModel

* Migration: enforce uniqueness of lastname for Group and PlaceholderUser

* Remove obsolete callback `after_add` on groups association.

The association of principals and groups still had a callback
`after_add` that called a method `user_added` on the group.
That method was not defined anymore as it was removed in
commit d93ff52a27.

* Move validation for #groupname to the right spec.

* Cleanup placeholder and group specs

* Remove Setting `workpackage_group_assignment`

* Refactoring: Extract assignable scope from Project to Member

* Refactor: Add Member scope not_locked.

* deprecate hacky scope

* remove wp_group_assignment specific test case

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
2021-01-29 09:59:37 +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
Jens Ulferts d04b86da9c introduce custom eager loading for work package list
Reduces the amount of AR models instantiated when handing wp#index
requests by:

* Calculating part of the checksum for caching in the db. This is done
by using the id and the updated_at/on field of associated models whose
representation is cached in the wp representer.
* Reusing instantiated models for multiple associations. e.g instances
of Project are used in various places (the work package itself, it's
ancestors and children). Instead of using Rails' eager loading which
would instantiate a project potentially once for every association path,
the code now assigns the same instance to all those associations.

Additionally, the commit streamlines the creation of custom field
injected representers. Now only one class is created for all work
packages when before it would be one class for every uniq set of custom
fields. On top of that, the class can be reused if the set of custom
fields does not change.
2018-05-16 11:18:38 +02:00
Oliver Günther 059770f533 FactoryGirl => FactoryBot
Removes the deprecation
2018-05-07 22:38:20 +02:00
Jens Ulferts ac59ad6a89 introduce group resource stub 2018-04-25 14:36:10 +02:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Jens Ulferts c4bef2247d adding filter instance schemas 2017-02-10 08:42:59 +01:00