Feature #30975 » 30975-mypage-block-updated-issues.patch
app/helpers/my_helper.rb | ||
---|---|---|
115 | 115 |
render :partial => 'my/blocks/issues', :locals => {:query => query, :issues => issues, :block => block} |
116 | 116 |
end |
117 | 117 | |
118 |
def render_issuesupdatedbyme_block(block, settings) |
|
119 |
query = IssueQuery.new(:name => l(:label_updated_issues), :user => User.current) |
|
120 |
query.add_filter 'updated_by', '=', ['me'] |
|
121 |
query.add_filter 'project.status', '=', ["#{Project::STATUS_ACTIVE}"] |
|
122 |
query.column_names = settings[:columns].presence || ['project', 'tracker', 'status', 'subject'] |
|
123 |
query.sort_criteria = settings[:sort].presence || [['updated_on', 'desc']] |
|
124 |
issues = query.issues(:limit => 10) |
|
125 | ||
126 |
render :partial => 'my/blocks/issues', :locals => {:query => query, :issues => issues, :block => block} |
|
127 |
end |
|
128 | ||
118 | 129 |
def render_issueswatched_block(block, settings) |
119 | 130 |
query = IssueQuery.new(:name => l(:label_watched_issues), :user => User.current) |
120 | 131 |
query.add_filter 'watcher_id', '=', ['me'] |
config/locales/en.yml | ||
---|---|---|
624 | 624 |
label_reported_issues: Reported issues |
625 | 625 |
label_assigned_issues: Assigned issues |
626 | 626 |
label_assigned_to_me_issues: Issues assigned to me |
627 |
label_updated_issues: Updated issues |
|
627 | 628 |
label_last_login: Last connection |
628 | 629 |
label_registered_on: Registered on |
629 | 630 |
label_activity: Activity |
lib/redmine/my_page.rb | ||
---|---|---|
24 | 24 |
CORE_BLOCKS = { |
25 | 25 |
'issuesassignedtome' => {:label => :label_assigned_to_me_issues}, |
26 | 26 |
'issuesreportedbyme' => {:label => :label_reported_issues}, |
27 |
'issuesupdatedbyme' => {:label => :label_updated_issues}, |
|
27 | 28 |
'issueswatched' => {:label => :label_watched_issues}, |
28 | 29 |
'issuequery' => {:label => :label_issue_plural, :max_occurs => 3}, |
29 | 30 |
'news' => {:label => :label_news_latest}, |
test/functional/my_controller_test.rb | ||
---|---|---|
19 | 19 | |
20 | 20 |
class MyControllerTest < Redmine::ControllerTest |
21 | 21 |
fixtures :users, :email_addresses, :user_preferences, :roles, :projects, :members, :member_roles, |
22 |
:issues, :issue_statuses, :trackers, :enumerations, :custom_fields, :auth_sources, :queries, :enabled_modules |
|
22 |
:issues, :issue_statuses, :trackers, :enumerations, :custom_fields, :auth_sources, :queries, :enabled_modules, |
|
23 |
:journals |
|
23 | 24 | |
24 | 25 |
def setup |
25 | 26 |
@request.session[:user_id] = 2 |
... | ... | |
283 | 284 |
end |
284 | 285 |
end |
285 | 286 | |
287 |
def test_page_with_updated_issues_block_should_not_show_issues_from_closed_projects |
|
288 |
preferences = User.find(2).pref |
|
289 |
preferences.my_page_layout = {'top' => ['issuesupdatedbyme']} |
|
290 |
preferences.my_page_settings = {'issuesupdatedbyme' => {}} |
|
291 |
preferences.save! |
|
292 | ||
293 |
project = Project.find(3) |
|
294 |
project.close |
|
295 | ||
296 |
get :page |
|
297 | ||
298 |
assert_response :success |
|
299 |
assert_select '#block-issuesupdatedbyme' do |
|
300 |
report_url = CGI.unescape(css_select('h3 a').first.attr('href')) |
|
301 |
assert_match 'f[]=project.status', report_url |
|
302 |
assert_match 'v[project.status][]=1', report_url |
|
303 |
assert_match 'f[]=updated_by', report_url |
|
304 |
assert_match 'v[updated_by][]=me', report_url |
|
305 | ||
306 |
assert_select 'table.issues tbody tr', 2 |
|
307 |
assert_select 'table.issues tbody tr[id=?]', 'issue-1', 1, :title => 'Cannot print recipes' |
|
308 |
assert_select 'table.issues tbody tr[id=?]', 'issue-14', 0 |
|
309 |
end |
|
310 |
end |
|
311 | ||
286 | 312 |
def test_page_with_watched_issues_block_should_not_show_issues_from_closed_projects |
287 | 313 |
preferences = User.find(2).pref |
288 | 314 |
preferences.my_page_layout = {'top' => ['issueswatched']} |
- « Previous
- 1
- 2
- Next »