124 Commits

Author SHA1 Message Date
Oliver Günther c950be910e Convert custom filters on user administration to standard query 2026-05-08 13:34:21 +02:00
Oliver Günther 30b5e4e621 Force password change when sending out passwords via email 2026-05-04 09:08:48 +02:00
OpenProject Actions CI 72e8cc1e8f Merge branch 'release/17.0' into release/17.1 2026-02-25 13:22:11 +00:00
Klaus Zanders 3bd94efa49 Add check to not allow resend_invitation on admins by non-admins 2026-02-25 13:56:43 +01:00
OpenProject Actions CI 157eb3d5dd Merge branch 'release/17.0' into dev 2026-01-23 10:20:03 +00:00
Klaus Zanders b9c8877fd5 Incorporate review feedback
- Use helper methods to avoid AbcSize complaint
- Make tests more robust to test all cases
2026-01-22 12:50:35 +01:00
Klaus Zanders 0a2f3ecd18 Show links to manage user status for users with manage_user permission 2026-01-20 15:06:47 +01:00
Klaus Zanders f5eb4a7f83 Merge pull request #21192 from opf/no-edit-email-for-edit-user
Email address can only be edited by global admins
2025-12-01 09:35:30 +01:00
Henriette Darge 313127fb5c Fix tests
Update config/locales/en.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update app/views/my/account.html.erb

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update app/forms/my/account_form.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

Update app/forms/my/account_form.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

Update app/forms/my/account_form.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

Apply suggestion from @myabc

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
2025-11-26 16:29:25 +01:00
Klaus Zanders 096dd5e915 Fix specs for update controller 2025-11-26 12:14:54 +01:00
Jan Sandbrink e400fd7e4c Allow changing password if it exists
Previously we'd be hiding the "change password" dialog on the
basis of an external authentication method existing. However, that's
not enough, because (at least with user remapping enabled) it's possible
that a user that logged in via password once, gained the ability to login
through SSO afterwards. Such a user then can use both mean to authenticate,
thus they also need to be able to change a potentially compromised password.

Much more work is needed here: Users need to be aware that their password still
works, they need to be able to delete a password if they only want to use SSO and
maybe there's also a use case for deleting an SSO association and going back to
password-based logins. However, all of these things require more UI changes and
some proper product development first.

