Fixes #3267 - Issue opened in overview doesn't have previous/next buttons if it was opened before
This commit is contained in:
parent
e85f80aa2c
commit
498e5ba487
|
@ -19,7 +19,7 @@ class App.TicketZoom extends App.Controller
|
||||||
@authenticateCheckRedirect()
|
@authenticateCheckRedirect()
|
||||||
|
|
||||||
@formMeta = undefined
|
@formMeta = undefined
|
||||||
@ticket_id = params.ticket_id
|
@ticket_id = parseInt(params.ticket_id)
|
||||||
@article_id = params.article_id
|
@article_id = params.article_id
|
||||||
@sidebarState = {}
|
@sidebarState = {}
|
||||||
|
|
||||||
|
@ -254,6 +254,11 @@ class App.TicketZoom extends App.Controller
|
||||||
return if !@attributeBar
|
return if !@attributeBar
|
||||||
@attributeBar.start()
|
@attributeBar.start()
|
||||||
|
|
||||||
|
if @renderDone && params.overview_id? && @overview_id != params.overview_id
|
||||||
|
@overview_id = params.overview_id
|
||||||
|
|
||||||
|
@renderOverviewNavigator(@el)
|
||||||
|
|
||||||
# scroll to article if given
|
# scroll to article if given
|
||||||
scrollToPosition: (position, delay, article_id) =>
|
scrollToPosition: (position, delay, article_id) =>
|
||||||
scrollToDelay = =>
|
scrollToDelay = =>
|
||||||
|
@ -429,11 +434,7 @@ class App.TicketZoom extends App.Controller
|
||||||
dir: App.i18n.dir()
|
dir: App.i18n.dir()
|
||||||
)
|
)
|
||||||
|
|
||||||
new App.TicketZoomOverviewNavigator(
|
@renderOverviewNavigator(elLocal)
|
||||||
el: elLocal.find('.js-overviewNavigatorContainer')
|
|
||||||
ticket_id: @ticket_id
|
|
||||||
overview_id: @overview_id
|
|
||||||
)
|
|
||||||
|
|
||||||
new App.TicketZoomTitle(
|
new App.TicketZoomTitle(
|
||||||
object_id: @ticket_id
|
object_id: @ticket_id
|
||||||
|
@ -1035,6 +1036,13 @@ class App.TicketZoom extends App.Controller
|
||||||
article: {}
|
article: {}
|
||||||
App.TaskManager.update(@taskKey, { 'state': @localTaskData })
|
App.TaskManager.update(@taskKey, { 'state': @localTaskData })
|
||||||
|
|
||||||
|
renderOverviewNavigator: (parentEl) ->
|
||||||
|
new App.TicketZoomOverviewNavigator(
|
||||||
|
el: parentEl.find('.js-overviewNavigatorContainer')
|
||||||
|
ticket_id: @ticket_id
|
||||||
|
overview_id: @overview_id
|
||||||
|
)
|
||||||
|
|
||||||
class TicketZoomRouter extends App.ControllerPermanent
|
class TicketZoomRouter extends App.ControllerPermanent
|
||||||
requiredPermission: ['ticket.agent', 'ticket.customer']
|
requiredPermission: ['ticket.agent', 'ticket.customer']
|
||||||
constructor: (params) ->
|
constructor: (params) ->
|
||||||
|
|
|
@ -1094,6 +1094,7 @@ RSpec.describe 'Ticket zoom', type: :system do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
# https://github.com/zammad/zammad/issues/3260
|
# https://github.com/zammad/zammad/issues/3260
|
||||||
describe 'next in overview macro changes URL', authenticated_as: :authenticate do
|
describe 'next in overview macro changes URL', authenticated_as: :authenticate do
|
||||||
let(:ticket_a) { create(:ticket, title: 'ticket a', group: Group.first) }
|
let(:ticket_a) { create(:ticket, title: 'ticket a', group: Group.first) }
|
||||||
|
@ -1167,4 +1168,39 @@ RSpec.describe 'Ticket zoom', type: :system do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# https://github.com/zammad/zammad/issues/3267
|
||||||
|
describe 'previous/next buttons are added when open ticket is opened from overview' do
|
||||||
|
let(:ticket_a) { create(:ticket, title: 'ticket a', group: Group.first) }
|
||||||
|
let(:ticket_b) { create(:ticket, title: 'ticket b', group: Group.first) }
|
||||||
|
|
||||||
|
# prepare an opened ticket and go to overview
|
||||||
|
before do
|
||||||
|
ticket_a && ticket_b
|
||||||
|
|
||||||
|
visit "ticket/zoom/#{ticket_a.id}"
|
||||||
|
|
||||||
|
await_empty_ajax_queue
|
||||||
|
|
||||||
|
visit 'ticket/view/all_unassigned'
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'adds previous/next buttons to existing ticket' do
|
||||||
|
within :active_content do
|
||||||
|
click_on ticket_a.title
|
||||||
|
|
||||||
|
expect(page).to have_css('.pagination-counter')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'keeps previous/next buttons when navigating to overview ticket from elsewhere' do
|
||||||
|
within :active_content do
|
||||||
|
click_on ticket_a.title
|
||||||
|
visit 'dashboard'
|
||||||
|
visit "ticket/zoom/#{ticket_a.id}"
|
||||||
|
|
||||||
|
expect(page).to have_css('.pagination-counter')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue