diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-11-05 16:16:23 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-11-05 16:16:23 +0000 |
commit | 8af322bf047f88b9644f407af7f8e1cf59ef6e5e (patch) | |
tree | 6d87db7f4839ca3967a23d9ad3f1eb5aa717e490 /sonar-server | |
parent | f45ae9e1ec94fde6952e0c2aaa56a82f6f4bab29 (diff) | |
download | sonarqube-8af322bf047f88b9644f407af7f8e1cf59ef6e5e.tar.gz sonarqube-8af322bf047f88b9644f407af7f8e1cf59ef6e5e.zip |
fix edition of dashboard layout
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb | 11 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb index 16ce6551bac..44030fb548d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb @@ -47,12 +47,11 @@ class DashboardController < ApplicationController dashboard=Dashboard.find(params[:did].to_i) if dashboard.editable_by?(current_user) dashboard.column_layout=params[:layout] - if dashboard.save - columns=dashboard.column_layout.split('-') - dashboard.widgets.find(:all, :conditions => ["column_index > ?",columns.size()]).each do |widget| - widget.column_index=columns.size() - widget.save - end + dashboard.save! + columns=dashboard.column_layout.split('-') + dashboard.widgets.find(:all, :conditions => ["column_index > ?",columns.size()]).each do |widget| + widget.column_index=columns.size() + widget.save end end redirect_to :action => 'index', :did => dashboard.id, :id => params[:id] diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb index 6fe3e353130..2a05055f890 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb @@ -28,7 +28,7 @@ class Dashboard < ActiveRecord::Base validates_length_of :name, :within => 1..256
validates_length_of :description, :maximum => 1000, :allow_blank => true, :allow_nil => true
- validates_length_of :column_layout, :maximum => 10, :allow_blank => false, :allow_nil => false
+ validates_length_of :column_layout, :maximum => 20, :allow_blank => false, :allow_nil => false
validates_uniqueness_of :name, :scope => :user_id
def shared?
|