]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3546 Allow to delete a filter which is used in a dashboard
authorDavid Gageot <david@gageot.net>
Thu, 14 Jun 2012 12:59:59 +0000 (14:59 +0200)
committerDavid Gageot <david@gageot.net>
Thu, 14 Jun 2012 15:31:57 +0000 (17:31 +0200)
When the filter was used, it is deleted but a warning message is
displayed.

sonar-server/src/main/webapp/WEB-INF/app/controllers/filters_controller.rb

index cfe629a88d89258be156a0bbb1ef3dd4ef60a0f7..f13455e81bc34b154f85a789fc42e27a11cbc60b 100644 (file)
@@ -113,7 +113,8 @@ class FiltersController < ApplicationController
 
     if @filter
       if WidgetProperty.find(:first, :conditions => {:kee => 'filter', :text_value => @filter.kee})
-        flash[:error]='The filter is used in at least one dashboard. It cannot be deleted'
+        @filter.destroy
+        flash[:warning]='Filter deleted. It was used in at least one dashboard'
       else
         @filter.destroy
         flash[:notice]='Filter deleted'