64 Commits

Author SHA1 Message Date
Alexander Brandon Coles f15be6e07f Freeze string literals in app/controllers
rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze app/controllers
2025-07-18 17:51:00 +01:00
Pavel Balashou e7a482de17 [#57664] Fix error when viewing inactive user activity.
`#determine_author` can raise `ActiveRecord::RecordNotFound` if user does not
exist or is inactive. Use `rescue_from` to catch it and send appropriate
response.

Fixes https://community.openproject.org/wp/57664
Fixes https://appsignal.com/openproject-gmbh/sites/66b224a4d30d867bed8a1772/exceptions/incidents/461

Co-authored-by: Christophe Bliard <176055+cbliard@users.noreply.github.com>
2024-09-10 14:14:18 +02:00
Oliver Günther e523f7abba Provide better error when no projects are visible 2024-09-02 17:17:58 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
ulferts 563229dc3e rename method for clarity 2024-06-10 17:19:55 +02:00
ulferts ed5a162230 allow actions to be called on those not using default authorization before_actions 2024-06-07 16:55:40 +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
Christophe Bliard cd51c506e0 [52561] Fix user filter on activity page
The `@author` instance variable must be set before creating the
`@activity` object.
2024-02-01 17:31: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
ulferts 00b4167007 remove outdated activity session 2023-07-20 16:38:15 +02:00
Aaron Contreras d1aa21783a Add the Activity items to the global menu
Adds the "Activity" top-level item and the drilled down descendant
where the filters are present.

As a bonus, spec is running with cuprite :)
2023-07-12 09:19:12 -05:00
ulferts 7341b98b48 move the activity sidebar into the menu 2023-07-03 16:22:34 +02:00
Christophe Bliard 0f90fc4cb7 Pass activity_page for diff back link without using global state 2023-02-22 16:37:26 +01:00
Christophe Bliard 02673ed212 [46190] Link back button of diff page to the correct page
https://community.openproject.org/wp/46190
2023-02-21 18:06:52 +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 c1202db64a Prevent N+1 issue when displaying project activities
The journals relations are eager loaded to display the changes in the
activities page.
2023-01-20 10:14:08 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Oliver Günther 3fdbc9d1c0 Use datetime object for timestamps, not dates 2022-08-24 21:27:01 +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 ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +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
ulferts 64d0f57d85 Feature/aggregated activities (#8221)
* use cte for aggregated journal

* Revert "use cte for aggregated journal"

This reverts commit 5fedefefdd.

* add another subselect that could later on be provided from the outside

* allow passing a nukleous sql to aggregated journals

* wip - using aggregated journal for activity

* new sql for aggregated journals

* start implementing new aggregated query

* additional documentation

* consolidate activity functionality

* simplify by turing into instance methods

* move activity fetcher out of redmine

* remove verb verification made obsolete

Without catchall routes, the dispatching handles it

* remove duplicate authorize check

* refactor activities controller

* refactory activity fetcher

* cache avatar file

* sort choosable events

* remove legacy spec covered by contemporary

* speed up aggregated journals via CTE

* instance var might never have been set

* ensure the event_types are always transmitted

* correctly reset the avatar cache

* fix avatar fetcher expectation regarding wiki pages

* adapt spec

[ci skip]
2020-04-27 08:04:28 +02:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther dd3237f32e Don't use finder on User objects
They may be missing
2019-04-15 13:58:09 +02:00
Oliver Günther 0ac0c014f3 [29673] Avoid stale? with CSP nonces
Not all headers treat 304 responses equally, some do replay the CSP
headers from the original 200 GET, but we cannot rely on that.

If the header is not replayed, the frontend-cached nonces will not be
valid resulting in a CSP violation.

```
References:
https://github.com/w3c/webappsec-csp/issues/161
https://bugs.chromium.org/p/chromium/issues/detail?id=174301
```

https://community.openproject.com/wp/29673
2019-03-07 09:30:42 +01:00
Jens Ulferts 6c669aab6e Merge branch 'release/7.4' into dev 2018-06-20 13:22:30 +02:00
Jens Ulferts 01c4fcc7f3 linting 2018-06-11 09:24:13 +02:00
Henriette Dinger 494b76110c Add color to stale check (#6165) 2018-02-20 15:07:46 +01:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Oliver Günther fe0e8dd919 Rename before_filter to before_action 2016-09-06 15:40:49 +02:00
Oliver Günther 34893071e1 Format dates according to the user's timezone
By default, the date headlines of activities will be output with UTC+0,
which may pose a problem when work in different timezones.
2016-02-09 21:00:08 +01:00
Alex Coles 0ad3cfb4b2 Prefer do…end for controller respond_to blocks
`rubocop -a` does not currently normalise formatting consistently
(see ec1bb39f).

Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-07-07 19:44:22 +02:00
Alex Coles ec1bb39f9b Fix syntax (w/Rubocop) in (Rails) controllers
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-06-30 12:08:27 +02:00
Alex Coles e0191e759c Update year in copyright header to 2015
[ci skip]
2015-01-01 00:02:57 +00:00
Alex Coles bb0e6e6aa5 Fix syntax (w/Rubocop) in (Rails) controllers
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2014-11-03 22:15:11 +01:00
Alex Coles 336446c59d Use 1.9+ Hash syntax in (Rails) controllers
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2014-11-03 22:15:11 +01:00
Johannes Wollert 8b096975fe updates copyright headers
updates more copyright

more copyright headers
2014-02-27 16:39:51 +01:00
Hagen Schink 740d896f08 Differs between activity view states 2014-01-30 09:06:09 +01:00
Hagen Schink 6b0fdf399e Removes selection of default activities 2014-01-23 16:20:02 +01:00
Hagen Schink dba223e029 Fixes specs by renaming event properties 2013-12-02 18:34:23 +01:00
Hagen Schink 67f9bf6966 Simplifies censor method 2013-12-02 18:34:23 +01:00
Hagen Schink 6a62ddc40e Changes event data structure 2013-12-02 18:34:21 +01:00
Hagen Schink 6537d8aaaa Renames settings 2013-09-20 14:27:06 +02:00
Philipp Tessenow a1e67dd460 new copyright header #1903 2013-09-16 17:59:31 +02:00
Hagen Schink d0ca65dbaf Introduces journable
Journable introduces a connection between a journal and the journalized
object.
2013-08-20 16:19:22 +02:00