52 Commits

Author SHA1 Message Date
Jan Sandbrink f9d8bc6614 Introduce SubclassResponsibility error
This error is intended for cases when a method is
intentionally not implemented, because the module/class defining
it expects a subclass (or class including the module) to implement
the method.

This is intended to distinguish it from other cases, such as:
* feature not implemented yet
* edge case of a method call not yet supported

Notably it avoids the misuse of the Ruby-defined NotImplementedError,
which is only intended for much more specific scenarios:

> Raised when a feature is not implemented on the current platform. For example, methods depending on the fsync or fork system calls may raise this exception [...]

Also see https://docs.ruby-lang.org/en/master/NotImplementedError.html
2026-03-27 08:14:56 +01:00
Jan Sandbrink 9875e98cb7 Merge pull request #21341 from cheezzz/fix/webhook-user-attribution
Fix: Webhooks show work package author instead of actual updater
2026-03-19 14:41:25 +01:00
Johlan Pretorius c6efb1ac5b Refactor: Move actor to base class with optional keyword argument
Move actor resolution to the caller and actor representation to
RepresentedWebhookJob, keeping WorkPackageWebhookJob simple.
The caller extracts the actor from the journal and passes it as
an optional `actor:` keyword argument, making the feature available
to all webhook types without changing existing method signatures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 13:09:06 +02:00
Alexander Brandon Coles 02a9021f4d Autocorrect Rubocop offenses in EventResources 2025-12-17 20:16:13 -03:00
Alexander Brandon Coles b0d76bdf12 UX/design improvements based on review feedback
- Removes truncation from Events column, instead showing Events grouped
  by Resource with each Resource on its own line.
- Shows warning styling when there are no Enabled Projects or Events.
  While validations currently allow this, it makes the webhook effectively
  pointless, so users should be alerted.
