54 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
ulferts 69f6194151 turn factory project independent - move ProjectQuery services and contracts 2024-09-27 09:25:01 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Klaus Zanders f6809fcbbb Users with edit permission are also allowed to edit public queries 2024-07-08 14:32:56 +02:00
Aaron Contreras 8b4d9b00ac Allow users to edit project queries who have the edit permissions 2024-07-08 14:14:23 +02:00
Klaus Zanders db580141cc Move ProjectQuery model to the main namespace 2024-06-26 16:23:10 +02:00
Klaus Zanders 175bacf0e2 Fix specs 2024-05-23 16:59:23 +02:00
Ivan Kuchin 1c9c2efaeb projects queries controller update action with permissive contract 2024-05-07 18:54:21 +02:00
Dombi Attila deb6d6a7f6 Do not allow public views with a deleted owner to be made private.
Making a public view private with a deleted author will end up the query
in a limbo state, where it cannot be accessed nor deleted anymore.
2024-03-26 09:08:07 +02:00
Dombi Attila 0facc5a873 [#53344] Cannot modify a query that was created by a deleted user
https://community.openproject.org/work_packages/53344
2024-03-26 09:08:06 +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
ulferts 71afff4ccc persist columns 2024-03-01 10:03:38 +01:00
ulferts ec29bf8d33 column registration 2024-03-01 10:01:07 +01:00
ulferts 11fc354d20 add columns to static project queries 2024-03-01 09:43:46 +01:00
ulferts 820fc9b561 fall back to "Projects" when changing filters of a persisted or static list 2024-01-26 16:08:53 +01:00
ulferts 749b90cfeb use service for query deletion 2024-01-25 13:49:34 +01:00
ulferts 1d9caaef87 add contract/service for query creation 2024-01-25 13:49:33 +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 f3a6372a66 spec error object is of the model 2023-10-24 11:54:39 +02:00
Klaus Zanders ad787b92e6 Fix all instances where we mocked permissions on nil 2023-10-18 16:15:46 +02:00
Klaus Zanders 0c2011216f Rename methods for mocking to allow_xxx schema
Co-authored-by: Christophe Bliard <c.bliard@openproject.com>
2023-10-16 08:41:06 +02:00
ulferts a00314d2eb adapt specs to altered allowed to mocks 2023-10-13 12:31:46 +02:00
Klaus Zanders e3257c7667 Change calls using mocks on the user to our new mocking helper 2023-10-09 10:44:42 +02:00
Klaus Zanders 78c1e4fadb Switch all uses of principal factories to use new interface 2023-10-09 10:39:44 +02:00
Oliver Günther 117d82e724 Remove show_changes and more_global_index_pages feature flags
https://community.openproject.org/work_packages/49510
https://community.openproject.org/work_packages/49509
2023-08-07 13:38:43 +02:00
Aaron Contreras 38789c5f15 Extract base GlobalCreateService and GlobalCreateContract
Given these were nearly identical for both the `team_planner` and
`calendar` modules, extracted the core functionality into a set of
base classes that can be implemented with the specific `view_type`
that each service wants to create from the Query.
2023-07-19 19:39:04 -05:00
Jonas Jabari 8f555209bd WIP: adding global ical control to settings 2023-06-07 11:57:41 +02:00
Jonas Jabari 468a5cd24e fixed contract specs caused by updates from DEV branch 2023-06-01 11:51:41 +02:00
Jonas Jabari c5eada1aeb prefixed RSpec. in order to align with latest changes in DEV branch 2023-06-01 11:25:30 +02:00
Jonas Jabari 06fb90e423 Merge branch 'dev' into feature/15339-share-project-calendars-using-the-icalendar-format 2023-06-01 11:07:58 +02:00
Oliver Günther ed7ecacb6d Stub a custom non working day that is < yesterday 2023-06-01 09:54:15 +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
ulferts 84278a7fc2 move name validation from query model to contract 2023-05-31 11:54:36 +02:00
Jonas Jabari a605e054ca fixed rubocop and eslint 2023-05-30 18:07:02 +02:00
Jonas Jabari 71ab229392 implemented review feedback from @ulferts 2023-05-30 15:18:46 +02:00
Dombi Attila 951ca34925 [#48001] Restrict timestamps outside enterprise to "yesterday"in query timestamps backend
https://community.openproject.org/work_packages/48001
2023-05-09 14:15:34 +03:00
Dombi Attila 5fa819a54b Remove enterprise_token_helper.rb and the with_enterprise_token method 2023-05-08 08:08:30 +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 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
Oliver Günther 58b64686d8 Add create contract spec for queries 2022-04-04 11:39:42 +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 f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
ulferts 0fe90c21a7 rework hidden/starred of queries
The MenuItems::QueryMenuItems class used to map the `starred` state is replaced by a simple boolean flag. The hidden flag is removed (but still readable) as the concept of `View`s completely replaces it.
2021-12-10 17:37:45 +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
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
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00