diff --git a/app/assets/javascripts/app/controllers/_ui_element/object_manager_attribute.coffee b/app/assets/javascripts/app/controllers/_ui_element/object_manager_attribute.coffee index 77065db3b..3ad58c43b 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/object_manager_attribute.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/object_manager_attribute.coffee @@ -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: diff --git a/app/assets/javascripts/app/controllers/customer_ticket_create.coffee b/app/assets/javascripts/app/controllers/customer_ticket_create.coffee index 1052f24a6..94e977c29 100644 --- a/app/assets/javascripts/app/controllers/customer_ticket_create.coffee +++ b/app/assets/javascripts/app/controllers/customer_ticket_create.coffee @@ -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') diff --git a/app/assets/javascripts/app/models/_application_model.coffee b/app/assets/javascripts/app/models/_application_model.coffee index 29be7f712..a261d9255 100644 --- a/app/assets/javascripts/app/models/_application_model.coffee +++ b/app/assets/javascripts/app/models/_application_model.coffee @@ -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 diff --git a/app/assets/javascripts/app/views/customer_ticket_create.jst.eco b/app/assets/javascripts/app/views/customer_ticket_create.jst.eco index f8c7b7f4e..c698e335a 100644 --- a/app/assets/javascripts/app/views/customer_ticket_create.jst.eco +++ b/app/assets/javascripts/app/views/customer_ticket_create.jst.eco @@ -3,7 +3,7 @@
@@ -18,7 +18,6 @@
-
<%- @T( 'Cancel & Go Back' ) %> diff --git a/test/browser/customer_ticket_create_test.rb b/test/browser/customer_ticket_create_test.rb index bbc381a2f..c538d420a 100644 --- a/test/browser/customer_ticket_create_test.rb +++ b/test/browser/customer_ticket_create_test.rb @@ -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