25 Commits

Author SHA1 Message Date
Klaus Zanders d998dd3c25 Fix more controller actions 2026-02-09 15:08:08 +01: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 fa99c5bef6 Render with status: :unprocessable_entity 2024-10-11 08:42:58 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Christophe Bliard a885fef2bd Conform to RSpecRails/HaveHttpStatus cop
With a hack to get `have_http_status` to work with `Rack::MockResponse`.
2024-06-24 17:50:57 +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 60ed64cd04 use error_messages_for method now 2023-10-24 12:06:36 +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 aa23106c11 lint: autocorrect RSpec/FactoryBot/ConsistentParenthesesStyle
command is

    rubocop -A --only RSpec/FactoryBot/ConsistentParenthesesStyle modules spec
2023-03-07 15:04:32 +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
Dombi Attila d349c30d7e [#44414] Add the Enterprise Edition guard on date alerts settings
https://community.openproject.org/work_packages/44414
2022-11-08 21:50:47 +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
Oliver Günther fc090ac024 [37136] Disable delete button and check for deletion (#9338)
https://community.openproject.org/wp/37136
2021-05-31 16:31:41 +02:00
Wieland Lindenthal ffa5ac84a8 Allow deletion of placeholder users when permission of :manage_placeholder_user give (#9018)
* Refactoring: Rename permission :add_user and :add_placholder_user

to :manage_user and :manage_placeholder_user

* Add deletion to :manage_placeholder_user permission label

* WIP: Check :manage_placeholder_user permission before deletion

Specs still missing

* In controller rely on authorize_global for deleting placeholder users

* Add deletion_info for placeholder users

* Extend specs

* Set placeholder users to locked when deleting

* Review feedback

Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2021-02-17 10:22:14 +01:00
Oliver Günther af35670694 Make placeholder users EE (#9003)
* Add global permission to manage (but not delete) placeholders

https://community.openproject.com/work_packages/35508

* Show EE upsale and disable creation of placeholders without it

* Review feedback
2021-02-16 21:32:30 +01:00
Oliver Günther bbeae32698 [35508] Add global permission to manage placeholder users (#9000)
* Add global permission to manage (but not delete) placeholders

https://community.openproject.com/work_packages/35508

* Restore breadcrumbs for non-show routes

* Remove permissions to memberships for add_placeholder_user permission

* Allow non-admins with global permission to access membership

* Remove permissions to memberships for add_placeholder_user permission

* Rename shared_examples for admin contract validations

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
2021-02-16 14:16:35 +01:00
Wieland Lindenthal a18954b2c9 Placeholder user services and administration (#8944)
* Adding placeholder user contracts

* Adding create, update, and delete services for placeholder users

* WIP: Adding Placeholder User contract specs [ci skip]

* Extract contract validation into common helper

* Add common validation in BaseContract + common example for admin checks

* Introduce common ModelContract shared context for validations

* WIP: PlaceholderUser controller, i18n, and routes [ci skip]

* Placeholder users index page and query

- moved all group related scopes from User to Principal to make them also available in PlaceholderUser.

* end

* Create PlaceholderUser

* Feature spec for editing a placeholder user

* Manage PlaceholderUser memberships

The managment of memberships is pretty similar for User and PlaceholderUser. This commit extacts the similarities and uses them for both.

* General partial and show view for PlaceholderUser

* Delete obosolete partial

* Allow RequireAdminGuard to be used as a module function

* Fix I18n for confirmation text

* Smaller code improvements

* Fix: Syntax for accessing status enums was wrong.

* Use UpdateService for updating a placeholder user

* Add spec for PlaceholderUsersController

* First code improvements after code review.

- more improvements to come.

* Further code improvements after review

... still more to come

* Correct namespace of delete service

* Fix: Make placeholder user contract validate

* Remove :type attribute from base contract of User and PlaceholerUser

...and add it to the CreateContracts.
Also add type validations.

Further extract shared examples for placeholder user attribute
validation

* Refactor: Extract membership hook calls to helper

* Fix redirect paths for membership controllers

* Specs already present in shared exampels.

* Fix duplicates routes for users and placeholder users

* Fix user path

* Add attribute name and lastname

We don't need a writeable check as both are equally writable

* Replace more references to tab_edit_user_path

* Skip specs for PlaceholderUsers::DeletionService

We will tackle that service in a separate PR.

* Fix module usage of RequireAdminGuard

* Fix group filter for placeholder users

* Fix invalid reference to expect_valid

* Fix: Fix tabbed edit path for placeholder users

* Fix status filtering on users

* Linting

* Improve generalisation of individual principal filter cell

- Check for presence of groups and statuses in order
  to toggle visibility of their UI element.
- Remove groups from placeholder user controller and
  cell initialization and options

* Fix selector on groups assign

* Remove using_shared_fixtures

Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2021-02-12 17:18:55 +01:00