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 vertical: true
@navBarController = new Navbar @navBarController = new Navbar
el: elLocal.first() el: elLocal.filter('.sidebar')
view: @view view: @view
@contentController = new Table @contentController = new Table
@ -841,6 +841,20 @@ class Navbar extends App.Controller
render: (data) => render: (data) =>
return if !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 # do not show vertical navigation if only one tab exists
if @vertical if @vertical
@ -918,6 +932,8 @@ class Table extends App.Controller
overview = data.overview overview = data.overview
tickets = data.tickets tickets = data.tickets
return if !overview && !tickets
# get ticket list # get ticket list
ticketListShow = [] ticketListShow = []
for ticket in tickets for ticket in tickets

View file

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