Просмотр исходного кода

Merge branch 'develop' into feature/rails4

Martin Edenhofer 11 лет назад
Родитель
Сommit
1bae4d95c8

+ 24 - 1
app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee

@@ -167,7 +167,9 @@ class App.ControllerGenericIndex extends App.ControllerContent
 
 
   destroy: (e) ->
   destroy: (e) ->
     item = $(e.target).item( App[ @genericObject ] )
     item = $(e.target).item( App[ @genericObject ] )
-    item.destroy() if confirm('Sure?')
+    new DestroyConfirm(
+      item: item
+    )
 
 
   new: (e) ->
   new: (e) ->
     e.preventDefault()
     e.preventDefault()
@@ -176,6 +178,27 @@ class App.ControllerGenericIndex extends App.ControllerContent
       genericObject: @genericObject
       genericObject: @genericObject
     )
     )
 
 
+class DestroyConfirm extends App.ControllerModal
+  constructor: ->
+    super
+    @render()
+
+  render: ->
+    @html App.view('modal')(
+      title:   'Confirm'
+      message: 'Sure to delete this object?'
+      cancel:  true
+      button:  'Yes'
+    )
+    @modalShow(
+      backdrop: true,
+      keyboard: true,
+    )
+
+  submit: (e) =>
+    @modalHide()
+    @item.destroy()
+
 class App.ControllerLevel2 extends App.ControllerContent
 class App.ControllerLevel2 extends App.ControllerContent
   events:
   events:
     'click [data-toggle="tabnav"]': 'toggle',
     'click [data-toggle="tabnav"]': 'toggle',

+ 1 - 1
app/assets/javascripts/app/lib/app_post/task_manager.js.coffee

@@ -379,7 +379,7 @@ class _taskManagerSingleton extends App.Controller
         App.Delay.set(
         App.Delay.set(
           =>
           =>
             @add(task.key, task.callback, task.params, true)
             @add(task.key, task.callback, task.params, true)
-          task_count * 900
+          task_count * 600
           undefined
           undefined
           'task'
           'task'
         )
         )

+ 9 - 2
app/controllers/long_polling_controller.rb

@@ -1,6 +1,7 @@
 # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
 # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
 
 
 class LongPollingController < ApplicationController
 class LongPollingController < ApplicationController
+  skip_filter :session_update
 
 
   # GET /api/v1/message_send
   # GET /api/v1/message_send
   def message_send
   def message_send
@@ -118,7 +119,10 @@ class LongPollingController < ApplicationController
     begin
     begin
 
 
       # update last ping
       # update last ping
-      sleep 1
+      4.times {|loop|
+        sleep 0.25
+      }
+      #sleep 1
       Sessions.touch( client_id )
       Sessions.touch( client_id )
 
 
       # set max loop time to 24 sec. because of 30 sec. timeout of mod_proxy
       # set max loop time to 24 sec. because of 30 sec. timeout of mod_proxy
@@ -131,7 +135,10 @@ class LongPollingController < ApplicationController
           render :json => queue
           render :json => queue
           return
           return
         end
         end
-        sleep 2
+        8.times {|loop|
+          sleep 0.25
+        }
+        #sleep 2
         if count == 0
         if count == 0
           render :json => { :action => 'pong' }
           render :json => { :action => 'pong' }
           return
           return

+ 5 - 5
test/browser/aaa_getting_started_test.rb

@@ -93,16 +93,16 @@ class AaaGettingStartedTest < TestCase
             :execute => 'click',
             :execute => 'click',
             :css     => '#form-agent button[type="submit"]',
             :css     => '#form-agent button[type="submit"]',
           },
           },
-          {
-            :execute => 'check',
-            :element => :url,
-            :result  => '#getting_started',
-          },
           {
           {
             :execute => 'watch_for',
             :execute => 'watch_for',
             :area    => 'body',
             :area    => 'body',
             :value   => 'Invitation sent',
             :value   => 'Invitation sent',
           },
           },
+          {
+            :execute => 'check',
+            :element => :url,
+            :result  => '#getting_started',
+          },
           {
           {
             :execute      => 'match',
             :execute      => 'match',
             :css          => 'body',
             :css          => 'body',

+ 2 - 2
test/browser/manage_test.rb

@@ -184,8 +184,8 @@ class ManageTest < TestCase
             :value   => 2,
             :value   => 2,
           },
           },
           {
           {
-            :execute => 'accept',
-            :element => :alert,
+            :execute => 'click',
+            :css     => '.modal .submit',
           },
           },
           {
           {
             :execute => 'wait',
             :execute => 'wait',

+ 3 - 2
test/browser_test_helper.rb

@@ -245,14 +245,15 @@ class TestCase < Test::Unit::TestCase
       assert( false, "(#{test[:name]}) no login box found!" )
       assert( false, "(#{test[:name]}) no login box found!" )
       return
       return
     elsif action[:execute] == 'watch_for'
     elsif action[:execute] == 'watch_for'
-      (1..24).each { |loop|
+      text = ''
+      (1..36).each { |loop|
         element = instance.find_element( { :css => action[:area] } )
         element = instance.find_element( { :css => action[:area] } )
         text = element.text
         text = element.text
         if text =~ /#{action[:value]}/i
         if text =~ /#{action[:value]}/i
           assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
           assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
           return
           return
         end
         end
-        sleep 0.5
+        sleep 0.33
       } 
       } 
       assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
       assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" )
       return
       return