Fixed keep body on reply again.

This commit is contained in:
Martin Edenhofer 2015-10-08 12:26:35 +02:00
parent 02548e8051
commit 98db7a1899
3 changed files with 78 additions and 15 deletions

View file

@ -190,7 +190,7 @@ class App.TicketZoomArticleActions extends App.Controller
articleNew.cc = addAddresses(articleNew.cc, article.cc) articleNew.cc = addAddresses(articleNew.cc, article.cc)
# get current body # get current body
body = @el.closest('[data-name="body"]').html() || '' body = @el.closest('.ticketZoom').find('.article-add [data-name="body"]').html() || ''
# check if quote need to be added # check if quote need to be added
selectedText = App.ClipBoard.getSelected() selectedText = App.ClipBoard.getSelected()

View file

@ -95,7 +95,7 @@ class App.TicketZoomArticleNew extends App.Controller
@bind( @bind(
'ui::ticket::setArticleType' 'ui::ticket::setArticleType'
(data) => (data) =>
if data.ticket.id is @ticket.id return if data.ticket.id isnt @ticket.id
#@setArticleType(data.type.name) #@setArticleType(data.type.name)
@openTextarea(null, true) @openTextarea(null, true)
@ -106,14 +106,14 @@ class App.TicketZoomArticleNew extends App.Controller
@$('[name="' + key + '"]').val(value) @$('[name="' + key + '"]').val(value)
# preselect article type # preselect article type
@setArticleType( 'email' ) @setArticleType('email')
) )
# reset new article screen # reset new article screen
@bind( @bind(
'ui::ticket::taskReset' 'ui::ticket::taskReset'
(data) => (data) =>
if data.ticket_id is @ticket.id return if data.ticket_id isnt @ticket.id
@type = 'note' @type = 'note'
@defaults = {} @defaults = {}
@render() @render()

View file

@ -0,0 +1,63 @@
# encoding: utf-8
require 'browser_test_helper'
class AgentTicketActionLevel7Test < TestCase
def test_reply_message_keep_body
# merge ticket with closed tab
@browser = browser_instance
login(
username: 'agent1@example.com',
password: 'test',
url: browser_url,
)
tasks_close_all()
# create new ticket
ticket1 = ticket_create(
data: {
customer: 'nico',
group: 'Users',
title: 'some subject 123äöü - reply test',
body: 'some body 123äöü - reply test',
},
)
sleep 1
# fill body
ticket_update(
data: {
body: 'keep me',
},
do_not_submit: true,
)
# click reply
click( css: '.content.active [data-type="reply"]' )
# check body
watch_for(
css: '.content.active .js-reset',
value: '(Discard your unsaved changes.|Verwerfen der)',
no_quote: true,
)
# check body
ticket_verify(
data: {
body: 'keep me',
},
)
# click reply
click( css: '.content.active [data-type="reply"]' )
# check body
watch_for(
css: '.content.active .js-reset',
value: '(Discard your unsaved changes.|Verwerfen der)',
no_quote: true,
)
end
end