35 Commits

Author SHA1 Message Date
David F 3897c25139 Move autocomplete_options from FilterComponent to filter classes. wp/74380
As per review feedback from oliverguenther.
2026-05-26 08:14:56 +02:00
Oliver Günther 3b3791f9ec Use correct configuration for group filter on user administration
https://community.openproject.org/work_packages/74763
2026-05-20 09:18:57 +02:00
Oliver Günther 0dbb9f9e4b Allow configuring users table 2026-05-13 13:11:18 +02:00
Oliver Günther c950be910e Convert custom filters on user administration to standard query 2026-05-08 13:34:21 +02:00
Klaus Zanders a11b28a041 Fix potential SQL injection via direction 2026-05-08 10:41:20 +02:00
Klaus Zanders e392f22e1d Allow sorting and selecting custom fields in user filters as well 2026-05-08 10:27:15 +02:00
Klaus Zanders 502400bc31 Add custom field filters to the UserQuery 2026-05-08 09:28:52 +02:00
Klaus Zanders 4e0634458c Introduce UserQuery model that is persisted trough PersistedQuery 2026-04-23 10:38:05 +02: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
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
ulferts 83bd82d33d persisted project queries 2024-01-25 13:49:25 +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
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +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
Oliver Günther 3b455b8129 Move base filter and order into their namespaces 2021-09-13 14:19:12 +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
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
Oliver Günther cdf3cf4c34 [36136] Rework members page to show name and avatars for principals (#8973)
* Rewrite members page to output name column

* Remove white-space nowrap for long login names in administration

* Extend member specs

* Allow query instance to be used in table cell

* Fix memberships specs with changed columns

* Add order for email

* Review feedback

* Allow x to close add member form

* WIP sort firstname/lastname

* Make status sortable

* Extract order_by_name into the order class

* Re-add but deprecate order_by_name

It's still in use in combination with some special scopes

(custom actions for example) that I don't want to remove right now

* Rewrite order_by_name into scope
2021-02-11 09:33:43 +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
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
ulferts 00a31728fc increase strictness on regexp for default orders
Otherwise partial matches would also count e.g. is_public matches as
public is a substring.
2019-11-06 13:55:46 +01:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Jens Ulferts 690e0ffc60 wp create/update/destroy via services 2017-11-29 15:27:29 +01:00
Oliver Günther 97f7c3a592 [26298] re-add filtering by mail through special filters (#5915)
https://community.openproject.com/wp/26298

[ci skip]
2017-09-13 09:22:18 +02:00
ulferts daa1a4d4b7 fixes filtering members by group (#5800)
additionally fixes:
* with "all" selected, all members are shown, not only those being
active, invited or registered
* with "locked" selected, locked users are now displayed.
* the Project#members_principals associations lacked the `references`
method which lead to the users table being undefined in the resulting
query.

In order to achive the bug fixes, the member filtering is now based on
the query engine also used for users, queries, work_packages, ... As a
lot of the members filters are very similar to user filters (in fact, a lot of the
members filter work on the users model), those filters are shared via
modules.

[ci skip]
2017-07-31 18:13:51 +02:00
Jens Ulferts 33545b9e39 refactor query filter statements into distinct classes 2017-04-10 23:10:37 +02:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Oliver Günther 1768b82934 Merge remote-tracking branch 'origin/release/6.1' into dev 2017-01-10 07:41:33 +01:00
Jens Ulferts a52c8ee07d allow for filtering the queries in the API v3
Only implements the `project` filter for now which can be used to differntiate between queries from specific projects and can also be used to specify that the client is only interested in global queries
2016-12-22 08:53:31 +01:00
Markus Kahl 7ba5b261a6 added login filter; fixed status filter 2016-12-21 10:59:47 +01:00
Oliver Günther a4df9f9bb6 Write accessors to model and default_scope as methods
Otherwise, they are define when the query is loaded and that might be
before other descendants of user are known.
2016-11-03 12:12:31 +01:00
Jens Ulferts d4e71fd67e add user query and enabled it in the users api 2016-11-03 10:13:19 +01:00