Improved finish of import.

This commit is contained in:
Martin Edenhofer 2016-01-13 17:33:08 +01:00
parent ea10d24c38
commit e779f459b4
3 changed files with 16 additions and 17 deletions

View file

@ -18,6 +18,12 @@ class Index extends App.ControllerContent
@fetch() @fetch()
@bind('import:finished', =>
console.log('import:finished')
@Config.set('system_init_done', true)
@navigate '#'
)
fetch: -> fetch: ->
# get data # get data
@ -79,7 +85,6 @@ class Index extends App.ControllerContent
success: (data, status, xhr) => success: (data, status, xhr) =>
# validate form # validate form
console.log(data)
if data.result is 'ok' if data.result is 'ok'
@urlStatus.attr('data-state', 'success') @urlStatus.attr('data-state', 'success')
@linkErrorMessage.text('') @linkErrorMessage.text('')
@ -103,7 +108,6 @@ class Index extends App.ControllerContent
success: (data, status, xhr) => success: (data, status, xhr) =>
# validate form # validate form
console.log(data)
if data.result is 'ok' if data.result is 'ok'
@delay( @updateMigration, 3000 ) @delay( @updateMigration, 3000 )
) )

View file

@ -412,6 +412,11 @@ module Import::OTRS
Setting.set('system_init_done', true) Setting.set('system_init_done', true)
Setting.set('import_mode', false) Setting.set('import_mode', false)
# broadcast import finish
Sessions.broadcast(
event: 'import:finished',
)
true true
end end

View file

@ -20,9 +20,9 @@ class OtrsImportBrowserTest < TestCase
click(css: 'a[href="#import/otrs"]') click(css: 'a[href="#import/otrs"]')
click(css: 'a.js-download') click(css: '.js-download')
click(css: 'a.js-otrs-link') click(css: '.js-otrs-link')
set( set(
css: '#otrs-link', css: '#otrs-link',
@ -33,24 +33,14 @@ class OtrsImportBrowserTest < TestCase
css: 'svg.icon-checkmark' css: 'svg.icon-checkmark'
) )
click(css: 'a.js-migration-start') click(css: '.js-migration-start')
watch_for( watch_for(
css: 'body', css: 'body',
value: 'xxxx', value: 'login',
timeout: 10, timeout: 300,
) )
# click import
# click otrs
# enter otrs url + key
# watch for import start
# watch for import end
end end
end end