- Capitalizes "No projects" / "No event resources" consistently.
2025-12-17 18:41:48 -03:00
Wieland Lindenthal 60833841d9 Move triggering of work package comment web hooks to own resource
This decouples triggering comment webhooks from work package webhooks.
Thus a workpackage update webhook will still fire, even if the same
update resulted in a comment webhook.
2025-06-25 15:54:22 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Kabiru Mwenja 796e93739e fix(Admin Menu Item): Use absolute path to mitigate routing exception red herring (#16031)
Without absolute paths, the routing definitions seem to implicitly scope within the current engine/namespace (not sure)
Causing an exception like so:

```ruby
# lib/redmine/menu_manager/menu_helper.rb:387 Redmine::MenuManager::MenuHelper#node_url:
[7] pry(#<#<Class:0x0000fffef642dd58>>)> e
=> #<ActionController::UrlGenerationError: No route matches {:action=>"index", :controller=>"storages/webhooks/outgoing/admin", :layout=>nil, :storage_id=>"20"}>
```

---

From [@Klaus's](https://matrix.to/#/!fyQrllnnogDxQuleQW:openproject.org/$nO-kY0NegsJ9E3w-P1Lx3YtgeQeutrQ_ohR0xpsljjg?via=openproject.org) impression it seems using `namespace:` routes is the root cause. But this is still an odd and difficult bug to solve so we should probably think around improving it.

Co-authored-by: Pavel Balashou <p.balashou@openproject.com>
2024-07-03 15:05:01 +03: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
Oliver Günther 337eda7dfa Revert "Revert "Merge pull request #12998 from opf/task/48717-replace-delayedjob""
This reverts commit dfa75621ea.
2024-03-07 13:59:24 +01:00
Markus Kahl dfa75621ea Revert "Merge pull request #12998 from opf/task/48717-replace-delayedjob"
This reverts commit 9f3e4c48ea, reversing
changes made to 10412f7c85.
2024-03-07 12:40:15 +00:00
Pavel Balashou 2267a0a1e3 React on comments from review.
- Do not use string literals for job class names. Use `class.name` instead.
- Rename `ApplicationJob#good_job_scheduled_at` to `ApplicationJob#job_scheduled_at` to be backend agnostic.
- update queries in bin/check-worker-liveness to use good_jobs table
- Set good_job config options through appropriate OpenProject::Configuration
- Remove delayed_jobs table.
- Update health_check docs.
2024-02-27 22:35:33 +01:00
Oliver Günther 8ab39f1393 Fix testing value for cron 2024-02-22 15:07:33 +01:00
Oliver Günther bddc471c58 Replace background check with good_job check 2024-02-19 21:03:27 +01:00
Pavel Balashou fd6a899b29 [#48717] Replace DelayedJob with GoodJob.
https://community.openproject.org/work_packages/48717
2024-02-14 10:18:27 +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
Oliver Günther ee65abaf2d Clean up webhook delivery logs older than 7 days
https://community.openproject.org/wp/43645
2022-08-11 09:45:13 +02:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Oliver Günther ab1e8e43ff Merge remote-tracking branch 'origin/dev' into fix/rails_autoloading_deprecations 2022-05-17 16:13:21 +02:00
luz paz 9e22d420db Fix typos
Found via `codespell -q 3 -S ./config/locales,./modules/xls_export/config/locales,./modules/job_status/config/locales,./modules/two_factor_authentication/config/locales,./modules/backlogs/config/locales/crowdin,./**/config/locales -L ba,nd,parms,pullrequest,pullrequests,sur,varius`
2022-04-15 21:20:17 -04:00
ulferts 3492d08fdd turn OpenProject::Notifications static 2022-04-04 17:08:23 +02:00
ulferts 98f451c302 Feature/40215 restructure email settings (#10415)
* rename user admin menu item

* rename email admin menu item

* restructure api and email admin menus
2022-04-04 07:21:01 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +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
Henriette Darge 2ee3a06c63 * Remove dead links (#9453)
* Use .org website address consistently
* Remove community address as homepage as it does not really offer any value
2021-07-14 15:51:09 +02:00
Oliver Günther d2ce834e23 [37866] Add attachment_created event and webhook (#9418)
* [37866] Add attachment_created event and webhook

* Remove other usages of direct attachment creation

* Add attachment webhook spec

* Fix other webhook specs

* Fix attachment adding in mail_handler

* Don't set content_type outside attachment#file=

* Fix unrelated spec

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
2021-06-29 09:24:11 +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
ulferts 9fa5599392 Feature/member notifications (#8958)
* spec with correctly scoped links

* move db check into own file - fix deprecation

* basic spec for member creation service

* use constants for all notifications

* send an OP notification after member has been created

* send an OP notification after member has been updated

* mails on group member added

Depending on whether the membership existed before or not, an updated or
a created notification is send. This is done asynchronously.

* move all mail sender background jobs into namespace

* wip

* wip

* correct handling group member notifications

* add setting enable/disable mail sending on member alterations

* use services in members controller

* move Notifiable to OpenProject

* remove member after save hooks

* cleanup/testing/linting

* render member mails in receiver locale

* remove add_member! method

* use mailer layout for all mailers

* Update app/services/groups/cleanup_inherited_roles_service.rb

Co-authored-by: Oliver Günther <mail@oliverguenther.de>

* use around callback to avoid prepending

* handle nil params

Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2021-04-20 13:45:42 +02:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
Oliver Günther 3c9be3bdbe [35507] Allow global permission to add and edit users (#8937)
* Add global permission for add_user

* Rename fieldset for global roles to "Global"

* Add permission to admin actions

* Add index action to add_user permission

* Redirect to first admin item if only one

* Hide status action for non admins

* Break down user form into partials for easier rendering

* Disable some user form tabs for non-admins

* Make users API and services conformant with endpoints

* Fix references to DeleteService#deletion_allowed?

* Authorize add_user on show as well

* Only show invite user toolbar item with permission

* Fix Delete Service spec

* Fix the way user prefs are handled in service

* Ensure session_id is treated as string

This causes a cast error otherwise as it passes rack session locally

* Fix service call on onboarding controller

* Fix service call on users controller

* Add delete spec for global user

* Hide login attribute again when adding a new user

* Render auth source correctly in simple form

* Fix creating invited users through service

The invitation requires the mail attribute to be present.

Previously, there was a manual error added to the mail.

As the errors are now determined by the contract + model, we now

end up with all missing properties as errors.

* Properly constraint attributes for non-admins

* Add specs for global user

* Start working on how to update password from UsersController

that code is a mess...

* Change permitted_params spec to include non-admin params

* Fix create user service spec

* Remove mail_notification param from users controller

It's not part of the contract/params passed to user

* Remove todos

* Extend docs

* Correct the way backlogs patches into the user settings

* Remove superfluous UpdateUserService

* Rewrite duplicated update service examples into common shared example

* Remove duplicate password writable check

* Base Users::DeleteContract on base delete contract

* Move checks for active users into the UserAllowedService

* Restore password writable check as it is not an attribute

* Fix menus for global user

* Allow global users to add custom fields

* Allow global user add permission to reinvite user

* Fix changed var name in update service spec

* Ensure also invited or registered users can be authroized

This ensure that e.g., invited users can also be set as watchers

* fix typo

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
2021-02-01 10:45:13 +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
Markus Kahl cc5bebdc81 removed silly 'hook registered' warning 2020-08-11 09:33:00 +01:00
Oliver Günther 10e21154f7 Move asset pipeline javascripts to frontend (#8482)
* ove reporting and reporting_engine js to frontend page

* Replace webhook assets javascript

* Add path augment service to dynamically load scripts

* Remove JS-Files that are not used/not needed any more

* Include AugmentingModule correctly

* Remove special handling for checkbox selection which is outdated and two jquery libs that are not used any more

* Load scripts dynamically that are not needed globally

* Move plugin JS to frontend

* Move toggable fieldsets to global listeners

* Move top-menu to global listeners and convert to TS

* Move action_menu to frontend and port to TS

* Move settings listener to frontend

* Remove global js assets that were not used anyway

* Move date range to timelog dynamic script where it's still used until removed

* Move colors to global-listeners and port to TS

* Replace tooltip with simple form instructions on the one place used

Tooltips were only used at the one place in our application, when changing a users password.
We can simply remove it there and use a modern solution the next time we need a tooltip

* Move danger zone validation to frontend and port to TS

* Move colorcontrast to backlogs vendor where it's used now

* Remove contents of application.js.erb

* Move project and user scripts to dynamically loaded

* Move onboarding tour to dynamically loaded

* Use correct syntax for jQuery so that $ is  known keyword within this function

* Fix onboarding tour

* Fix onboarding tour for scrum tour

* Fix specs after moving JS

* Remove application.js.erb

* Move locales and ckeditor to the frontend to dynamically load

* Remove bundles caches

These are no longer being used since angular cli

* Ensure locales are exported before angular

Co-authored-by: Henriette Darge <h.darge@openproject.com>
2020-07-09 11:02:43 +02:00
Oliver Günther f767e11a28 Restore webhooks js asset 2020-06-30 15:38:34 +02:00
Oliver Günther 623f8c772e Move module assets to frontend 2020-06-29 11:36:39 +02:00
Oliver Günther 489a1b634f [33355] Enable projects for outgoing webhooks
https://community.openproject.com/wp/33355
2020-05-18 14:17:54 +02:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther e3adc26678 Pass in work package to webhook
[ci skip]
2019-11-13 09:18:17 +01:00
Oliver Günther 4944f02e2d Add time entry webhook 2019-11-11 17:06:02 +01:00
Oliver Günther cf52c2cddf Merge remote-tracking branch 'origin/dev' into fix/stable_webhook_events 2019-10-31 13:36:17 +01:00
ulferts 67e3a7a15a let mail sending rely on notifications
That way, the two are no longer intermingled and we can build on the notifications in other use cases like it is already done for the webhooks
2019-10-29 16:00:46 +01:00
ulferts 9acf523f2f linting 2019-10-28 15:59:57 +01:00
Oliver Günther a7ed2e9da0 Rewrite jobs to use ActiveJob syntax 2019-10-25 09:09:45 +02:00
Oliver Günther 54d753262b Fix issues caused by eager loading in production 2019-07-15 15:41:38 +02:00
Oliver Günther bb0f8a5d1a Show version as 'bundled' in admin/info 2019-03-15 12:00:49 +01:00
Oliver Günther 8352af2bf7 Remove module versions 2019-03-15 11:48:36 +01:00
Oliver Günther af176c7b37 [29054] Fix webhooks all_projects usage
Webhooks did not properly respect all_projects setting

https://community.openproject.com/wp/29054
2018-11-20 14:14:48 +01:00