プロジェクト

全般

プロフィール

Vote #64877

完了

Patch for "My Page" personalization not storing reordered blocks

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

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

0%

予定工数:
category_id:
10
version_id:
6
issue_org_id:
2971
author_id:
4
assigned_to_id:
1
comments:
12
status_id:
5
tracker_id:
3
plus1:
1
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

I just noticed "My page" personalization does not fully work:
You can add/remove blocks, but after reordering blocks the layout is not stored.
Tested with Safari 3.2.1 and FireFox 3.0.1, this can be reproduced on http://www.redmine.org.

One reason is MyController#order_blocks expects params[:group] to be an array, which simply is not the case, also params["list-#{group}"] may actually be empty if the user just dragged the last item out of a group.

A patch for these issues is attached.

Note that there may still be a race condition because of concurrent AJAX calls when the session is stored within cookies.
(Basically the same session is received twice - once for the removal, once for adding - changed and sent back, one change overwriting the other)

Redmine trunk (r2589)
Ruby 1.8.6
Rails 2.2.2
Postgres 8.3


journals

+1

I will be interested when this patch gets incorporated also. I have had a few people ask about it.
--------------------------------------------------------------------------------
Patch applied in r2634. Thanks.
Rather than storing the changes in session, we should write them directly in the database.
--------------------------------------------------------------------------------
There are still some problems in changing layout:

* Add more than one components to both left-bottom and right-bottom areas, save layout.
* Move components between two bottom areas, save layout.
* If you do these several times, you will find that some component will be lost sometimes.

--------------------------------------------------------------------------------
I'll do some more testing.
--------------------------------------------------------------------------------
I'm having the same problem, even on redmine.org
It seems if it move something to the top block I'll never be able to move it to either of the bottom 2 blocks.
--------------------------------------------------------------------------------
This should be fixed in r3194.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> This should be fixed in r3194.

Why def page_layout_save has been removed, in 0.9 there is no save link on My page in customization mode.
--------------------------------------------------------------------------------
Alex Revetchi wrote:
> Jean-Philippe Lang wrote:
> > This should be fixed in r3194.
>
> Why def page_layout_save has been removed, in 0.9 there is no save link on My page in customization mode.

I have put back the code removed in a prevous commit and it works fine now:

app/views/my/page_layout.rhtml - after the line 48
+<%= link_to l(:button_save), {:action => 'page_layout_save'}, :class => 'icon icon-save' %>

app/controllers/my_controller.rb - restored page_layout_save routine at the end of the file

+ # Save user's page layout
+ def page_layout_save
+ @user = User.current
+ @user.pref[:my_page_layout] = session[:page_layout] if session[:page_layout]
+ @user.pref.save
+ session[:page_layout] = nil
+ redirect_to :action => 'page'
+ end

--------------------------------------------------------------------------------
This code was removed because order is saved immediately after moving a block.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> This code was removed because order is saved immediately after moving a block.

There should be at least close button, what user should do in order to exit the customization mode? navigate away from that page?
--------------------------------------------------------------------------------
There is a 'Back' button for that.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> There is a 'Back' button for that.

Thanks, a lot, it was confusing as I was used to the previous interface, where back was canceling the changes i.e. not saving them.
--------------------------------------------------------------------------------

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

  • カテゴリUI_10 にセット
  • 対象バージョン0.9.0_6 にセット

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

いいね!0
いいね!0