プロジェクト

全般

プロフィール

Vote #64406

完了

Add my activities to my page

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
My page_42
対象バージョン:
開始日:
2009/01/08
期日:
進捗率:

0%

予定工数:
category_id:
42
version_id:
99
issue_org_id:
2471
author_id:
634
assigned_to_id:
332
comments:
20
status_id:
5
tracker_id:
2
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

I would like to see my user activities in my page.


journals

This is related to #1002
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
This feature is useful to look back on what I did.

I have made a patch.
--------------------------------------------------------------------------------
Here is the screenshot of the "My activity" block.

!my_activity_block.png!
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I think this is useful for project members to look back on their work.
--------------------------------------------------------------------------------
I fixed a patch written by Go MAEDA (#2471#note-4) to apply to trunk.
In addition, I made partial "activities" and use it in multiple places (my page, activities/index, users/show).

I think that this feature is still necessary now.
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
For issues I've made something similar with a custom query, but this is much better.
+1
--------------------------------------------------------------------------------
Setting target version to 4.1.0.
--------------------------------------------------------------------------------
Committed. Thank you for improving Redmine.
--------------------------------------------------------------------------------
Thank you for committing.
I checked https://www.redmine.org/builds/ and discovered that testing this feature failed.

> Failure:
> MyControllerTest#test_page_with_activity [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/mysql/RUBY_VER/ruby-2.4/test/functional/my_controller_test.rb:209]:
> Expected at least 1 element matching "a[href="/activity?from=2018-08-01&user_id=2"]", found 0..
> Expected 0 to be >= 1.
>
> bin/rails test test/functional/my_controller_test.rb:201

This attached patch will fix the test.
--------------------------------------------------------------------------------
Mizuki ISHIKAWA wrote:
> I checked https://www.redmine.org/builds/ and discovered that testing this feature failed.
>
> > Failure:
> > MyControllerTest#test_page_with_activity [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/mysql/RUBY_VER/ruby-2.4/test/functional/my_controller_test.rb:209]:
> > Expected at least 1 element matching "a[href="/activity?from=2018-08-01&user_id=2"]", found 0..
> > Expected 0 to be >= 1.
> >
> > bin/rails test test/functional/my_controller_test.rb:201

Thank you for pointing it out. I found that the test failed depending on the time.

NG: 2018-08-01 23:30:01 -0700 : https://www.redmine.org/builds/logs/build_trunk_mysql_ruby-2.5_315.html
OK: 2018-08-01 08:00:01 -0700 : https://www.redmine.org/builds/logs/build_trunk_mysql_ruby-2.5_314.html
NG: 2018-07-31 20:00:01 -0700 : https://www.redmine.org/builds/logs/build_trunk_mysql_ruby-2.5_313.html
OK: 2018-07-29 01:00:02 -0700 : https://www.redmine.org/builds/logs/build_trunk_mysql_ruby-2.5_312.html

!{width: 944px; border: 1px solid #cc;}.build-status@2x.png!
--------------------------------------------------------------------------------
Using @Date.current@ which is aware of the application's timezone also should fix the issue.

<pre><code class="diff">
--- test/functional/my_controller_test.rb (revision 17462)
+++ test/functional/my_controller_test.rb (working copy)
@@ -208,7 +208,7 @@

assert_select 'div#block-activity' do
assert_select 'h3' do
- assert_select 'a[href=?]', activity_path(from: Date.today, user_id: user.id), :text => 'Activity'
+ assert_select 'a[href=?]', activity_path(from: Date.current, user_id: user.id), :text => 'Activity'
end
assert_select 'div#activity' do
assert_select 'dt', 10
</code></pre>

|_. Time |_. @Date.today@ |_. @Date.current@ |
| 08:59 JST (23:59 UTC) |=. FAIL |=. PASS |
| 09:01 JST (00:01 UTC) |=. PASS |=. PASS |

--------------------------------------------------------------------------------
Mizuki ISHIKAWA wrote:
> I checked https://www.redmine.org/builds/ and discovered that testing this feature failed.
>
> > Failure:
> > MyControllerTest#test_page_with_activity [/var/lib/jenkins/workspace/trunk/DATABASE_ADAPTER/mysql/RUBY_VER/ruby-2.4/test/functional/my_controller_test.rb:209]:
> > Expected at least 1 element matching "a[href="/activity?from=2018-08-01&user_id=2"]", found 0..
> > Expected 0 to be >= 1.
> >
> > bin/rails test test/functional/my_controller_test.rb:201

The problem was fixed by r17465.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
The new block is not aware of timezone when grouping events by date. The patch to fix the issue was posted as #29816.
--------------------------------------------------------------------------------
Go MAEDA wrote:
> The new block is not aware of timezone when grouping events by date. The patch to fix the issue was posted as #29816.

Committed the patch.
--------------------------------------------------------------------------------


related_issues

relates,New,574,Add "My issues" to main menu
relates,Closed,1081,Add Activity block to My Page
relates,Closed,29816,MyHelper::render_activity_block is not timezone aware

Admin Redmine さんが3年以上前に更新

  • カテゴリMy page_42 にセット
  • 対象バージョン4.0.0_99 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0