Fixed issue #576 - New ticket attributes are not shown for customer.
This commit is contained in:
parent
71bb80f95d
commit
048db16129
5 changed files with 26 additions and 20 deletions
|
@ -11,7 +11,6 @@ class App.UiElement.object_manager_attribute extends App.UiElement.ApplicationUi
|
||||||
|
|
||||||
updateDataMap = (localParams, localAttribute, localAttributes, localClassname, localForm, localA) =>
|
updateDataMap = (localParams, localAttribute, localAttributes, localClassname, localForm, localA) =>
|
||||||
localItem = localForm.closest('.js-data')
|
localItem = localForm.closest('.js-data')
|
||||||
console.log('updateDataMap', attribute, params)
|
|
||||||
element = $(App.view("object_manager/attribute/#{localParams.data_type}")(
|
element = $(App.view("object_manager/attribute/#{localParams.data_type}")(
|
||||||
attribute: attribute
|
attribute: attribute
|
||||||
params: params
|
params: params
|
||||||
|
@ -49,7 +48,7 @@ class App.UiElement.object_manager_attribute extends App.UiElement.ApplicationUi
|
||||||
objects =
|
objects =
|
||||||
Ticket:
|
Ticket:
|
||||||
Customer:
|
Customer:
|
||||||
create:
|
create_bottom:
|
||||||
shown: true
|
shown: true
|
||||||
required: false
|
required: false
|
||||||
edit:
|
edit:
|
||||||
|
|
|
@ -68,17 +68,18 @@ class Index extends App.ControllerContent
|
||||||
params: defaults
|
params: defaults
|
||||||
noFieldset: true
|
noFieldset: true
|
||||||
)
|
)
|
||||||
#new App.ControllerForm(
|
if !_.isEmpty(App.Ticket.attributesGet('create_bottom', false, true))
|
||||||
# el: @el.find('.ticket-form-bottom')
|
new App.ControllerForm(
|
||||||
# form_id: @form_id
|
el: @el.find('.ticket-form-bottom')
|
||||||
# model: App.Ticket
|
form_id: @form_id
|
||||||
# screen: 'create_bottom'#@article_attributes['screen']
|
model: App.Ticket
|
||||||
# handlers: [
|
screen: 'create_bottom'
|
||||||
# formChanges
|
handlers: [
|
||||||
# ]
|
@ticketFormChanges
|
||||||
# filter: @formMeta.filter
|
]
|
||||||
# params: defaults
|
filter: @formMeta.filter
|
||||||
#)
|
params: defaults
|
||||||
|
)
|
||||||
|
|
||||||
new App.ControllerDrox(
|
new App.ControllerDrox(
|
||||||
el: @el.find('.sidebar')
|
el: @el.find('.sidebar')
|
||||||
|
|
|
@ -184,7 +184,7 @@ class App.Model extends Spine.Model
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
@attributesGet: (screen = undefined, attributes = false) ->
|
@attributesGet: (screen = undefined, attributes = false, noDefaultAttributes = false) ->
|
||||||
if !attributes
|
if !attributes
|
||||||
attributes = clone(App[ @.className ].configure_attributes, true)
|
attributes = clone(App[ @.className ].configure_attributes, true)
|
||||||
else
|
else
|
||||||
|
@ -203,7 +203,7 @@ class App.Model extends Spine.Model
|
||||||
attributesNew[ attribute.name ] = attribute
|
attributesNew[ attribute.name ] = attribute
|
||||||
|
|
||||||
# if no screen is given or no attribute has this screen - use default attributes
|
# 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
|
for attribute in attributes
|
||||||
attributesNew[ attribute.name ] = attribute
|
attributesNew[ attribute.name ] = attribute
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="newTicket">
|
<div class="newTicket">
|
||||||
<div class="box box--newTicket">
|
<div class="box box--newTicket">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1><%- @T( 'New Ticket' ) %></h1>
|
<h1><%- @T('New Ticket') %></h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
|
@ -18,7 +18,6 @@
|
||||||
<div class="ticket-form-bottom"></div>
|
<div class="ticket-form-bottom"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-controls">
|
<div class="form-controls">
|
||||||
<a class="btn btn--text btn--subtle js-cancel" href="#/"><%- @T( 'Cancel & Go Back' ) %></a>
|
<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>
|
<button type="submit" class="btn btn--success js-submit align-right"><%- @T( 'Create' ) %></button>
|
||||||
|
|
|
@ -28,6 +28,13 @@ class CustomerTicketCreateTest < TestCase
|
||||||
css: '.newTicket [data-name="body"]',
|
css: '.newTicket [data-name="body"]',
|
||||||
value: 'some body 123äöü',
|
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')
|
click(css: '.newTicket button.js-submit')
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
@ -42,7 +49,7 @@ class CustomerTicketCreateTest < TestCase
|
||||||
|
|
||||||
# update ticket
|
# update ticket
|
||||||
set(
|
set(
|
||||||
css: '.active [data-name="body"]',
|
css: '.content.active [data-name="body"]',
|
||||||
value: 'some body 1234 äöüß',
|
value: 'some body 1234 äöüß',
|
||||||
no_click: true,
|
no_click: true,
|
||||||
)
|
)
|
||||||
|
@ -51,10 +58,10 @@ class CustomerTicketCreateTest < TestCase
|
||||||
type: 'stayOnTab',
|
type: 'stayOnTab',
|
||||||
)
|
)
|
||||||
|
|
||||||
click(css: '.active .js-submit')
|
click(css: '.content.active .js-submit')
|
||||||
|
|
||||||
watch_for(
|
watch_for(
|
||||||
css: '.active div.ticket-article',
|
css: '.content.active div.ticket-article',
|
||||||
value: 'some body 1234 äöüß',
|
value: 'some body 1234 äöüß',
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue