Introduced error screen if no overview is assigned to

This commit is contained in:
Martin Edenhofer 2017-05-04 10:06:13 +02:00
parent 764784908f
commit 32e2f822ab
2 changed files with 19 additions and 2 deletions

View file

@ -537,7 +537,7 @@ class App.TicketOverview extends App.Controller
vertical: true
@navBarController = new Navbar
el: elLocal.first()
el: elLocal.filter('.sidebar')
view: @view
@contentController = new Table
@ -841,6 +841,20 @@ class Navbar extends App.Controller
render: (data) =>
return if !data
content = @el.closest('.content')
if _.isArray(data) && _.isEmpty(data)
content.find('.sidebar').addClass('hide')
content.find('.main').addClass('hide')
content.find('.js-error').removeClass('hide')
@renderScreenError(
el: @el.closest('.content').find('.js-error')
detail: 'Currently no overview is assigned to your roles. Please contact your administrator.'
objectName: 'Ticket'
)
return
content.find('.sidebar').removeClass('hide')
content.find('.main').removeClass('hide')
content.find('.js-error').addClass('hide')
# do not show vertical navigation if only one tab exists
if @vertical
@ -918,6 +932,8 @@ class Table extends App.Controller
overview = data.overview
tickets = data.tickets
return if !overview && !tickets
# get ticket list
ticketListShow = []
for ticket in tickets

View file

@ -58,7 +58,8 @@ class _Singleton
if data.assets
App.Collection.loadAssets(data.assets)
delete data.assets
@overview[data.index.overview.view] = data.index
if data.index && data.index.overview
@overview[data.index.overview.view] = data.index
@callback(view, data.index)
error: =>
@fetchActive[view] = false