Commit Graph

3303 Commits

Author SHA1 Message Date
Go MAEDA
ec73d02347 Fix slow loading of global spent time list in MySQL (#40728).
In MySQL, the query to retrieve the global spent time list is sometimes extremely slow (taking several minutes in some environments) due to an inefficient join order chosen by the query optimizer. This patch adds an optimizer hint to improve the join order and ensure consistent performance.

Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23609 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-04-08 01:30:37 +00:00
Go MAEDA
508c1fd548 Improve performance of TimeEntry#assignable_users by reducing SQL queries (#35927).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23595 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-04-02 09:22:35 +00:00
Marius Balteanu
472d2a2797 Fixes wrong condition added in r23586 (#13596).
git-svn-id: https://svn.redmine.org/redmine/trunk@23589 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-03-30 08:59:54 +00:00
Marius Balteanu
59daaa27e9 Fixes rubocop offense "[Correctable] Lint/SafeNavigationConsistency: Use . instead of unnecessary &.." (#13596).
git-svn-id: https://svn.redmine.org/redmine/trunk@23588 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-03-30 08:31:05 +00:00
Marius Balteanu
3c57eaffd4 Add administration setting to allow time logging on closed issues. By default, the setting is enabled (#13596).
git-svn-id: https://svn.redmine.org/redmine/trunk@23586 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-03-30 07:48:53 +00:00
Marius Balteanu
77c6556ea7 Adds missing files (#42352).
Patch by Holger Just (user:hjust).

git-svn-id: https://svn.redmine.org/redmine/trunk@23532 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-03-10 00:32:13 +00:00
Marius Balteanu
1f46b0b236 Extract project query for admins to a separate ProjectAdminQuery model (#42352).
Patch by Holger Just (user:hjust).

git-svn-id: https://svn.redmine.org/redmine/trunk@23531 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-03-09 23:25:12 +00:00
Marius Balteanu
3c5f0af44d Ensure that a UserQuery can only be viewed or edited by admins (#42352).
Patch by Holger Just (user:hjust).

git-svn-id: https://svn.redmine.org/redmine/trunk@23530 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-03-09 23:22:46 +00:00
Marius Balteanu
10971361fa Allow query class to select layout for QueriesController (#42352).
Patch by Holger Just (user:hjust).

git-svn-id: https://svn.redmine.org/redmine/trunk@23529 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-03-09 23:20:50 +00:00
Go MAEDA
b15b5f72b3 Fix RuboCop Style/SuperArguments (#41884).
git-svn-id: https://svn.redmine.org/redmine/trunk@23491 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-02-06 04:06:02 +00:00
Go MAEDA
c252857414 Reduce SQL queries triggered by empty? and one? in TimeEntryActivity.default_activity_id by preloading available_activities (#42150).
git-svn-id: https://svn.redmine.org/redmine/trunk@23478 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-01-30 03:34:38 +00:00
Go MAEDA
7aacf5718c Optimize TimeEntryActivity#default_activity_id method by introducing early returns to reduce SQL queries (#42150).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23477 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-01-29 09:40:28 +00:00
Go MAEDA
7ca4cf24c0 Refactor Member#role_ids= method for improved clarity and effficiency in removing obsolete member roles (#42124).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23451 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-01-21 01:50:28 +00:00
Go MAEDA
2ffe3fa547 Optimize Version#wiki_page method (#42121).
Avoid unnecessary evaluation of `project.wiki` when `wiki_page_title` is blank, reducing redundant SQL queries.

Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23450 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-01-20 08:36:22 +00:00
Go MAEDA
382ff17fa4 Member roles are incorrectly added when a user's memberships are updated (#42106).
Patch by Thomas Löber (user:tloeber) and Mizuki ISHIKAWA (user:ishikawa999).


git-svn-id: https://svn.redmine.org/redmine/trunk@23449 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-01-19 07:32:26 +00:00
Go MAEDA
0dcc20eed3 Preload tracker when retrieving journal events to improve Activity view performance (#42077).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23447 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-01-18 05:37:55 +00:00
Go MAEDA
cf4a72d3f5 Optimize journalized method to use preloaded Issue association for better Activity view performance (#42077).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23446 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-01-18 05:36:19 +00:00
Go MAEDA
3712ecb01f Fix NoMethodError in IssuePriority#high and #low when no default or active priorities exist (#42066).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23431 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-01-05 03:04:59 +00:00
Go MAEDA
b437ebda49 FrozenError when using SQLite3 gem version 2.0.0 or later (#41860).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23308 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-11-25 06:17:20 +00:00
Marius Balteanu
db0ac01d3d Fixes project query scope that does not take into account limit and offset options (#41791).
git-svn-id: https://svn.redmine.org/redmine/trunk@23300 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-11-23 11:17:54 +00:00
Marius Balteanu
586020045b @ProjectQuery#results_scope@ should return @Project::ActiveRecord_Relation@ to keep the backward compatibility (#41678, #23954).
Patch by Nishida Yuya (user:nishidayuya).



git-svn-id: https://svn.redmine.org/redmine/trunk@23187 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-11-03 11:56:23 +00:00
Go MAEDA
c54474eccc Fix: "Import issues" and "Import time entries" pages are visible to users without "Add issues" and "Log spent time" permissions (#41465).
Patch by Kenta Kumojima (user:kumojima).


git-svn-id: https://svn.redmine.org/redmine/trunk@23178 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-11-03 05:41:19 +00:00
Go MAEDA
a253cd1636 Fix: updated_by_id in Journal points to a deleted user instead of an anonymous user (#41572).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23169 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-10-29 01:02:04 +00:00
Go MAEDA
1d46be8b0f Fix CSV import file encoding auto-detection failure with multibyte characters (#41464).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23150 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-10-20 06:47:28 +00:00
Go MAEDA
95add1af5c Include attachment filename in "File added" email notification subject (#41450).
Patch by minoura makoto (user:minoura).


git-svn-id: https://svn.redmine.org/redmine/trunk@23148 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-10-20 04:46:37 +00:00
Go MAEDA
09451a1df0 Fix RuboCop offense Lint/SafeNavigationConsistency (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@23134 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-10-16 23:46:53 +00:00
Go MAEDA
52deba3abf Replace custom email normalization logic with Rails' normalizes method (#29208).
git-svn-id: https://svn.redmine.org/redmine/trunk@23064 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-20 01:58:08 +00:00
Go MAEDA
94d9a2337b Add "Author / Previous assignee" group to assignee dropdown in issue form (#16045).
Patch by Luka Lüdicke (user:dkd-luedicke), Mizuki ISHIKAWA (user:ishikawa999), and Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23059 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-15 06:31:30 +00:00
Go MAEDA
68121841b5 Fix NoMethodError in Issue#blocked? due to invalid issue_from_id in Issue#relations_from (#8539).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23048 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-10 00:55:32 +00:00
Go MAEDA
b7120cfe3a Remove unnecessary rubocop:disable directive for Style/EmptyLiteral (#39887).
RuboCop’s Style/EmptyLiteral false positive for `Hash.new([])` was resolved in RuboCop 1.66.1. This commit updates the RuboCop version to 1.66.1 and removes the now-unnecessary `rubocop:disable` directives.


git-svn-id: https://svn.redmine.org/redmine/trunk@23013 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-05 00:49:54 +00:00
Go MAEDA
d24d11a682 Fix RuboCop offense Style/StringChars (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@23009 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-01 06:05:39 +00:00
Go MAEDA
eee5d73ee1 Revert r23002 (#39887).
The change caused a test failure:

```
Failure:
UserTest#test_accessing_projects_by_role_with_no_projects_should_return_an_empty_array [test/unit/user_test.rb:1048]:
Expected: []
  Actual: nil
```


git-svn-id: https://svn.redmine.org/redmine/trunk@23006 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-01 01:33:00 +00:00
Go MAEDA
2190a4b417 Disable RuboCop Lint/InterpolationCheck for USER_FORMATS in app/models/user.rb (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@23005 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-01 01:02:38 +00:00
Go MAEDA
987a36281a Fix RuboCop offense Style/EmptyLiteral (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@23002 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-01 00:42:33 +00:00
Go MAEDA
2fe36c4128 Fix RuboCop offense Style/RedundantInterpolationUnfreeze (#39887).
Since interpolated strings are always unfrozen in Ruby 3.0 and later, the use of `+""` is now redundant.


git-svn-id: https://svn.redmine.org/redmine/trunk@23001 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-09-01 00:38:01 +00:00
Go MAEDA
8da72cb712 Fix precision issues in TimeEntry#hours calculation by returning Rational instead of Float (#40914).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@23000 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-31 09:26:50 +00:00
Go MAEDA
fdd90bab2b Fix RuboCop offenses Style/NegatedIf and Style/NegatedWhile (#39887, #7770).
git-svn-id: https://svn.redmine.org/redmine/trunk@22987 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-25 08:44:33 +00:00
Go MAEDA
c2eb20e434 Fix RuboCop offense Style/ClassEqualityComparison (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@22978 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-21 13:45:13 +00:00
Go MAEDA
9cc3542fa1 Introduce active? method to Group via Principal model (#27510).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@22976 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-21 08:05:59 +00:00
Go MAEDA
643b4ebb08 Add filters for "Author's group" and "Author's role" to issues list (#7867).
Patch by Takenori TAKAKI (user:takenory).


git-svn-id: https://svn.redmine.org/redmine/trunk@22975 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-21 07:47:27 +00:00
Go MAEDA
93645a279e Use anonymous block forwarding introduced in Ruby 3.1 (#38585).
git-svn-id: https://svn.redmine.org/redmine/trunk@22973 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-21 00:46:15 +00:00
Go MAEDA
c069ea3a24 Use Array#intersect? introduced in Ruby 3.1 (#38585).
git-svn-id: https://svn.redmine.org/redmine/trunk@22972 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-20 23:40:58 +00:00
Go MAEDA
65597ec1cf Add filters for "User's group" and "User's role" to Spent time list (#41053).
Patch by Takenori TAKAKI (user:takenory).


git-svn-id: https://svn.redmine.org/redmine/trunk@22958 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-16 02:05:25 +00:00
Go MAEDA
b3d1deeece Fix RuboCop offense Layout/SpaceInsideParens, one of the offenses enabled in rubocop-rails-omakase (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@22954 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-12 08:45:54 +00:00
Go MAEDA
74e2262efb Fix RuboCop offense Layout/EmptyLinesAroundMethodBody, one of the offenses enabled in rubocop-rails-omakase (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@22950 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-12 07:46:58 +00:00
Go MAEDA
174c237c70 Fix incorrect sorting of users grouped by status in issue filters for administrators (#41079).
Patch by Vladislav Moiseev (user:vladdy.moses).


git-svn-id: https://svn.redmine.org/redmine/trunk@22947 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-08-11 08:30:40 +00:00
Go MAEDA
fded8025d5 Add project identifier to List-Id header in notification emails (#13359).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@22944 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-07-26 03:19:22 +00:00
Go MAEDA
0247ebb394 Set default age parameter for User.prune method to 30 days (#41023).
git-svn-id: https://svn.redmine.org/redmine/trunk@22938 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-07-19 08:26:13 +00:00
Go MAEDA
ee31bf8fe9 Add an option to render Integer and Float custom fields with thousands delimiters (#39997).
Patch by Go MAEDA (user:maeda).


git-svn-id: https://svn.redmine.org/redmine/trunk@22935 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-07-18 04:56:20 +00:00
Marius Balteanu
f9f486bdd0 Check view watchers permission when copying issues (#40946).
Patch by Jens Kraemer (@jkraemer).


git-svn-id: https://svn.redmine.org/redmine/trunk@22914 e93f8b46-1217-0410-a6f0-8f06a7374b81
2024-07-08 21:30:36 +00:00