86 Commits

Author SHA1 Message Date
Alexander Brandon Coles 5e9f3827f5 Freeze string literals in app/services
rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze app/services
2025-07-18 17:45:24 +01:00
Bruno Pagno 97ccf0bfc5 adjust internal comments internal representation 2025-04-24 13:12:32 +02:00
Bruno Pagno c2886046cd update comment permission names 2025-04-24 13:12:32 +02:00
Bruno Pagno 924d15080e Update app/services/notifications/create_from_model_service/work_package_strategy.rb
Co-authored-by: Kabiru Mwenja <k.mwenja@openproject.com>
2025-04-10 13:09:25 +02:00
Bruno Pagno 451a2f0a13 comment with clarification 2025-04-10 11:59:00 +02:00
Bruno Pagno dfac1c9c56 notifications for internal comments 2025-04-10 10:55:29 +02:00
Kabiru Mwenja dbf8decaf5 [Op#60985] Ensure notifications work in both restricted and unrestricted state independent of permission changes
https://community.openproject.org/work_packages/60985
2025-04-10 10:55:29 +02:00
Jan Sandbrink c0d59d730d Make some files ready for frozen string literals
During a previous test, added the frozen string literal comment
to all Ruby files, to see how our codebase would react to that.

The test run uncovered a few files that were trying to modify strings
that originate from string literals. This commit is changed some
of them to be safe under frozen string literals and freezes literals
in the affected files.
2025-02-21 16:27:12 +01:00
ulferts 311e0d7283 sent notifications to users mentioning themselves again
But still prevent sending notification when the user is part of a group they mention.
2024-10-21 14:31:18 +02:00
Christophe Bliard 1ad3b4ed4d [57251] Fix mail_alert_sent not being set correctly on update
https://community.openproject.org/wp/57251

When a notification exists for a work package journal for a reason other
than :mentioned, then its `mail_alert_sent` value is `nil`.

On a subsequent update of the work package which mentions the user, the
existing notification is updated. In this update, the `mail_alert_sent`
value must be changed from `nil` to `false` if the reason is :mentioned.
Without it, the immediate notification email for the mention would not
be sent.
2024-10-15 09:14:43 +02:00
ulferts 80408a5827 Merge remote-tracking branch 'origin/release/14.4' into dev 2024-08-23 08:51:14 +02:00
ulferts eb98b082a0 remove explicit project column from notifications 2024-08-22 10:07:15 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Aaron Contreras 0db3b6e7c8 Merge pull request #15734 from opf/bug/55255-notifications-are-sent-to-the-author-if-the-author-is-member-of-a-mentioned-group
[#55255] Notifications are sent to the author if the author is member of a @mentioned group
2024-06-04 10:11:53 -05:00
Dombi Attila fbcae1e21a [#55255] Notifications are sent to the author if the author is member of a @mentioned group
https://community.openproject.org/work_packages/55255
2024-06-03 21:49:55 +03:00
ulferts 4896c34178 fix signaling on the mail_alert_sent
It is now possible to distinguish by reason whether the mail_alert_sent field is set to true, nil or false.

This didn`t suffice though to have the immediate_reminders user preference handled for mentioning mails. Ideally, the preference would be handled
in the CreateFromModelService to have the field set correctly right away. This does not work with the current structure though so the alternative
of bailing on actually sending the mail is used. The property is then set to nil by that service upon identifying the user as not wanting
to receive mails
2024-06-03 13:48:18 +02:00
Ivan Kuchin fa5d03eae0 rubocop safe autocorrect all except Rails/WhereRange 2024-05-30 19:54:08 +02:00
Christophe Bliard 8fa8584538 Run rubocop --autocorrect on all files
Only the safe cops have run. rubocop version is 1.59.0.
2024-01-05 15:27:09 +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 6991520bf1 add shared to notification creation and notification center 2023-10-26 11:00:45 +02:00
ulferts a328940c3a merge wiki_content into page 2023-04-05 10:05:20 +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
ulferts caf4588dcf fix mentioning multiple users in a single line
Because of the .* introduced for excluding quoted lines, which is
greedy, only the last match was taken.

Now the quoted lines are excluded first. That leads to a simpler regexp.
2023-03-03 09:44:58 +01:00
Christophe Bliard 6961ab55e0 Reflow comments 2023-02-27 11:28:34 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Dombi Attila 5f81d8a773 [#45020] Replies to comments in which I was mentioned do create new, undesired notifications
https://community.openproject.org/work_packages/45020
2022-11-30 11:55:02 +01:00
Sven R. Kunze c92cf9eefe added feature spec to ensure that self-mentioning is secured 2022-11-04 00:48:15 +01:00
Sven R. Kunze 64ea334ad2 allow user to self-mention them in comments and work-package descriptions 2022-11-02 20:02:15 +01:00
Dmitrii 68d073c2cc [#43675] Migration splitting involved notification setting and date defaults 2022-09-27 22:22:24 +02:00
ulferts a7febaf6a0 remove journal aggregate event 2022-07-06 17:47:55 +02:00
ulferts 1f8b81e04b open up updating existing notifications 2022-07-06 17:10:51 +02:00
ulferts a16dfcfad9 linting 2022-07-06 17:10:43 +02:00
ulferts 67e0039f72 handling existing notifications on creation -> update or destroy 2022-07-06 17:10:35 +02: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
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther 900ca53c18 [39177] Fix double mentioned notifications
By causing aggregated journals to update mentioned notifications before
the predecessor journal is destroyed, we can keep information about a
mention in the notification realm and skip creating another notification
for the same mention.

https://community.openproject.org/wp/39177
2021-11-09 15:51:29 +01:00
ulferts aff788bdf6 Merge remote-tracking branch 'origin/dev' into implementation/38884-notifications-send-out-mention-mail-on-mentioning 2021-10-01 11:39:21 +02:00
ulferts bbf05016b4 prevent non work package notifications to leak via the API 2021-10-01 09:50:43 +02:00
ulferts c92335606c remove self mail prevention
Notification creation prevents self notification which in turn prevents self mailing
2021-09-30 12:59:26 +02:00
ulferts 8aca19d827 sending empty mail on mentioning 2021-09-30 12:59:26 +02:00
Oliver Günther 18e4c37cf3 Fix setting of mail_reminder and mail_alert in create_from_model_service 2021-09-29 18:00:03 +02:00
Oliver Günther 528ca50faa Strip sent_mail into two columns mail_alert_sent and mail_reminder_sent 2021-09-28 22:01:59 +02:00
Oliver Günther 8dec991d01 Remove channel from non-wp PR 2021-09-28 22:01:59 +02:00
Oliver Günther 3109d7bafa Deliver notification mails immediately to run in same transaction 2021-09-28 22:01:58 +02:00
Oliver Günther 5b8df97498 Rename read_mail_digest into sent_mail and merge with non-wp items 2021-09-28 20:38:19 +02:00
Oliver Günther e3913e61e4 Remove read_mail, reason_mail, reason_mail_digest 2021-09-28 20:38:18 +02:00
Oliver Günther 612572190a Remove notified events 2021-09-27 10:55:26 +02:00
Oliver Günther f4f3730561 Review feedback 2021-09-27 10:55:25 +02:00
Oliver Günther fa5d40d0bf Fix involved -> assigned, responsible reasons 2021-09-27 10:55:25 +02:00