This change is a first step to improve the situation.
2025-11-10 14:00:02 +01:00
Oliver Günther 0f1f0e62cb Reduce visibility of principals to common memberships or view_all_principals permission 2025-10-23 12:59:56 +02:00
Pavel Balashou f5da66ccb7 [#66996] Hide deleted users from everywhere.
https://community.openproject.org/work_packages/66996
2025-08-29 17:05:08 +02: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 8f83971f0e Merge remote-tracking branch 'origin/dev' into experiment/enable-turbo-drive 2024-10-28 13:23:21 +01:00
Dombi Attila 84505e2dfb [#58144] Show email on the UI for users with permission
https://community.openproject.org/work_packages/58144
Remove hide_mail flag and replace with :view_user_email permission checks
2024-10-28 09:09:56 +01:00
Oliver Günther 47d62ba9df Fix renders after redirect 2024-10-11 08:43:01 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Oliver Günther 25bf47039e Changed condition 404 -> 200
The user can no be viewed, even if subsequent information on
groups/memberships are hidden
2024-07-01 09:13:55 +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
Henriette Darge 89eeb82251 [36521] Saving changes to user profile after handling error message leads to user profile instead of edit user page (#15018)
* instead of redirecting to user profile page, stay on edit page

* Adapt test

---------

Co-authored-by: bsatarnejad <b.satarnejad@gmail.com>
2024-03-18 16:50:09 +01:00
Aaron Contreras fa9a44d24b Run rubocop -a on spec 2024-03-01 18:34:17 -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
Henriette Darge 557d4b79ed Change the text of the user limit warning 2023-11-20 08:46:10 +01:00
Oliver Günther d60120f1fb Adapt specs now that login_required defaults to true 2023-11-08 11:30:58 +01:00
ulferts 60ed64cd04 use error_messages_for method now 2023-10-24 12:06:36 +02:00
ulferts 2b2abf864a introduce ProjectRole model 2023-10-09 14:34:20 +02:00
Christophe Bliard 75fd784ac1 Forbid any update on admin unless user is admin themselves
This means a user with manage_user global permission can no longer update admin attributes.
2023-09-25 11:32:11 +02:00
Christophe Bliard 638a953776 Add controller test for user admin flag update 2023-09-25 11:32:10 +02:00
Christophe Bliard e33bc7d11f refactor spec: differentiate user being requested and user requesting 2023-09-25 11:32:07 +02:00
Christophe Bliard 051fb27915 Fix multiline #describe text in specs 2023-09-25 11:32:06 +02:00
Oliver Günther e32d2d0058 Remove AuthSource base namespace, model 2023-07-27 08:16:43 +02:00
Oliver Günther befab7b4af Add "My activity" link to account menu
https://community.openproject.org/work_packages/48624
2023-06-20 22:55:00 +02:00
Christophe Bliard 914272c6cf Only allow available languages for Setting.default_language
- Store the language information everywhere as string instead of symbol.
- Remove pt-BR from default available_languages as pt is already there.
2023-06-06 11:46:24 +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 9e865b4f7b lint: Run rubocop safe autocorrect
Command is `rubocop --safe --autocorrect app lib lib_static modules spec`
2023-03-09 10:25:57 +01: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 09c76f987c refactor: Reduce code duplication
`Activities::DaysComponent` factorizes the code to generate the HTML for
the activities per days.

By moving `journal` into `Activities::Event`, `journals_by_id` does not
need to be passed around anymore. Eager loading of journals is moved to
`Activities::Fetcher` instead of being handled by the controller. It
also means that the atom feed will be slower as it does not need the
journals information.
2023-02-16 16:34:07 +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
Oliver Günther ab0825ed25 Provide better message when users are deleted in background
https://community.openproject.org/wp/45459
2023-01-04 16:53:33 +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 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
Oliver Günther 9636a08988 [26688] In-app notifications (#9399)
* Add bell icon to icon font

* Add in app notification in top menu

* Add fullscreen modal

* Add notification modal and items

* Style items

* Toggle details of item

* Mark all read

* Add no results box

* wip specification for event api

* Add events table, query and index

* Send out events from WP notification mailer job

There we have the recipients present

* Add cleanup job for older events with a setting

* Hide bell notification when not logged

* Add specs for events API index/show

* Fix setting yml key

* remove pry in event creation

* Fix before hook in events API to after_validation

* Fix polymorphic association raising exception for aggregated journals

* Fix typo in read_ian

* Fix yml entry for mentioned

* Add read/unread post actions to event API and add specs

* Wire up API to frontend

* Fix order on events

* Switch to unread in notification

* Add event query

* rename WPEventService

* route wp mail sending over events

* rename spec methods

* author becomes watcher

* correct message call signature

* rename events to notifications

* renname parameter to reflect notification nature

* create author watcher for existing work packages

* Merge unreadCount from store

* Take a stab at polymorphic representers

* Fix link generation in polymorphic resources

For journals, no title is being generated however

* Fix frontend model for context

* Use timer for polling

* add notification_setting data layer

* Fix show resource spec

* Fix duplicate class in notification bell item

* Add minimal feature spec for notification

* API for notification settings

* Persist notifications

* adapt work package notification creation to notification settings

* extract notified_on_all

* consolidate wp#recipients

* concentrate wp notification in journal service

* simplify methods

* Remove unused patch endpoint

* Add specs for rendering and parsing notification settings

* Contract spec

* Update service spec

* adapt specs

* Angular notifications frontend

commit e29dced64699eb5f2443b9307c78343c9a58d1ee
Author: Wieland Lindenthal <w.lindenthal@forkmerge.com>
Date:   Mon Jun 21 17:34:50 2021 +0200

    Create Akita store and query for notification settings

commit 1a45c26c1a0c147d15393e49d2625aca4851a64d
Author: Wieland Lindenthal <w.lindenthal@forkmerge.com>
Date:   Mon Jun 21 11:09:25 2021 +0200

    Remove tabs from notificaition settings page

commit 0ea21e90c13a197f8bf2cfba1b60ddcff4e5e827
Author: Oliver Günther <mail@oliverguenther.de>
Date:   Sun Jun 20 21:55:48 2021 +0200

    WIP in app settings

* migrate notification data

* add project visible filter to project query

* Add inline-create and table display grouped by project

* Add notifications under admin/users

* Remove notifications partial

* Rename notififcations store to user preferences store

* Add setting for self_notified and hook that up to the backend

* Add aria-label to table checkboxes

* Restyle table and toolbar

* replace remains of mail_notifications attribute

* initialize notification settings for new user

* adapt my_preferences references

* reenable no self notified for documents

* adapt specs

* Avoid has_many :notifcation_settings

Rails magically autosaves the user's preferences when the user gets saved,
which somehow also tries to save the notfifications even when unchanged.

This breaks some specs such as the avatar upload spec. As we can't update the assocation
through rails anyway, just delegate to the user for reading instead.

* Restore update method of notification settings

* Restore update spec

* fix spec syntax

* lint scss

* linting

* Fix content_tag for bell icon

* Add feature specs for notification settings

* Disable ContentTag cop

* use visible filter to get projects for notification

The visible filter will reduce the project list down to the set of projects visible to the user provided as a parameter. This includes public projects.

* test for actual mail sending

* adapt me resource path

this.apiV3Service.users.me changed its type in 0d6c0b6bc7

* Implement changed migration

* Linting

* Add actor to notification representer

* Fix factory creating a duplicate WP journal

* Add work packages loading and journal details to notification entry component

* IAN basic facets, keep and expanded states.

* Fix notification bell spec

* Render body separately and add auto updating relative time

* Add fixedTime title

* Add actor to notification entry

* Fix clicking links on work package and project

* Tiny styling changes on entry row

* Disable count in notification if larger than 99 (wont fit)

* Introduce virtual scrolling to entry table

* allow delaying & prevent mail sending if ain read

Introduces a setting to delay mail sending after a journal aggregation time has expired. That way, users can confirm a notification in app. If they do before the delay expires, no mail is sent out additionally for that user.

* consolidate notifications (in&out) into shared admin menu

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
Co-authored-by: Wieland Lindenthal <w.lindenthal@forkmerge.com>
2021-06-24 14:03:29 +02:00