Feature #2471

Add my activities to my page

Added by Guilherme Schneider almost 10 years ago. Updated about 22 hours ago.

Status:ClosedStart date:2009-01-08
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:My page
Target version:4.0.0
Resolution:Fixed

Description

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

patch-2471.diff Magnifier (2.29 KB) Go MAEDA, 2014-06-26 03:39

my_activity_block.png (55.4 KB) Go MAEDA, 2014-06-26 03:48

add-my-activities-to-my-page.patch Magnifier (7.82 KB) Mizuki ISHIKAWA, 2018-06-07 04:18

fix_test.patch Magnifier (950 Bytes) Mizuki ISHIKAWA, 2018-08-03 02:12

build-status@2x.png (149 KB) Go MAEDA, 2018-08-03 02:19


Related issues

Related to Redmine - Feature #574: Add "My issues" to main menu New
Related to Redmine - Patch #1081: Add Activity block to My Page New 2008-04-21
Related to Redmine - Defect #29816: MyHelper::render_activity_block is not timezone aware Closed

Associated revisions

Revision 17443
Added by Go MAEDA 3 months ago

Add my activities to my page (#2471).

Patch by Mizuki ISHIKAWA.

Revision 17456
Added by Go MAEDA 3 months ago

Add a missing fixture (#2471).

Revision 17465
Added by Go MAEDA 2 months ago

Fix a test failure in test/functional/my_controller_test.rb that depends on time and zone (#2471).

Revision 17600
Added by Go MAEDA about 22 hours ago

Fix that MyHelper::render_activity_block is not timezone aware (#2471, #29816).

Patch by Mizuki ISHIKAWA.

History

#1 Updated by Guilherme Schneider almost 10 years ago

This is related to #1002

#2 Updated by Toshi MARUYAMA over 4 years ago

  • Category set to My page

#3 Updated by Toshi MARUYAMA over 4 years ago

  • Related to Feature #574: Add "My issues" to main menu added

#4 Updated by Go MAEDA over 4 years ago

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

I have made a patch.

#5 Updated by Go MAEDA over 4 years ago

Here is the screenshot of the "My activity" block.

#6 Updated by Toshi MARUYAMA about 4 years ago

  • Related to Patch #1081: Add Activity block to My Page added

#7 Updated by Go MAEDA about 3 years ago

  • Target version set to Candidate for next major release

I think this is useful for project members to look back on their work.

#8 Updated by Mizuki ISHIKAWA 5 months ago

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.

#9 Updated by Marius BALTEANU 4 months ago

+1

#10 Updated by Bernhard Rohloff 4 months ago

For issues I've made something similar with a custom query, but this is much better.
+1

#11 Updated by Go MAEDA 4 months ago

  • Target version changed from Candidate for next major release to 4.1.0

Setting target version to 4.1.0.

#12 Updated by Go MAEDA 3 months ago

  • Assignee set to Go MAEDA

#13 Updated by Go MAEDA 3 months ago

  • Status changed from New to Closed
  • Target version changed from 4.1.0 to 4.0.0
  • Resolution set to Fixed

Committed. Thank you for improving Redmine.

#14 Updated by Mizuki ISHIKAWA 3 months ago

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.

#15 Updated by Go MAEDA 3 months ago

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

#16 Updated by Go MAEDA 3 months ago

Using Date.current which is aware of the application's timezone also should fix the issue.

--- 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
Time Date.today Date.current
08:59 JST (23:59 UTC) FAIL PASS
09:01 JST (00:01 UTC) PASS PASS

#17 Updated by Go MAEDA 2 months ago

  • Status changed from Reopened to Closed

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.

#18 Updated by Go MAEDA 2 days ago

  • Related to Defect #29816: MyHelper::render_activity_block is not timezone aware added

#19 Updated by Go MAEDA 2 days ago

  • Status changed from Closed to Reopened

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

#20 Updated by Go MAEDA about 22 hours ago

  • Status changed from Reopened to Closed

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.

Also available in: Atom PDF