Fixed logout.
This commit is contained in:
parent
08c5ca3e62
commit
2e9c6e78ed
6 changed files with 141 additions and 139 deletions
|
@ -1,21 +1,13 @@
|
||||||
class Index extends App.ControllerContent
|
class Index extends App.ControllerContent
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
@signout()
|
|
||||||
|
|
||||||
signout: ->
|
|
||||||
|
|
||||||
# remove remote session
|
|
||||||
App.Auth.logout()
|
App.Auth.logout()
|
||||||
|
|
||||||
# remove local session
|
|
||||||
@Session.init()
|
|
||||||
App.Event.trigger('ui:rerender')
|
|
||||||
|
|
||||||
# redirect to login
|
# redirect to login
|
||||||
redirect = =>
|
redirect = =>
|
||||||
@navigate 'login'
|
@navigate 'login'
|
||||||
@delay redirect, 150
|
@delay redirect, 100
|
||||||
|
|
||||||
App.Config.set('logout', Index, 'Routes')
|
App.Config.set('logout', Index, 'Routes')
|
||||||
App.Config.set('Logout', { prio: 1800, parent: '#current_user', name: 'Sign out', translate: true, target: '#logout', divider: true, iconClass: 'signout', role: [ 'Agent', 'Customer' ] }, 'NavBarRight')
|
App.Config.set('Logout', { prio: 1800, parent: '#current_user', name: 'Sign out', translate: true, target: '#logout', divider: true, iconClass: 'signout', role: [ 'Agent', 'Customer' ] }, 'NavBarRight')
|
||||||
|
|
|
@ -130,14 +130,13 @@ class App.Auth
|
||||||
|
|
||||||
App.Event.trigger('auth:login', data.session)
|
App.Event.trigger('auth:login', data.session)
|
||||||
App.Event.trigger('ui:rerender')
|
App.Event.trigger('ui:rerender')
|
||||||
|
App.TaskManager.tasksInitial()
|
||||||
|
|
||||||
@_logout: (rerender = true) ->
|
@_logout: (rerender = true) ->
|
||||||
App.Log.debug 'Auth', '_logout'
|
App.Log.debug 'Auth', '_logout'
|
||||||
|
|
||||||
App.Ajax.abortAll()
|
App.Ajax.abortAll()
|
||||||
|
App.TaskManager.reset()
|
||||||
# empty session
|
|
||||||
App.Session.init()
|
App.Session.init()
|
||||||
|
|
||||||
App.Event.trigger('auth')
|
App.Event.trigger('auth')
|
||||||
|
|
|
@ -20,9 +20,6 @@ class App.Run extends App.Controller
|
||||||
# create web socket connection
|
# create web socket connection
|
||||||
App.WebSocket.connect()
|
App.WebSocket.connect()
|
||||||
|
|
||||||
# init tasks
|
|
||||||
App.TaskManager.init()
|
|
||||||
|
|
||||||
# start frontend time update
|
# start frontend time update
|
||||||
@frontendTimeUpdate()
|
@frontendTimeUpdate()
|
||||||
|
|
||||||
|
|
|
@ -8,45 +8,64 @@ class App.TaskManager
|
||||||
_instance.all()
|
_instance.all()
|
||||||
|
|
||||||
@allWithMeta: ->
|
@allWithMeta: ->
|
||||||
|
return [] if !_instance
|
||||||
_instance.allWithMeta()
|
_instance.allWithMeta()
|
||||||
|
|
||||||
@execute: (params) ->
|
@execute: (params) ->
|
||||||
|
return if !_instance
|
||||||
_instance.execute(params)
|
_instance.execute(params)
|
||||||
|
|
||||||
@get: (key) ->
|
@get: (key) ->
|
||||||
|
return if !_instance
|
||||||
_instance.get(key)
|
_instance.get(key)
|
||||||
|
|
||||||
@update: (key, params) ->
|
@update: (key, params) ->
|
||||||
|
return if !_instance
|
||||||
_instance.update(key, params)
|
_instance.update(key, params)
|
||||||
|
|
||||||
@remove: (key) ->
|
@remove: (key) ->
|
||||||
|
return if !_instance
|
||||||
_instance.remove(key)
|
_instance.remove(key)
|
||||||
|
|
||||||
@notify: (key) ->
|
@notify: (key) ->
|
||||||
|
return if !_instance
|
||||||
_instance.notify(key)
|
_instance.notify(key)
|
||||||
|
|
||||||
@mute: (key) ->
|
@mute: (key) ->
|
||||||
|
return if !_instance
|
||||||
_instance.mute(key)
|
_instance.mute(key)
|
||||||
|
|
||||||
@reorder: (order) ->
|
@reorder: (order) ->
|
||||||
|
return if !_instance
|
||||||
_instance.reorder(order)
|
_instance.reorder(order)
|
||||||
|
|
||||||
@touch: (key) ->
|
@touch: (key) ->
|
||||||
|
return if !_instance
|
||||||
_instance.touch(key)
|
_instance.touch(key)
|
||||||
|
|
||||||
@reset: ->
|
@reset: ->
|
||||||
|
return if !_instance
|
||||||
_instance.reset()
|
_instance.reset()
|
||||||
|
|
||||||
|
@tasksInitial: ->
|
||||||
|
if _instance == undefined
|
||||||
|
_instance ?= new _taskManagerSingleton
|
||||||
|
_instance.tasksInitial()
|
||||||
|
|
||||||
@worker: (key) ->
|
@worker: (key) ->
|
||||||
|
return if !_instance
|
||||||
_instance.worker(key)
|
_instance.worker(key)
|
||||||
|
|
||||||
@nextTaskUrl: ->
|
@nextTaskUrl: ->
|
||||||
|
return if !_instance
|
||||||
_instance.nextTaskUrl()
|
_instance.nextTaskUrl()
|
||||||
|
|
||||||
@TaskbarId: ->
|
@TaskbarId: ->
|
||||||
|
return if !_instance
|
||||||
_instance.TaskbarId()
|
_instance.TaskbarId()
|
||||||
|
|
||||||
@hideAll: ->
|
@hideAll: ->
|
||||||
|
return if !_instance
|
||||||
_instance.showControllerHideOthers()
|
_instance.showControllerHideOthers()
|
||||||
|
|
||||||
class _taskManagerSingleton extends App.Controller
|
class _taskManagerSingleton extends App.Controller
|
||||||
|
@ -61,20 +80,8 @@ class _taskManagerSingleton extends App.Controller
|
||||||
@offlineModus = params.offlineModus
|
@offlineModus = params.offlineModus
|
||||||
@tasksInitial()
|
@tasksInitial()
|
||||||
|
|
||||||
# render on login
|
|
||||||
App.Event.bind('auth:login', =>
|
|
||||||
@tasksInitial()
|
|
||||||
'task'
|
|
||||||
)
|
|
||||||
|
|
||||||
# render on logout
|
|
||||||
App.Event.bind('auth:logout', =>
|
|
||||||
@reset()
|
|
||||||
'task'
|
|
||||||
)
|
|
||||||
|
|
||||||
# send updates to server
|
# send updates to server
|
||||||
App.Interval.set(@taskUpdateLoop, 2500, 'check_update_to_server_pending', 'task')
|
App.Interval.set(@taskUpdateLoop, 3000, 'check_update_to_server_pending', 'task')
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
@workers = {}
|
@workers = {}
|
||||||
|
@ -330,6 +337,7 @@ class _taskManagerSingleton extends App.Controller
|
||||||
|
|
||||||
task = @allTasksByKey[key]
|
task = @allTasksByKey[key]
|
||||||
delete @allTasksByKey[key]
|
delete @allTasksByKey[key]
|
||||||
|
return if !task
|
||||||
|
|
||||||
# rerender taskbar
|
# rerender taskbar
|
||||||
App.Event.trigger('taskRemove', [task])
|
App.Event.trigger('taskRemove', [task])
|
||||||
|
@ -502,12 +510,12 @@ class _taskManagerSingleton extends App.Controller
|
||||||
# initial load of permanent tasks
|
# initial load of permanent tasks
|
||||||
authentication = App.Session.get('id')
|
authentication = App.Session.get('id')
|
||||||
permanentTask = App.Config.get('permanentTask')
|
permanentTask = App.Config.get('permanentTask')
|
||||||
task_count = 0
|
taskCount = 0
|
||||||
if permanentTask
|
if permanentTask
|
||||||
for key, config of permanentTask
|
for key, config of permanentTask
|
||||||
if !config.authentication || (config.authentication && authentication)
|
if !config.authentication || (config.authentication && authentication)
|
||||||
task_count += 1
|
taskCount += 1
|
||||||
do (key, config, task_count) =>
|
do (key, config, taskCount) =>
|
||||||
App.Delay.set(
|
App.Delay.set(
|
||||||
=>
|
=>
|
||||||
@execute(
|
@execute(
|
||||||
|
@ -518,15 +526,15 @@ class _taskManagerSingleton extends App.Controller
|
||||||
persistent: true
|
persistent: true
|
||||||
init: true
|
init: true
|
||||||
)
|
)
|
||||||
task_count * 450
|
taskCount * 350
|
||||||
undefined
|
undefined
|
||||||
'task'
|
'task'
|
||||||
)
|
)
|
||||||
|
|
||||||
# initial load of taskbar collection
|
# initial load of taskbar collection
|
||||||
for key, task of @allTasksByKey
|
for key, task of @allTasksByKey
|
||||||
task_count += 1
|
taskCount += 1
|
||||||
do (task, task_count) =>
|
do (task, taskCount) =>
|
||||||
App.Delay.set(
|
App.Delay.set(
|
||||||
=>
|
=>
|
||||||
@execute(
|
@execute(
|
||||||
|
@ -537,7 +545,7 @@ class _taskManagerSingleton extends App.Controller
|
||||||
persistent: false
|
persistent: false
|
||||||
init: true
|
init: true
|
||||||
)
|
)
|
||||||
task_count * 450
|
taskCount * 350
|
||||||
undefined
|
undefined
|
||||||
'task'
|
'task'
|
||||||
)
|
)
|
||||||
|
|
|
@ -18,15 +18,15 @@ test( "taskbar basic tests", function() {
|
||||||
show: true,
|
show: true,
|
||||||
persistent: false,
|
persistent: false,
|
||||||
})
|
})
|
||||||
equal( $('#taskbars .content').length, 1, "check available active contents" );
|
equal($('#taskbars .content').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#1',show:'true',hide:'false',active:'true'", "check active content!" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#1',show:'true',hide:'false',active:'true'", "check active content!")
|
||||||
|
|
||||||
// verify
|
// verify
|
||||||
task = App.TaskManager.get('TestKey1')
|
task = App.TaskManager.get('TestKey1')
|
||||||
equal(task.notify, false)
|
equal(task.notify, false)
|
||||||
deepEqual(task.state, undefined)
|
deepEqual(task.state, undefined)
|
||||||
deepEqual( task.params, { "message": "#1" } )
|
deepEqual(task.params, { "message": "#1", "shown": true })
|
||||||
|
|
||||||
// update
|
// update
|
||||||
App.TaskManager.update('TestKey1', { 'state': 'abc' })
|
App.TaskManager.update('TestKey1', { 'state': 'abc' })
|
||||||
|
@ -49,11 +49,11 @@ test( "taskbar basic tests", function() {
|
||||||
show: true,
|
show: true,
|
||||||
persistent: false,
|
persistent: false,
|
||||||
})
|
})
|
||||||
equal( $('#taskbars .content').length, 2, "check available active contents" );
|
equal($('#taskbars .content').length, 2, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#2',show:'true',hide:'false',active:'true'", "check active content!" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#2',show:'true',hide:'false',active:'true'", "check active content!")
|
||||||
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
|
|
||||||
// check task history
|
// check task history
|
||||||
equal(App.TaskManager.nextTaskUrl(), '#/some/url/#2')
|
equal(App.TaskManager.nextTaskUrl(), '#/some/url/#2')
|
||||||
|
@ -68,12 +68,12 @@ test( "taskbar basic tests", function() {
|
||||||
show: false,
|
show: false,
|
||||||
persistent: false,
|
persistent: false,
|
||||||
})
|
})
|
||||||
equal( $('#taskbars .content').length, 3, "check available active contents" );
|
equal($('#taskbars .content').length, 3, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#2',show:'true',hide:'false',active:'true'" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#2',show:'true',hide:'false',active:'true'")
|
||||||
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
|
|
||||||
|
|
||||||
App.TaskManager.execute({
|
App.TaskManager.execute({
|
||||||
|
@ -85,13 +85,13 @@ test( "taskbar basic tests", function() {
|
||||||
show: false,
|
show: false,
|
||||||
persistent: true,
|
persistent: true,
|
||||||
})
|
})
|
||||||
equal( $('#taskbars .content').length, 4, "check available active contents" );
|
equal($('#taskbars .content').length, 4, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#2',show:'true',hide:'false',active:'true'" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#2',show:'true',hide:'false',active:'true'")
|
||||||
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
|
|
||||||
|
|
||||||
App.TaskManager.execute({
|
App.TaskManager.execute({
|
||||||
|
@ -103,14 +103,14 @@ test( "taskbar basic tests", function() {
|
||||||
show: true,
|
show: true,
|
||||||
persistent: true,
|
persistent: true,
|
||||||
})
|
})
|
||||||
equal( $('#taskbars .content').length, 5, "check available active contents" );
|
equal($('#taskbars .content').length, 5, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#5',show:'true',hide:'false',active:'true'" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#5',show:'true',hide:'false',active:'true'")
|
||||||
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey2').text(), "some test controller message:'#2',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey2').text(), "some test controller message:'#2',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
|
|
||||||
|
|
||||||
App.TaskManager.execute({
|
App.TaskManager.execute({
|
||||||
|
@ -122,28 +122,28 @@ test( "taskbar basic tests", function() {
|
||||||
show: true,
|
show: true,
|
||||||
persistent: false,
|
persistent: false,
|
||||||
})
|
})
|
||||||
equal( $('#taskbars .content').length, 6, "check available active contents" );
|
equal($('#taskbars .content').length, 6, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#6',show:'true',hide:'false',active:'true'" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#6',show:'true',hide:'false',active:'true'")
|
||||||
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey2').text(), "some test controller message:'#2',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey2').text(), "some test controller message:'#2',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey5').text(), "some test controller message:'#5',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey5').text(), "some test controller message:'#5',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
|
|
||||||
|
|
||||||
// remove task#2
|
// remove task#2
|
||||||
App.TaskManager.remove('TestKey2')
|
App.TaskManager.remove('TestKey2')
|
||||||
|
|
||||||
equal( $('#taskbars .content').length, 5, "check available active contents" );
|
equal($('#taskbars .content').length, 5, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#6',show:'true',hide:'false',active:'true'" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#6',show:'true',hide:'false',active:'true'")
|
||||||
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey5').text(), "some test controller message:'#5',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey5').text(), "some test controller message:'#5',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
|
|
||||||
// activate task#3
|
// activate task#3
|
||||||
App.TaskManager.execute({
|
App.TaskManager.execute({
|
||||||
|
@ -155,13 +155,13 @@ test( "taskbar basic tests", function() {
|
||||||
show: true,
|
show: true,
|
||||||
persistent: false,
|
persistent: false,
|
||||||
})
|
})
|
||||||
equal( $('#taskbars .content').length, 5, "check available active contents" );
|
equal($('#taskbars .content').length, 5, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#3',show:'true',hide:'true',active:'true'" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#3',show:'true',hide:'true',active:'true'")
|
||||||
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey1').text(), "some test controller message:'#1',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
equal( $('#taskbars #content_permanent_TestKey5').text(), "some test controller message:'#5',show:'true',hide:'true',active:'false'", "check active content!" );
|
equal($('#taskbars #content_permanent_TestKey5').text(), "some test controller message:'#5',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
|
|
||||||
|
|
||||||
// activate task#1
|
// activate task#1
|
||||||
|
@ -174,38 +174,37 @@ test( "taskbar basic tests", function() {
|
||||||
show: true,
|
show: true,
|
||||||
persistent: false,
|
persistent: false,
|
||||||
})
|
})
|
||||||
equal( $('#taskbars .content').length, 5, "check available active contents" );
|
equal($('#taskbars .content').length, 5, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#1',show:'true',hide:'true',active:'true'" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#1',show:'true',hide:'true',active:'true'")
|
||||||
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'true',hide:'true',active:'false'", "check active content!" );
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!" );
|
|
||||||
equal( $('#taskbars #content_permanent_TestKey5').text(), "some test controller message:'#5',show:'true',hide:'true',active:'false'", "check active content!" );
|
|
||||||
|
|
||||||
|
equal($('#taskbars #content_permanent_TestKey3').text(), "some test controller message:'#3',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
|
equal($('#taskbars #content_permanent_TestKey4').text(), "some test controller message:'#4',show:'false',hide:'true',active:'false'", "check active content!")
|
||||||
|
equal($('#taskbars #content_permanent_TestKey5').text(), "some test controller message:'#5',show:'true',hide:'true',active:'false'", "check active content!")
|
||||||
|
|
||||||
// remove task#1
|
// remove task#1
|
||||||
App.TaskManager.remove('TestKey1')
|
App.TaskManager.remove('TestKey1')
|
||||||
|
|
||||||
// verify if task#3 is active
|
// verify if task#3 is active
|
||||||
equal( $('#taskbars .content').length, 4, "check available active contents" );
|
equal($('#taskbars .content').length, 4, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 0, "check available active contents" );
|
equal($('#taskbars .content.active').length, 0, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "" );
|
equal($('#taskbars .content.active').text(), "")
|
||||||
|
|
||||||
// remove task#3
|
// remove task#3
|
||||||
App.TaskManager.remove('TestKey3')
|
App.TaskManager.remove('TestKey3')
|
||||||
|
|
||||||
// verify if task#5 is active
|
// verify if task#5 is active
|
||||||
equal( $('#taskbars .content').length, 3, "check available active contents" );
|
equal($('#taskbars .content').length, 3, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 0, "check available active contents" );
|
equal($('#taskbars .content.active').length, 0, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "" );
|
equal($('#taskbars .content.active').text(), "")
|
||||||
|
|
||||||
// remove task#5 // can not get removed because of permanent task
|
// remove task#5 // can not get removed because of permanent task
|
||||||
App.TaskManager.remove('TestKey5')
|
App.TaskManager.remove('TestKey5')
|
||||||
|
|
||||||
// verify if task#5 is active
|
// verify if task#5 is active
|
||||||
equal( $('#taskbars .content').length, 3, "check available active contents" );
|
equal($('#taskbars .content').length, 3, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 0, "check available active contents" );
|
equal($('#taskbars .content.active').length, 0, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "" );
|
equal($('#taskbars .content.active').text(), "")
|
||||||
|
|
||||||
// create task#7
|
// create task#7
|
||||||
App.TaskManager.execute({
|
App.TaskManager.execute({
|
||||||
|
@ -217,17 +216,17 @@ test( "taskbar basic tests", function() {
|
||||||
show: true,
|
show: true,
|
||||||
persistent: false,
|
persistent: false,
|
||||||
})
|
})
|
||||||
equal( $('#taskbars .content').length, 4, "check available active contents" );
|
equal($('#taskbars .content').length, 4, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 1, "check available active contents" );
|
equal($('#taskbars .content.active').length, 1, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "some test controller message:'#7',show:'true',hide:'false',active:'true'", "check active content!" );
|
equal($('#taskbars .content.active').text(), "some test controller message:'#7',show:'true',hide:'false',active:'true'", "check active content!")
|
||||||
|
|
||||||
// remove task#7
|
// remove task#7
|
||||||
App.TaskManager.remove('TestKey7')
|
App.TaskManager.remove('TestKey7')
|
||||||
|
|
||||||
// verify if task#5 is active
|
// verify if task#5 is active
|
||||||
equal( $('#taskbars .content').length, 3, "check available active contents" );
|
equal($('#taskbars .content').length, 3, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').length, 0, "check available active contents" );
|
equal($('#taskbars .content.active').length, 0, "check available active contents")
|
||||||
equal( $('#taskbars .content.active').text(), "" );
|
equal($('#taskbars .content.active').text(), "")
|
||||||
|
|
||||||
// check task history
|
// check task history
|
||||||
equal(App.TaskManager.nextTaskUrl(), '#/some/url/#6')
|
equal(App.TaskManager.nextTaskUrl(), '#/some/url/#6')
|
||||||
|
@ -246,7 +245,7 @@ test( "taskbar basic tests", function() {
|
||||||
App.TaskManager.reset()
|
App.TaskManager.reset()
|
||||||
|
|
||||||
// check if any taskar exists
|
// check if any taskar exists
|
||||||
equal( $('#taskbars .content').length, 0, "check available active contents" );
|
equal($('#taskbars .content').length, 0, "check available active contents")
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -110,5 +110,12 @@ class AAbUnitTest < TestCase
|
||||||
css: '.result .failed',
|
css: '.result .failed',
|
||||||
value: '0',
|
value: '0',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
location(url: browser_url + '/tests_taskbar')
|
||||||
|
sleep 4
|
||||||
|
match(
|
||||||
|
css: '.result .failed',
|
||||||
|
value: '0',
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue