Fixed issue #576 - New ticket attributes are not shown for customer.

This commit is contained in:
Martin Edenhofer 2017-01-03 10:57:05 +01:00
parent 71bb80f95d
commit 048db16129
5 changed files with 26 additions and 20 deletions

View file

@ -11,7 +11,6 @@ class App.UiElement.object_manager_attribute extends App.UiElement.ApplicationUi
updateDataMap = (localParams, localAttribute, localAttributes, localClassname, localForm, localA) =>
localItem = localForm.closest('.js-data')
console.log('updateDataMap', attribute, params)
element = $(App.view("object_manager/attribute/#{localParams.data_type}")(
attribute: attribute
params: params
@ -49,7 +48,7 @@ class App.UiElement.object_manager_attribute extends App.UiElement.ApplicationUi
objects =
Ticket:
Customer:
create:
create_bottom:
shown: true
required: false
edit:

View file

@ -68,17 +68,18 @@ class Index extends App.ControllerContent
params: defaults
noFieldset: true
)
#new App.ControllerForm(
# el: @el.find('.ticket-form-bottom')
# form_id: @form_id
# model: App.Ticket
# screen: 'create_bottom'#@article_attributes['screen']
# handlers: [
# formChanges
# ]
# filter: @formMeta.filter
# params: defaults
#)
if !_.isEmpty(App.Ticket.attributesGet('create_bottom', false, true))
new App.ControllerForm(
el: @el.find('.ticket-form-bottom')
form_id: @form_id
model: App.Ticket
screen: 'create_bottom'
handlers: [
@ticketFormChanges
]
filter: @formMeta.filter
params: defaults
)
new App.ControllerDrox(
el: @el.find('.sidebar')

View file

@ -184,7 +184,7 @@ class App.Model extends Spine.Model
###
@attributesGet: (screen = undefined, attributes = false) ->
@attributesGet: (screen = undefined, attributes = false, noDefaultAttributes = false) ->
if !attributes
attributes = clone(App[ @.className ].configure_attributes, true)
else
@ -203,7 +203,7 @@ class App.Model extends Spine.Model
attributesNew[ attribute.name ] = attribute
# if no screen is given or no attribute has this screen - use default attributes
if !screen || _.isEmpty(attributesNew)
if (!screen || _.isEmpty(attributesNew)) && !noDefaultAttributes
for attribute in attributes
attributesNew[ attribute.name ] = attribute

View file

@ -3,7 +3,7 @@
<div class="newTicket">
<div class="box box--newTicket">
<div class="page-header">
<h1><%- @T( 'New Ticket' ) %></h1>
<h1><%- @T('New Ticket') %></h1>
</div>
<div class="page-content">
@ -18,7 +18,6 @@
<div class="ticket-form-bottom"></div>
</div>
<div class="form-controls">
<a class="btn btn--text btn--subtle js-cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
<button type="submit" class="btn btn--success js-submit align-right"><%- @T( 'Create' ) %></button>

View file

@ -28,6 +28,13 @@ class CustomerTicketCreateTest < TestCase
css: '.newTicket [data-name="body"]',
value: 'some body 123äöü',
)
exists_not(
css: '.newTicket input[name="customer_id"]',
)
exists_not(
css: '.newTicket input[name="priority_id"]',
)
click(css: '.newTicket button.js-submit')
sleep 5
@ -42,7 +49,7 @@ class CustomerTicketCreateTest < TestCase
# update ticket
set(
css: '.active [data-name="body"]',
css: '.content.active [data-name="body"]',
value: 'some body 1234 äöüß',
no_click: true,
)
@ -51,10 +58,10 @@ class CustomerTicketCreateTest < TestCase
type: 'stayOnTab',
)
click(css: '.active .js-submit')
click(css: '.content.active .js-submit')
watch_for(
css: '.active div.ticket-article',
css: '.content.active div.ticket-article',
value: 'some body 1234 äöüß',
)
end