diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/attribute_bar.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/attribute_bar.coffee index ea591ce00..047216e1f 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/attribute_bar.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/attribute_bar.coffee @@ -14,9 +14,9 @@ class App.TicketZoomAttributeBar extends App.Controller constructor: -> super - @secondaryAction = @preferencesGet() || 'closeTab' - if !@overview_id && @secondaryAction is 'closeNextInOverview' - @secondaryAction = 'closeTab' + @secondaryAction = 'closeTab' + if @overview_id + @secondaryAction = 'closeNextInOverview' @subscribeId = App.Macro.subscribe(@render) @render() @@ -71,10 +71,3 @@ class App.TicketZoomAttributeBar extends App.Controller element.closest('.js-secondaryAction').find('.js-selectedIcon').addClass('is-selected') @secondaryActionButton.text(text) @secondaryActionButton.data('type', type) - App.LocalStorage.set(@preferencesStoreKey(), type, @Session.get('id')) - - preferencesGet: => - App.LocalStorage.get(@preferencesStoreKey(), @Session.get('id')) - - preferencesStoreKey: => - "ticketZoom:taskAktion:#{@ticket_id}" diff --git a/app/assets/javascripts/app/views/ticket_zoom/attribute_bar.jst.eco b/app/assets/javascripts/app/views/ticket_zoom/attribute_bar.jst.eco index 54d01394b..a034efd86 100644 --- a/app/assets/javascripts/app/views/ticket_zoom/attribute_bar.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom/attribute_bar.jst.eco @@ -1,7 +1,6 @@ -
<%- @T('Discard your unsaved changes.') %>
+
<%- @T('Discard your unsaved changes.') %>
<% if @macroDisabled: %>
<%- @T('Update') %>
<% else: %> diff --git a/test/browser/agent_ticket_actions_level3_test.rb b/test/browser/agent_ticket_actions_level3_test.rb index ea097d6b9..fe73acef5 100644 --- a/test/browser/agent_ticket_actions_level3_test.rb +++ b/test/browser/agent_ticket_actions_level3_test.rb @@ -248,6 +248,11 @@ class AgentTicketActionsLevel3Test < TestCase no_quote: true, ) + task_type( + browser: browser2, + type: 'stayOnTab', + ) + click( browser: browser2, css: '.active .js-submit', diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 4debb6542..c5c477821 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -583,6 +583,28 @@ class TestCase < Test::Unit::TestCase match(params) end +=begin + + task_type( + :browser => browser1, + :type => 'stayOnTab', + ) + +=end + + def task_type(params) + log('task_type', params) + + instance = params[:browser] || @browser + + if params[:type] + instance.find_elements( { css: '.content.active .js-secondaryActionButtonLabel' } )[0].click + instance.find_elements( { css: ".content.active .js-secondaryActionLabel[data-type=#{params[:type]}]" } )[0].click + return + end + fail "Unknown params for task_type: #{params.inspect}" + end + =begin cookie( @@ -1312,6 +1334,11 @@ wait untill text in selector disabppears end end + task_type( + browser: instance, + type: 'stayOnTab', + ) + if params[:do_not_submit] assert( true, 'ticket updated without submit' ) return true